/* =========================================================================
   Cart / Checkout / Login  (loaded only on cart.html, checkout.html, login.html)
   All sizes in em = design px / 16 (Osmo scaling). When an element sets its
   own font-size, its own spacing is divided by that px value.
   ========================================================================= */

:root {
  --co-field-bg: #fff7e2;
  --co-error: #9c2b1c;
  --co-success: #0f9a3a;
  --co-success-ink: #0b7c2e;
}

/* ------------------------- Page shell ------------------------- */

.co-page {
  padding-bottom: 10em; /* 160px spacer before footer */
}

.co-page [hidden] {
  display: none !important;
}

/* Heading block: design 60px top (+ fixed 32px header) */
.co-head {
  padding: 5.75em 0.75em 0;
}

.co-head__title {
  font-size: 4.375em; /* 70 */
  line-height: 0.8571; /* 60 */
}

.co-head__count {
  margin: 0.7143em 0 2.8571em; /* 10 / 40 @14 */
  font-size: 0.875em;
  font-weight: 700;
}

.co-head.is--checkout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25em;
  padding-bottom: 2.5em;
}

.co-steps {
  display: flex;
  gap: 2em; /* 24 @12 */
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-gold);
}

.co-steps a {
  color: var(--color-gold);
  text-decoration: none;
}

.co-steps a:hover {
  color: var(--color-hover);
}

.co-steps [aria-current="step"] {
  color: var(--color-dark);
}

/* Two columns: content + 440px summary */
.co-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 27.5em);
  gap: 3.75em;
  align-items: start;
  padding: 0 0.75em;
}

/* ------------------------- Cart items ------------------------- */

.co-items__head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.5em; /* 6 @12 */
  border-bottom: 1px solid var(--color-rule);
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
}

.co-items__list,
.co-mini {
  margin: 0;
  padding: 0;
  list-style: none;
}

.co-item {
  display: flex;
  gap: 1.25em;
  padding: 1.25em 0;
  border-bottom: 1px solid var(--color-line);
}

.co-item__media {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7.5em; /* 120 */
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--color-line);
}

.co-item__img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* Tall cigar shots are laid diagonally, as in the design (rotate 42deg) */
.co-item__img.is--tall {
  transform: rotate(42deg);
}

.co-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375em;
}

.co-item__name {
  font-size: 1.75em; /* 28 */
  line-height: 1;
}

.co-item__meta {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-gold);
}

.co-item__unit {
  font-size: 0.8125em;
  font-weight: 500;
}

.co-item__controls {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-top: auto;
}

.co-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-rule);
}

.co-qty__btn {
  width: 2.2222em; /* 40 @18 */
  height: 2.2222em;
  padding: 0;
  background: none;
  border: 0;
  font-size: 1.125em;
  font-weight: 700;
  color: var(--color-dark);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.co-qty__btn:hover {
  background: var(--color-leaf);
}

.co-qty__btn:disabled {
  color: var(--color-rule);
  cursor: default;
  background: none;
}

.co-qty__value {
  min-width: 1.7143em; /* 24 @14 */
  font-size: 0.875em;
  font-weight: 700;
  text-align: center;
}

.co-item__remove {
  min-height: 3.3333em; /* 40 @12 */
  padding: 0;
  background: none;
  border: 0;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: underline;
  color: var(--color-dark);
  cursor: pointer;
}

.co-item__remove:hover {
  color: var(--color-hover);
}

.co-item__line {
  font-size: 1em;
  font-weight: 700;
  white-space: nowrap;
}

.co-back {
  display: inline-block;
  margin-top: 1.6667em; /* 20 @12 */
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
}

/* ------------------------- Summary ------------------------- */

.co-summary {
  position: sticky;
  top: 2.75em; /* 44 */
  display: flex;
  flex-direction: column;
  gap: 0.875em;
  padding: 1.25em;
  border: 1px solid var(--color-line);
}

.co-summary__title {
  font-size: 1.125em;
  font-weight: 700;
  text-transform: uppercase;
}

.co-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8571em;
  font-size: 0.875em;
  font-weight: 500;
}

.co-row.is--rule {
  padding-top: 1em; /* 14 @14 */
  border-top: 1px solid var(--color-rule);
}

.co-row.is--total {
  padding-top: 0.7778em; /* 14 @18 */
  border-top: 1px solid var(--color-rule);
  font-size: 1.125em;
  font-weight: 700;
}

.co-summary__note {
  margin-top: -0.5em; /* -6 @12 */
  font-size: 0.75em;
  font-weight: 500;
  color: var(--color-hover);
}

.co-summary__vat {
  margin-top: -0.6667em; /* -8 @12 */
  font-size: 0.75em;
  font-weight: 500;
  color: var(--color-hover);
}

.btn-dark.co-summary__cta {
  min-height: 3.6923em; /* 48 @13 */
  font-weight: 700;
  text-transform: uppercase;
}

.co-summary__login {
  font-size: 0.75em;
  font-weight: 700;
  text-align: center;
}

.co-summary__legal {
  font-size: 0.75em;
  line-height: 1.25;
  font-weight: 500;
  color: var(--color-hover);
}

.co-summary__edit {
  align-self: flex-start;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
}

.co-promo {
  display: flex;
  gap: 0.375em;
}

.co-promo .co-input {
  flex: 1;
  min-width: 0;
}

.btn-dark.co-promo__btn {
  min-height: 3.3846em; /* 44 @13 */
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.co-promo__msg {
  font-size: 0.75em;
  font-weight: 500;
  color: var(--color-hover);
}

/* Mini line items (checkout summary) */
.co-mini {
  display: flex;
  flex-direction: column;
  gap: 0.875em;
}

.co-mini__item {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.co-mini__media {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4em; /* 64 */
  aspect-ratio: 1;
  border: 1px solid var(--color-line);
}

.co-mini__badge {
  position: absolute;
  top: -0.7273em; /* -8 @11 */
  right: -0.7273em;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8182em; /* 20 @11 */
  height: 1.8182em;
  padding: 0 0.3em;
  border-radius: 0.9091em;
  background: var(--color-dark);
  color: var(--color-cream);
  font-size: 0.6875em;
  font-weight: 700;
}

.co-mini__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.co-mini__name {
  font-size: 1.25em; /* 20 */
  line-height: 1;
}

.co-mini__meta {
  font-size: 0.6875em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-gold);
}

.co-mini__line {
  font-size: 0.875em;
  font-weight: 700;
  white-space: nowrap;
}

/* ------------------------- Empty / done states ------------------------- */

.co-empty,
.co-done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25em;
  padding: 1.25em 0.75em 0;
}

.co-done {
  max-width: 47.5em; /* 760 */
  gap: 1.125em;
  padding-top: 0;
}

.co-done:focus {
  outline: none;
}

.co-empty__text {
  font-size: 2.5em; /* 40 */
  line-height: 1;
}

.co-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.btn-dark.co-empty__btn {
  min-height: 3.3846em; /* 44 @13 */
  min-width: 15.3846em; /* 200 @13 */
  font-weight: 700;
  text-transform: uppercase;
}

.co-done__title {
  font-size: 3.125em; /* 50 */
  line-height: 0.96; /* 48 */
}

.co-done__text {
  font-size: 1em;
  line-height: 1.25;
  font-weight: 500;
}

/* ------------------------- Form controls ------------------------- */

.co-form {
  display: flex;
  flex-direction: column;
  gap: 3em; /* 48 */
}

.co-set {
  display: flex;
  flex-direction: column;
  gap: 0.875em;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.co-set.is--delivery {
  gap: 0.5em;
}

.co-legend {
  width: 100%;
  margin-bottom: 0.3333em; /* 6 @18 */
  padding: 0 0 0.6667em; /* 12 @18 */
  border-bottom: 1px solid var(--color-rule);
  font-size: 1.125em;
  font-weight: 700;
  text-transform: uppercase;
}

.co-set.is--delivery .co-legend {
  margin-bottom: 0.7778em; /* 14 @18 */
}

.co-set__note {
  font-size: 0.8125em;
  font-weight: 500;
}

.co-set__note a {
  font-weight: 700;
}

.co-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75em;
}

.co-field {
  display: flex;
  flex-direction: column;
  gap: 0.375em;
  min-width: 0;
}

.co-field__label {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
}

.co-field__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
}

.co-field__aside {
  font-size: 0.75em;
  font-weight: 500;
}

.co-input {
  width: 100%;
  min-height: 2.9333em; /* 44 @15 */
  padding: 0 0.8em; /* 12 @15 */
  background: var(--co-field-bg);
  border: 1px solid var(--color-rule);
  border-radius: 0;
  font-family: inherit;
  font-size: 0.9375em;
  font-weight: 500;
  color: var(--color-dark);
}

.co-input.is--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23050001' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8em center;
  background-size: 0.6667em auto;
}

.co-input:focus {
  outline: 2px solid var(--color-dark);
  outline-offset: -1px;
  border-color: var(--color-dark);
}

.co-input[aria-invalid="true"] {
  border-color: var(--co-error);
  outline-color: var(--co-error);
}

.co-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7692em; /* 10 @13 */
  font-size: 0.8125em;
  line-height: 1.3077; /* 17 @13 */
  font-weight: 500;
  cursor: pointer;
}

.co-check__box {
  flex: none;
  width: 1.3846em; /* 18 @13 */
  height: 1.3846em;
  margin: 0;
  accent-color: var(--color-dark);
}

.co-check__box[aria-invalid="true"] {
  outline: 2px solid var(--co-error);
  outline-offset: 1px;
}

.co-error {
  font-size: 0.875em;
  font-weight: 500;
  color: var(--co-error);
}

/* Delivery options (radio cards) */
.co-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em; /* 12 @12 */
  min-height: 4.6667em; /* 56 @12 */
  padding: 0 1.1667em; /* 14 @12 */
  border: 1px solid var(--color-rule);
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.co-opt:hover {
  border-color: var(--color-dark);
}

.co-opt:has(.co-opt__input:checked) {
  border-color: var(--color-dark);
  box-shadow: inset 0 0 0 1px var(--color-dark);
}

.co-opt:has(.co-opt__input:focus-visible) {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.co-opt__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.co-opt__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25em; /* 3 @12 */
}

.co-opt__eta {
  font-weight: 500;
  text-transform: none;
  color: var(--color-hover);
}

.co-submit {
  display: flex;
  flex-direction: column;
  gap: 0.75em; /* legal sits 12px under the button */
}

.btn-dark.co-submit__btn {
  width: 100%;
  min-height: 4em; /* 52 @13 */
  border: 0;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

/* taller than the default button: push the rolling copy further down */
.co-submit__btn .btn__text {
  text-shadow: 0 3em currentColor;
}

.co-submit__btn:hover .btn__text,
.co-submit__btn:focus-visible .btn__text {
  transform: translateY(-3em);
}

.co-submit__legal {
  font-size: 0.75em;
  line-height: 1.25;
  font-weight: 500;
  color: var(--color-hover);
}

/* ------------------------- Login ------------------------- */

.login {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 53.75em; /* 860 */
  margin-top: calc(2em + 3px);
}

.login__media {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 1em 1.75em; /* 0 16 28 */
  overflow: hidden;
}

.login__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login__quote {
  position: relative;
  max-width: 10.4em; /* 520 @50 */
  font-size: 3.125em;
  line-height: 0.92; /* 46 */
  color: var(--color-cream);
}

.login__panel {
  display: flex;
  flex-direction: column;
  gap: 1.75em; /* 28 */
  padding: 4.375em 5.4em 3.75em; /* 70 / 6vw@1440 / 60 */
}

.login__tabs {
  display: flex;
  gap: 0.8235em; /* 28 @34 */
  font-size: 2.125em; /* 34 */
  border-bottom: 1px solid var(--color-rule);
}

.login__tab {
  min-height: 1.2941em; /* 44 @34 */
  margin-bottom: -1px;
  padding: 0 0 0.2941em; /* 10 @34 */
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: var(--font-serif);
  font-size: 1em;
  font-weight: 400;
  color: var(--color-gold);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.login__tab:hover {
  color: var(--color-hover);
}

.login__tab[aria-selected="true"] {
  color: var(--color-dark);
  border-bottom-color: var(--color-dark);
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.btn-dark.login__submit {
  min-height: 3.6923em; /* 48 @13 */
  border: 0;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.login__done {
  padding: 0.8571em 1em; /* 12 14 @14 */
  border: 1px solid var(--co-success);
  font-size: 0.875em;
  font-weight: 700;
  color: var(--co-success-ink);
}

.login__guest {
  display: flex;
  flex-direction: column;
  gap: 0.625em;
  padding-top: 1.5em;
  border-top: 1px solid var(--color-line);
}

.login__guest-label {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
}

.login__guest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.6667em; /* 44 @12 */
  border: 1px solid var(--color-dark);
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.login__guest-btn:hover {
  background: var(--color-dark);
  color: var(--color-cream);
}

/* ------------------------- Tablet ------------------------- */

@media screen and (max-width: 991px) {
  .co-head {
    padding-top: 6.75em; /* 3em header + 60 */
  }

  .co-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5em;
  }

  .co-summary {
    position: static;
  }

  .login {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    margin-top: calc(3em + 3px);
  }

  .login__media {
    min-height: 20em; /* 320 */
  }

  .login__panel {
    padding: 4.375em 0.75em 3.75em;
  }
}

/* ------------------------- Mobile (design 402) ------------------------- */

@media screen and (max-width: 767px) {
  .co-head {
    padding-top: 6.0625em; /* 37 header + 60 */
  }

  .co-head__title {
    font-size: 2.75em; /* 44 */
    line-height: 0.9091; /* 40 */
  }

  .co-cols {
    gap: 2.25em; /* 36 */
    padding: 0 0.5625em; /* 9 */
  }

  .co-summary {
    padding: 1em;
  }

  .co-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .co-item {
    gap: 0.75em;
  }

  .co-item__media {
    width: 5.25em; /* 84 */
  }

  .co-item__name {
    font-size: 1.375em; /* 22 */
  }

  .co-steps {
    flex-wrap: wrap;
    gap: 0.5em 2em;
  }

  .login {
    margin-top: calc(2.3125em + 3px);
  }

  .login__quote {
    font-size: 2.125em; /* 34 */
    line-height: 0.9412; /* 32 */
    max-width: 15.2941em;
  }

  .login__panel {
    padding: 2.5em 0.5625em 3.75em; /* 40 9 60 */
  }

  .login__tabs {
    font-size: 1.75em; /* 28 */
    gap: 1em; /* 28 @28 */
  }

  .login__tab {
    min-height: 1.5714em; /* 44 @28 */
    padding-bottom: 0.3571em; /* 10 @28 */
  }
}
