/* ==========================================================================
   Mr P Pharmacy — Online Shop
   Shared stylesheet for all pages
   ========================================================================== */

:root{
  color-scheme: light;
  --blue:       #2563EB;
  --blue-dark:  #1D4ED8;
  --blue-tint:  #EAF1FF;
  --blue-tint-deep: #D9E6FF;
  --red:        #E1382A;
  --red-dark:   #BE2A1F;
  --red-tint:   #FCE7E4;
  --white:      #FFFFFF;
  --ink:        #1E2430;
  --ink-soft:   #5B6472;
  --ink-faint:  #96A0AE;
  --line:       #E5E9F1;
  --green:      #2E9E5B;
  --shadow:     0 12px 30px -14px rgba(30, 36, 48, 0.18);
  --shadow-lift: 0 18px 34px -16px rgba(37, 99, 235, 0.28);
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  26px;
  --header-h:   80px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4{
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p{ margin: 0; }

a{ color: var(--blue); text-decoration: none; transition: color 0.15s ease; }
a:hover{ color: var(--blue-dark); }

img{ max-width: 100%; display: block; }

ul{ list-style: none; margin: 0; padding: 0; }

button{ font-family: inherit; }

.container{
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.btn:active{ transform: scale(0.97); }
.btn-primary{ background: var(--blue); color: #fff; }
.btn-primary:hover{ background: var(--blue-dark); color: #fff; box-shadow: var(--shadow-lift); }
.btn-outline{ background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover{ border-color: var(--red); color: var(--red); }
.btn-block{ width: 100%; }
.btn[disabled]{ opacity: 0.5; cursor: not-allowed; }

/* ---------- Header ---------- */

.site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner{
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand{
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand img.logo{
  height: 42px;
  width: auto;
  display: block;
}

.main-nav{ display: flex; align-items: center; gap: 34px; }
.main-nav a{
  position: relative;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 15px;
  padding: 6px 0;
}
.main-nav a::after{
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--blue); border-radius: 2px;
  transition: right 0.2s ease;
}
.main-nav a:hover{ color: var(--red); }
.main-nav a:hover::after{ right: 0; }
.main-nav a.active{ color: var(--blue); }
.main-nav a.active::after{ right: 0; }

.header-actions{ display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn{
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover{ border-color: var(--red); color: var(--red); }
.icon-btn.bump{ animation: bump 0.35s ease; }
@keyframes bump{
  0%{ transform: scale(1); }
  35%{ transform: scale(1.16); }
  100%{ transform: scale(1); }
}
.cart-count{
  position: absolute; top: -5px; right: -5px;
  min-width: 19px; height: 19px; padding: 0 4px;
  border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.account-pill{
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.account-pill:hover{ border-color: var(--red); }
.account-pill .avatar{
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}

.menu-toggle{ display: none; }

/* ---------- Hero ---------- */

.hero{
  background: linear-gradient(180deg, var(--blue-tint) 0%, var(--blue-tint) 55%, var(--white) 100%);
  padding: 48px 0 40px 0;
  position: relative;
  overflow: hidden;
}
.hero::before{
  content: "";
  position: absolute;
  top: -140px; right: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: var(--blue-tint-deep);
  z-index: 0;
}
.hero-inner{
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 56px;
}
.hero-copy{ flex: 1.1; animation: fadeUp 0.6s ease both; }
.hero-tag{
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white);
  border: 1px solid var(--blue-tint-deep);
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--blue-dark);
  margin-bottom: 20px;
}
.hero-tag svg{ color: var(--red); flex-shrink: 0; }
.hero h1{
  font-size: 50px;
  line-height: 1.06;
  max-width: 600px;
}
.hero h1 .accent{ color: var(--blue); }
.hero-swoosh{ display: block; margin: 10px 0 4px 2px; }
.hero p.lead{
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 480px;
}
.hero-actions{ display: flex; gap: 14px; margin-top: 30px; }
.hero-visual{
  flex: 0 0 360px;
  height: 320px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--blue-tint-deep);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s ease 0.1s both;
}
.hero-visual img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-visual::after{
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  border-bottom: 5px solid var(--red);
  pointer-events: none;
}
.hero-info-row{
  display: flex; align-items: center; gap: 24px; margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--blue-tint-deep); flex-wrap: wrap;
}
.hero-info-item{ display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.hero-info-item svg{ color: var(--blue); flex-shrink: 0; }

@keyframes fadeUp{
  from{ opacity: 0; transform: translateY(14px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ---------- Section heading ---------- */

.section{ padding: 44px 0; }
.section-head{
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 32px; flex-wrap: wrap;
}
.eyebrow{
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blue);
}
.section-head h2{ font-size: 28px; margin-top: 8px; }

/* ---------- Category filter ---------- */

.category-row{
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 32px;
}
.chip{
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover{ border-color: var(--red); color: var(--red); }
.chip.active{ background: var(--blue); border-color: var(--blue); color: #fff; }

.search-row{
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  max-width: 340px;
  background: #fff;
  transition: border-color 0.15s ease;
}
.search-row:focus-within{ border-color: var(--red); }
.search-row input{
  border: none; outline: none; font-size: 14.5px;
  font-family: inherit; width: 100%; color: var(--ink); background: #fff;
}
.search-row svg{ color: var(--ink-faint); flex-shrink: 0; }

/* ---------- Product grid ---------- */

.product-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 22px;
}
.product-card{
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.product-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue-tint-deep); }
.product-media{
  position: relative;
  height: 168px;
  background: var(--blue-tint);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-media .rx-badge{
  position: absolute; top: 10px; left: 10px;
  background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 800;
  padding: 4px 9px; border-radius: 999px;
  letter-spacing: 0.03em;
}
.product-body{
  padding: 16px 16px 18px 16px;
  display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.product-cat{ font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.product-name{ font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.product-price{ font-size: 16px; font-weight: 800; color: var(--red); margin-top: 4px; }
.product-add{
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 999px;
  background: var(--blue-tint); color: var(--blue-dark);
  font-weight: 700; font-size: 13.5px; cursor: pointer; border: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.product-add:hover{ background: var(--blue); color: #fff; }

.product-overlay{
  position: absolute; inset: 0;
  background: rgba(30, 36, 48, 0.94);
  color: #fff;
  padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.product-card:hover .product-overlay,
.product-card:focus-within .product-overlay,
.product-card.show-details .product-overlay{
  opacity: 1; visibility: visible; transform: translateY(0);
}
.product-overlay h4{ color: #fff; font-size: 15.5px; }
.product-overlay p{ font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.78); margin-top: 8px; }
.product-overlay .overlay-meta{ font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 10px; }
.product-overlay .btn{ margin-top: 14px; }
.product-details-toggle{
  display: none;
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
  z-index: 2;
}
@media (hover: none){
  .product-details-toggle{ display: flex; }
}

.empty-state{
  text-align: center; padding: 60px 20px; color: var(--ink-faint);
  font-size: 15px;
}

/* ---------- Trust strip ---------- */

.trust-strip{
  background: var(--ink);
  padding: 26px 0;
}
.trust-row{
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px;
}
.trust-item{
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.86); font-size: 14px; font-weight: 600;
}
.trust-item svg{ color: var(--red); flex-shrink: 0; }

/* ---------- Cart drawer ---------- */

.overlay-backdrop{
  position: fixed; inset: 0; background: rgba(30,36,48,0.45);
  z-index: 60; opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s;
}
.overlay-backdrop.open{ opacity: 1; visibility: visible; }

.cart-drawer{
  position: fixed; top: 0; right: 0; height: 100%;
  width: 420px; max-width: 92vw;
  background: #fff; z-index: 70;
  box-shadow: -20px 0 40px rgba(30,36,48,0.16);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.cart-drawer.open{ transform: translateX(0); }
.drawer-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 22px 18px 22px; border-bottom: 1px solid var(--line);
}
.drawer-head h3{ font-size: 19px; }
.drawer-close{ background: none; border: none; cursor: pointer; color: var(--ink-soft); }
.drawer-body{ flex: 1; overflow-y: auto; padding: 18px 22px; }
.cart-line{
  display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.cart-line-thumb{
  width: 56px; height: 56px; border-radius: 12px; background: var(--blue-tint);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--blue-dark);
}
.cart-line-info{ flex: 1; min-width: 0; }
.cart-line-name{ font-size: 14.5px; font-weight: 700; color: var(--ink); }
.cart-line-price{ font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.qty-control{
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
}
.qty-control button{
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1;
  transition: border-color 0.15s ease;
}
.qty-control button:hover{ border-color: var(--blue); color: var(--blue); }
.qty-control span{ font-size: 14px; font-weight: 700; min-width: 16px; text-align: center; }
.drawer-foot{
  padding: 20px 22px 26px 22px; border-top: 1px solid var(--line);
}
.summary-row{
  display: flex; justify-content: space-between; font-size: 14.5px; color: var(--ink-soft);
  margin-bottom: 8px;
}
.summary-row.total{
  font-size: 17px; font-weight: 800; color: var(--ink); margin-top: 10px;
}
.cart-empty{ text-align: center; padding: 60px 10px; color: var(--ink-faint); }
.cart-empty svg{ margin-bottom: 14px; color: var(--line); }

/* ---------- Auth modal ---------- */

.modal-backdrop{
  position: fixed; inset: 0; background: rgba(30,36,48,0.5);
  z-index: 80; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s;
  padding: 20px;
}
.modal-backdrop.open{ opacity: 1; visibility: visible; }
.modal-card{
  background: #fff; border-radius: var(--radius-lg);
  width: 420px; max-width: 100%;
  padding: 32px 30px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
}
.modal-close{
  position: absolute; top: 18px; right: 18px;
  background: none; border: none; cursor: pointer; color: var(--ink-faint);
}
.modal-tabs{ display: flex; gap: 6px; background: var(--blue-tint); padding: 5px; border-radius: 999px; margin-bottom: 24px; }
.modal-tab{
  flex: 1; text-align: center; padding: 9px 0; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--ink-soft); cursor: pointer; border: none; background: none;
}
.modal-tab.active{ background: #fff; color: var(--blue-dark); box-shadow: var(--shadow); }
.field{ margin-bottom: 14px; }
.field label{ display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select{
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); font-family: inherit; font-size: 14.5px; color: var(--ink);
  background: #fff; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus{ border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.form-note{ font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; margin-top: 16px; }
.auth-message{
  font-size: 13.5px; padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; display: none;
}
.auth-message.show{ display: block; }
.auth-message.error{ background: var(--red-tint); color: var(--red-dark); }
.auth-message.success{ background: #E7F5EC; color: var(--green); }

/* ---------- Footer ---------- */

.site-footer{ background: var(--ink); color: rgba(255,255,255,0.7); padding: 48px 0 28px 0; }
.footer-grid{ display: flex; gap: 44px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-col{ flex: 1; }
.footer-col.brand-col{ flex: 1.4; }
.footer-col h4{ color: #fff; font-size: 14px; margin-bottom: 16px; }
.footer-col ul{ display: flex; flex-direction: column; gap: 11px; }
.footer-col a{ color: rgba(255,255,255,0.65); font-size: 14px; font-weight: 500; }
.footer-col a:hover{ color: #fff; }
.footer-brand-row{ display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand-row span{ font-family:'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-weight: 800; font-size: 18px; color: #fff; }
.footer-col p.desc{ font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.55); max-width: 260px; }
.footer-contact-line{ display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: rgba(255,255,255,0.65); margin-bottom: 12px; }
.footer-contact-line svg{ color: var(--red); flex-shrink: 0; margin-top: 2px; }
.footer-bottom{ display: flex; justify-content: space-between; padding-top: 22px; font-size: 13px; color: rgba(255,255,255,0.4); flex-wrap: wrap; gap: 10px; }

/* ---------- Generic page hero (About / Contact / Checkout) ---------- */

.page-hero{
  background: var(--blue-tint);
  padding: 40px 0;
  text-align: center;
}
.page-hero .eyebrow{ display: block; margin-bottom: 10px; }
.page-hero h1{ font-size: 40px; }
.page-hero p{ margin-top: 12px; color: var(--ink-soft); font-size: 16px; max-width: 520px; margin-left:auto; margin-right:auto; }

.two-col{ display: flex; gap: 48px; align-items: flex-start; }
.card{
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 26px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.value-card{ text-align: left; }
.value-card:hover{ box-shadow: var(--shadow); transform: translateY(-3px); }
.value-icon{
  width: 48px; height: 48px; border-radius: 12px; background: var(--blue-tint);
  color: var(--blue-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}

.info-line{ display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.info-line svg{ color: var(--blue); flex-shrink: 0; margin-top: 3px; }
.info-line strong{ display:block; font-size: 14.5px; color: var(--ink); }
.info-line span{ font-size: 14px; color: var(--ink-soft); }

.photo-box{
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.photo-box img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-box::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--red);
}

.map-box{
  height: 260px; border-radius: var(--radius-md); background: var(--blue-tint);
  border: 1px dashed var(--blue-tint-deep);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: 13.5px; font-weight: 700; text-align: center; padding: 20px;
}

/* ---------- Checkout ---------- */

.checkout-grid{ display: flex; gap: 36px; align-items: flex-start; }
.checkout-form{ flex: 1.3; }
.checkout-summary{ flex: 1; position: sticky; top: 104px; }
.order-line{ display: flex; justify-content: space-between; font-size: 14.5px; color: var(--ink-soft); padding: 10px 0; border-bottom: 1px solid var(--line); }
.order-line .name{ color: var(--ink); font-weight: 700; }
.payment-option{
  display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.payment-option.selected{ border-color: var(--blue); background: var(--blue-tint); }
.payment-option input{ margin-top: 3px; }
.payment-option strong{ font-size: 14.5px; display:block; }
.payment-option span{ font-size: 13px; color: var(--ink-soft); }

.confirmation-box{
  text-align: center; padding: 60px 20px; max-width: 480px; margin: 0 auto;
}
.confirmation-icon{
  width: 74px; height: 74px; border-radius: 50%; background: #E7F5EC; color: var(--green);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto;
}

/* ---------- Toast ---------- */

.toast{
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 700; z-index: 90; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: all 0.25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.show{ opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast svg{ color: var(--green); flex-shrink: 0; }

/* ---------- Back to top ---------- */

.back-to-top{
  position: fixed; right: 24px; bottom: 26px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--red); color: #fff; box-shadow: var(--shadow-lift);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease, visibility 0.2s;
}
.back-to-top.show{ opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.back-to-top:hover{ background: var(--red-dark); }

/* ---------- Responsive ---------- */

@media (max-width: 980px){
  .product-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  .footer-grid{ flex-wrap: wrap; gap: 32px; }
  .footer-col{ flex: 1 1 40%; }
}

@media (max-width: 860px){
  .main-nav{ display: none; }
  .menu-toggle{ display: flex; }
  .hero-inner{ flex-direction: column; }
  .hero-visual{ width: 100%; flex-basis: auto; }
  .two-col{ flex-direction: column; }
  .checkout-grid{ flex-direction: column; }
  .checkout-summary{ position: static; width: 100%; }
}

@media (max-width: 640px){
  .container{ padding: 0 18px; }
  .hero{ padding: 40px 0 32px 0; }
  .hero h1{ font-size: 34px; }
  .product-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
  .section{ padding: 40px 0; }
  .section-head h2{ font-size: 23px; }
  .footer-col{ flex: 1 1 100%; }
  .cart-drawer{ width: 100%; }
  .account-pill span.pill-label{ display: none; }
  .brand img.logo{ height: 34px; }
}

/* Narrow phones: the header row (logo + sign-in + cart + menu) needs to shrink
   to actually fit — without this it quietly overflows the viewport and pushes
   the menu button off-screen. */
@media (max-width: 430px){
  .header-inner{ gap: 10px; }
  .container{ padding: 0 14px; }
  .brand img.logo{ height: 30px; }
  .header-actions{ gap: 6px; }
  .icon-btn{ width: 36px; height: 36px; }
  .account-pill{ padding: 6px 10px 6px 6px; }
  .account-pill .avatar{ width: 22px; height: 22px; }
}

/* Mobile nav sheet */
.mobile-nav{
  position: fixed; inset: 0; background: #fff; z-index: 95;
  transform: translateX(100%); transition: transform 0.22s ease;
  padding: 24px; display: flex; flex-direction: column; gap: 4px;
}
.mobile-nav.open{ transform: translateX(0); }
.mobile-nav a{
  padding: 16px 4px; font-size: 18px; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.mobile-nav-head{ display:flex; justify-content: flex-end; margin-bottom: 10px; }

/* ---------- Home page extras ---------- */

.feature-strip{ display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 22px; }
.feature-card{
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 26px;
  cursor: default;
  position: relative; overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.feature-card:hover, .feature-card:focus{ box-shadow: var(--shadow-lift); transform: translateY(-6px); border-color: var(--red); }
.feature-icon{
  width: 50px; height: 50px; border-radius: 13px; background: var(--blue-tint); color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.feature-card:hover .feature-icon, .feature-card:focus .feature-icon{ background: var(--red); color: #fff; transform: scale(1.08) rotate(-4deg); }
.feature-arrow{
  position: absolute; top: 22px; right: 22px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--red-tint); color: var(--red-dark);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translate(6px,-6px); transition: opacity 0.2s ease, transform 0.2s ease;
}
.feature-card:hover .feature-arrow, .feature-card:focus .feature-arrow{ opacity: 1; transform: translate(0,0); }
.cta-banner{
  background: var(--blue); border-radius: var(--radius-lg); padding: 44px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.cta-banner::before{
  content: ""; position: absolute; top: -60px; left: -40px; width: 200px; height: 200px;
  border-radius: 50%; background: var(--red); opacity: 0.16;
}
.cta-banner h2{ color: #fff; font-size: 26px; position: relative; }
.cta-banner p{ color: rgba(255,255,255,0.85); font-size: 15px; margin-top: 6px; position: relative; }
.cta-banner .btn{ position: relative; }
.cta-banner .btn:hover{ background: var(--red); color: #fff; }

.popular-badge{
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800;
  padding: 4px 9px; border-radius: 999px; letter-spacing: 0.03em;
}

@media (max-width: 640px){
  .feature-strip{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cta-banner{ padding: 32px 26px; text-align: center; justify-content: center; }
}
