/*
 * cart.css — NorApotek
 * Styles specific to the cart page (cart.html).
 * Requires: base.css loaded first.
 */

/* ══════════════════
   PAGE LAYOUT
══════════════════ */
.cart-page { padding: 0 0 80px; }
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
  padding: 32px 0 0;
}

/* ══════════════════
   PAGE HEADING
══════════════════ */
.cart-heading {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 24px;
}
.cart-heading h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700; color: var(--g900); letter-spacing: -.5px;
}
.cart-heading .item-count {
  font-size: 15px; color: var(--muted); font-weight: 400;
}

/* ══════════════════
   CART ITEMS COLUMN
══════════════════ */
.cart-items { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px;
  display: grid; grid-template-columns: 88px 1fr auto;
  gap: 20px; align-items: center;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}
.cart-item:hover { border-color: var(--g400); box-shadow: 0 4px 18px rgba(11,42,26,.06); }
.cart-item.removing {
  opacity: 0; transform: translateX(20px);
  transition: opacity .3s ease, transform .3s ease;
}

/* product image cell */
.ci-img {
  width: 88px; height: 88px; background: var(--g50);
  border-radius: 10px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; flex-shrink: 0;
}

/* product info cell */
.ci-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ci-brand { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.ci-name {
  font-size: 16px; font-weight: 600; color: var(--g900);
  text-decoration: none; line-height: 1.3;
}
.ci-name:hover { color: var(--g700); }
.ci-form { font-size: 13px; color: var(--muted); }
.ci-rx-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(11,42,26,.07); border-radius: 4px;
  padding: 2px 8px; font-size: 11px; font-weight: 600; color: var(--g800);
  width: fit-content;
}
.ci-price-unit { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* actions cell */
.ci-actions {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 12px; flex-shrink: 0;
}
.ci-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px; font-weight: 700; color: var(--g900); line-height: 1;
  white-space: nowrap;
}
.ci-price-old {
  font-size: 13px; color: var(--muted);
  text-decoration: line-through; text-align: right; margin-top: -8px;
}

/* quantity control */
.qty-ctrl {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden;
}
.qty-btn {
  background: var(--g50); border: none; width: 34px; height: 34px;
  font-size: 18px; cursor: pointer; color: var(--g700);
  transition: background .15s; font-family: 'Jost', sans-serif; flex-shrink: 0;
}
.qty-btn:hover { background: var(--g100); }
.qty-btn:disabled { color: var(--border); cursor: default; }
.qty-num {
  width: 40px; text-align: center; font-size: 15px; font-weight: 600;
  color: var(--g900); border: none; outline: none;
  background: transparent; font-family: 'Jost', sans-serif;
}

/* remove button */
.ci-remove {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--muted); padding: 0;
  font-family: 'Jost', sans-serif; transition: color .2s;
  display: flex; align-items: center; gap: 4px;
}
.ci-remove:hover { color: var(--red); }

/* ══════════════════
   RX NOTICE BANNER
══════════════════ */
.rx-notice {
  background: rgba(11,42,26,.04); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  display: flex; gap: 12px; align-items: flex-start;
}
.rx-notice .ri { font-size: 20px; flex-shrink: 0; }
.rx-notice p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
.rx-notice strong { color: var(--g800); }

/* ══════════════════
   PROMO CODE
══════════════════ */
.promo-block {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
}
.promo-label {
  font-size: 13px; font-weight: 600; color: var(--g900);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.promo-row { display: flex; gap: 8px; }
.promo-input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 7px;
  padding: 10px 14px; font-size: 14px; font-family: 'Jost', sans-serif;
  color: var(--text); outline: none; transition: border-color .2s;
  text-transform: uppercase; letter-spacing: 1px;
}
.promo-input::placeholder { text-transform: none; letter-spacing: 0; color: #a0b5a5; }
.promo-input:focus { border-color: var(--g600); }
.promo-input.valid { border-color: var(--g500); background: var(--g50); }
.promo-input.invalid { border-color: var(--red); }
.btn-promo {
  background: var(--g700); color: #fff; border: none; cursor: pointer;
  border-radius: 7px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  font-family: 'Jost', sans-serif; transition: background .2s; white-space: nowrap;
}
.btn-promo:hover { background: var(--g800); }
.promo-result { margin-top: 8px; font-size: 13px; font-weight: 500; }
.promo-result.ok { color: var(--g600); }
.promo-result.err { color: var(--red); }

/* ══════════════════
   CONTINUE SHOPPING
══════════════════ */
.continue-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--g600); text-decoration: none;
  margin-top: 4px;
}
.continue-link:hover { color: var(--g800); text-decoration: underline; }

/* ══════════════════
   ORDER SUMMARY (sticky sidebar)
══════════════════ */
.order-summary {
  position: sticky; top: 84px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.os-header {
  background: var(--g900); padding: 18px 22px;
}
.os-header h2 {
  font-family: 'Cormorant Garamond', serif; font-size: 20px;
  font-weight: 700; color: #fff; letter-spacing: -.3px;
}
.os-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 0; }

/* delivery options */
.delivery-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.delivery-opt {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--border); border-radius: 9px;
  padding: 12px 14px; cursor: pointer; transition: border-color .2s, background .2s;
}
.delivery-opt:hover { border-color: var(--g400); }
.delivery-opt.selected { border-color: var(--g600); background: var(--g50); }
.delivery-opt input[type=radio] {
  appearance: none; width: 17px; height: 17px;
  border: 2px solid var(--border); border-radius: 50%; flex-shrink: 0;
  transition: border-color .2s; position: relative; cursor: pointer;
}
.delivery-opt.selected input[type=radio] { border-color: var(--g600); background: var(--g600); box-shadow: inset 0 0 0 3px #fff; }
.delivery-opt-info { flex: 1; }
.delivery-opt-name { font-size: 14px; font-weight: 600; color: var(--g900); }
.delivery-opt-desc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.delivery-opt-price { font-size: 14px; font-weight: 700; color: var(--g800); white-space: nowrap; }
.delivery-opt-price.free { color: var(--g600); }

/* price breakdown */
.os-lines { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-top: 1px solid var(--border); }
.os-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.os-line .ol-label { color: var(--muted); }
.os-line .ol-val { color: var(--g900); font-weight: 500; }
.os-line.discount .ol-label { color: var(--g600); }
.os-line.discount .ol-val { color: var(--g600); font-weight: 600; }
.os-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 0; border-top: 2px solid var(--g900); margin-top: 4px;
}
.os-total .ot-label { font-size: 16px; font-weight: 700; color: var(--g900); }
.os-total .ot-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 700; color: var(--g900); line-height: 1;
}
.os-vat { font-size: 11px; color: var(--muted); text-align: right; margin-top: -2px; }

/* checkout button */
.btn-checkout {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: var(--g700); color: #fff; border: none; cursor: pointer;
  border-radius: 9px; padding: 16px; font-size: 16px; font-weight: 700;
  font-family: 'Jost', sans-serif; text-decoration: none;
  transition: background .2s, transform .15s; margin-top: 18px;
}
.btn-checkout:hover { background: var(--g800); transform: translateY(-1px); }
.btn-checkout:active { transform: translateY(0); }


/* trust badges */
.os-trust { display: flex; flex-direction: column; gap: 7px; padding: 16px 0 0; }
.os-trust-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.os-trust-item .ti { font-size: 15px; }

/* ══════════════════
   EMPTY CART STATE
══════════════════ */
.cart-empty {
  text-align: center; padding: 80px 20px;
  display: none; flex-direction: column; align-items: center; gap: 16px;
}
.cart-empty.visible { display: flex; }
.ce-icon { font-size: 72px; opacity: .3; }
.ce-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 700; color: var(--g900); }
.ce-text { font-size: 15px; color: var(--muted); max-width: 340px; line-height: 1.7; }
.btn-shop {
  background: var(--g700); color: #fff; text-decoration: none;
  border-radius: 8px; padding: 13px 28px; font-size: 15px; font-weight: 600;
  font-family: 'Jost', sans-serif; transition: background .2s; margin-top: 8px;
}
.btn-shop:hover { background: var(--g800); }

/* ══════════════════
   YOU MIGHT ALSO LIKE
══════════════════ */
.upsell { padding: 56px 0 0; }
.upsell-label { font-size: 11px; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase; color: var(--g600); margin-bottom: 8px; }
.upsell-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(24px, 3vw, 34px); font-weight: 700; color: var(--g900); margin-bottom: 24px; letter-spacing: -.3px; }
.upsell-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.upsell-card {
  border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--white); transition: border-color .2s, box-shadow .2s; cursor: pointer;
  display: flex; flex-direction: column;
}
.upsell-card:hover { border-color: var(--g500); box-shadow: 0 6px 22px rgba(11,42,26,.09); }
.uc-img { height: 110px; background: var(--g50); display: flex; align-items: center; justify-content: center; font-size: 46px; border-bottom: 1px solid var(--border); }
.uc-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.uc-brand { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.uc-name { font-size: 14px; font-weight: 600; color: var(--g900); margin: 4px 0 auto; line-height: 1.3; padding-bottom: 10px; }
.uc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border); gap: 8px; }
.uc-price { font-family: 'Cormorant Garamond', serif; font-size: 19px; font-weight: 700; color: var(--g900); }
.btn-uc { background: var(--g700); color: #fff; border: none; cursor: pointer; border-radius: 5px; padding: 7px 12px; font-size: 12px; font-weight: 600; font-family: 'Jost', sans-serif; transition: background .2s; white-space: nowrap; }
.btn-uc:hover { background: var(--g800); }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 960px) {
  .cart-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
  .upsell-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .cart-item { grid-template-columns: 72px 1fr; gap: 14px; }
  .ci-actions { flex-direction: row; align-items: center; grid-column: span 2; justify-content: space-between; }
  .ci-img { width: 72px; height: 72px; font-size: 34px; }
  .ci-price { font-size: 20px; }
  .upsell-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 380px) {
  .upsell-grid { grid-template-columns: 1fr 1fr; }
  .os-body { padding: 16px; }
}
.qty-num {
    -moz-appearance: textfield;
    padding: 0;
}

    .qty-num::-webkit-outer-spin-button,
    .qty-num::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }