/* ==========================================================
   Angy Errands — store styles (shop, product, cart, checkout)
   Builds on the tokens defined in style.css
   ========================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.center { text-align: center; }
.note { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }
.section-cta { margin: 40px 0 0; }

/* ----- Header cart ----- */
.cart-link {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px;
  border-radius: 50%; color: var(--brown); text-decoration: none; transition: background-color .2s;
}
.cart-link:hover { background-color: var(--cream-2); }
.cart-link svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--pink); color: var(--white);
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}
.nav a.cart-link::after { display: none; }
.cart-link-mobile { display: none; }

/* ----- Toast ----- */
.toast {
  position: fixed; top: 92px; left: 50%; transform: translateX(-50%); z-index: 70;
  padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: .92rem;
  background: var(--green); color: var(--cream); box-shadow: var(--shadow-lg);
  animation: toast 4s ease forwards; max-width: calc(100% - 32px); text-align: center;
}
.toast-error { background: #9e2f47; }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  8%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); visibility: hidden; }
}

/* ----- Page hero (inner pages) ----- */
.page-hero {
  padding: 56px 0 40px; text-align: center;
  background:
    radial-gradient(circle at 85% 0%, rgba(223, 127, 148, .14), transparent 45%),
    radial-gradient(circle at 10% 100%, rgba(201, 161, 74, .14), transparent 40%);
}
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.page-hero h1 .script { font-size: 1.15em; }
.page-hero p:last-child { color: var(--muted); max-width: 620px; margin-inline: auto; }
.page-hero-sm { padding: 40px 0 8px; }
.shop-section, .cart-section { padding-top: 32px; }

/* ----- Shop toolbar ----- */
.shop-toolbar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-tabs a {
  padding: 9px 18px; border-radius: 999px; text-decoration: none; font-size: .88rem; font-weight: 500;
  background: var(--white); border: 1px solid var(--cream-2); color: var(--brown);
  transition: background-color .2s, color .2s, border-color .2s;
}
.cat-tabs a span { opacity: .55; font-size: .8em; margin-left: 2px; }
.cat-tabs a:hover { border-color: var(--gold); }
.cat-tabs a.active { background: var(--brown); border-color: var(--brown); color: var(--white); }

.shop-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.shop-filters select, .search-box input {
  font: 400 .9rem var(--font-body); color: var(--ink); border: 1px solid var(--cream-2);
  background: var(--white); border-radius: 999px; padding: 10px 16px;
}
.shop-filters select:focus, .search-box input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 161, 74, .2); }
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 40px; width: 230px; }
.result-note { color: var(--muted); margin: -12px 0 24px; }

/* ----- Product grid & cards ----- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product-card {
  display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-media { position: relative; display: block; aspect-ratio: 1; background: #f7f1ea; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .product-media img { transform: scale(1.05); }
.is-soldout .product-media img { filter: grayscale(.7); opacity: .7; }
.product-flag {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.flag-offer { background: var(--pink); color: var(--white); }
.flag-soldout { background: var(--brown); color: var(--white); }

.product-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.product-cat { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; }
.product-name { font-size: 1rem; font-weight: 600; line-height: 1.35; margin: 0 0 8px; }
.product-name a { text-decoration: none; }
.product-name a:hover { color: var(--brown-2); text-decoration: underline; text-underline-offset: 3px; }
.product-price { font-weight: 700; color: var(--brown); margin: 0 0 14px; flex: 1; }
.product-price s, .product-detail-price s { font-weight: 400; color: var(--muted); font-size: .85em; margin-left: 6px; }
.price-request { font-weight: 600; color: var(--muted); font-size: .9rem; }

.product-actions { display: flex; gap: 8px; align-items: center; }
.product-actions form { flex: 1; }
.product-actions .btn { width: 100%; }
.product-actions .btn-primary::after { display: none; }
.btn-disabled { flex: 1; background: var(--cream-2); color: var(--muted); cursor: not-allowed; }
.btn-disabled:hover { transform: none; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  border: 1.5px solid rgba(74, 34, 22, .2); color: #1ea952; transition: background-color .2s, color .2s, border-color .2s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: #25d366; border-color: #25d366; color: var(--white); }

/* ----- Empty state, pagination, sourcing banner ----- */
.empty-state { text-align: center; padding: 48px 16px; }
.empty-state p { color: var(--muted); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a {
  display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 50%;
  text-decoration: none; font-weight: 600; background: var(--white); border: 1px solid var(--cream-2);
}
.pagination a[aria-current] { background: var(--brown); color: var(--white); border-color: var(--brown); }
.source-banner {
  margin-top: 56px; padding: 32px 36px; border-radius: 24px; display: flex; gap: 24px;
  align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--green), var(--green-2)); color: var(--cream);
  border: 2px solid var(--gold);
}
.source-banner h3 { color: var(--white); margin-bottom: .25em; }
.source-banner p { margin: 0; opacity: .85; }
.source-banner .btn-primary { background-color: var(--gold); color: var(--brown); }
.source-banner .btn-primary::after { color: var(--brown); }
.source-banner .btn-primary:hover { background-color: var(--white); }

/* ----- Product detail ----- */
.product-detail-section { padding-top: 32px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 24px; }
.breadcrumbs a { text-decoration: none; color: var(--brown-2); }
.breadcrumbs a:hover { text-decoration: underline; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.product-detail-media {
  border-radius: 24px; overflow: hidden; background: var(--white); box-shadow: var(--shadow);
  aspect-ratio: 1; position: sticky; top: 100px;
}
.product-detail-media img { width: 100%; height: 100%; object-fit: contain; }
.product-detail-info h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.product-detail-price { font-size: 1.6rem; font-weight: 700; color: var(--brown); margin-bottom: 8px; }
.stock { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; margin-bottom: 20px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.stock.in { color: var(--green-2); }
.stock.in::before { background: #2fae6b; }
.stock.out { color: #9e2f47; }
.stock.out::before { background: #9e2f47; }
.product-description { color: var(--ink); margin: 24px 0 28px; line-height: 1.75; }
.add-form { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.add-form .btn { flex: 1; min-width: 180px; }
.product-detail-info > .btn-outline { width: 100%; }

.qty {
  display: inline-flex; align-items: center; border: 1.5px solid var(--cream-2); border-radius: 999px;
  background: var(--white); overflow: hidden;
}
.qty button {
  width: 42px; height: 48px; border: 0; background: none; cursor: pointer; font-size: 1.2rem; color: var(--brown);
}
.qty button:hover { background: var(--cream); }
.qty input {
  width: 44px; border: 0; text-align: center; font: 600 1rem var(--font-body); color: var(--ink);
  -moz-appearance: textfield; appearance: textfield; background: transparent;
}
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-sm button { width: 34px; height: 38px; }
.qty-sm input { width: 36px; font-size: .92rem; }

.product-perks { list-style: none; padding: 20px 0 0; margin: 24px 0 0; border-top: 1px solid var(--cream-2); }
.product-perks li { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.product-perks svg { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; }
.related { margin-top: 80px; }
.related h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 28px; }

/* ----- Cart ----- */
.cart-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.cart-items { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 24px; }
.cart-line {
  display: grid; grid-template-columns: 72px 1fr auto auto 32px; gap: 16px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--cream-2);
}
.cart-thumb { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: #f7f1ea; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { display: flex; flex-direction: column; min-width: 0; }
.cart-name { font-weight: 600; text-decoration: none; }
.cart-name:hover { text-decoration: underline; }
.cart-unit { font-size: .85rem; color: var(--muted); }
.cart-subtotal { font-weight: 700; color: var(--brown); min-width: 96px; text-align: right; }
.cart-remove {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--muted);
}
.cart-remove:hover { background: var(--pink-soft); color: #9e2f47; }
.cart-actions { display: flex; justify-content: space-between; align-items: center; padding: 18px 0 14px; }
.cart-actions a { color: var(--brown-2); font-weight: 500; text-decoration: none; }

.checkout-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
  position: sticky; top: 100px; border-top: 4px solid var(--gold);
}
.checkout-card h2 { font-size: 1.4rem; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0 0 8px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; color: var(--brown); text-align: right; }
.checkout-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--cream-2); }

/* ----- Order success ----- */
.success-card {
  text-align: center; background: var(--white); border-radius: 24px; padding: 48px 32px;
  box-shadow: var(--shadow); border-top: 4px solid var(--gold);
}
.success-icon {
  width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center;
  background: #e3f1ec; color: var(--green-2);
}
.success-icon svg { width: 36px; height: 36px; }
.btn-whatsapp { background: #25d366; color: var(--white); margin-top: 12px; box-shadow: 0 8px 20px rgba(37, 211, 102, .35); }
.btn-whatsapp:hover { background: #1ea952; }

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .cart-link-mobile { display: inline-grid; margin-left: auto; margin-right: 4px; order: 1; }
  .nav-toggle { order: 2; }
  .cart-link-desktop { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .product-detail, .cart-grid { grid-template-columns: 1fr; }
  .product-detail-media, .checkout-card { position: static; }
  .shop-filters, .search-box, .search-box input { width: 100%; }
  .shop-filters label { flex: 1; }
  .shop-filters select { width: 100%; }
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .cat-tabs a { white-space: nowrap; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .product-body { padding: 12px 12px 14px; }
  .product-name { font-size: .9rem; }
  .product-actions .btn { padding: 9px 10px; font-size: .8rem; }
  .icon-btn { width: 36px; height: 36px; }
  .cart-items { padding: 4px 16px; }
  .cart-line { grid-template-columns: 60px 1fr auto; grid-template-areas: "thumb info remove" "thumb qty total"; gap: 8px 12px; }
  .cart-thumb { grid-area: thumb; width: 60px; height: 60px; }
  .cart-info { grid-area: info; }
  .cart-line .qty { grid-area: qty; justify-self: start; }
  .cart-subtotal { grid-area: total; min-width: 0; }
  .cart-remove { grid-area: remove; }
  .source-banner { padding: 24px; }
}

/* ----- Product options (sizes & colours) ----- */
.product-options-note { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); margin-top: 2px; }
.btn-choose::after { display: none; }
.buy-form { margin-bottom: 12px; }
.option-group { border: 0; padding: 0; margin: 0 0 20px; }
.option-group legend { font-weight: 600; color: var(--brown); margin-bottom: 10px; padding: 0; }
.option-chosen { font-weight: 400; color: var(--muted); }
.option-list { display: flex; flex-wrap: wrap; gap: 10px; }
.option-pill { position: relative; cursor: pointer; }
.option-pill input { position: absolute; opacity: 0; pointer-events: none; }
.option-pill > span {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; min-width: 120px;
  border: 1.5px solid var(--cream-2); border-radius: 14px; background: var(--white);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.option-pill strong { font-size: .9rem; font-weight: 600; color: var(--ink); }
.option-pill small { font-size: .85rem; font-weight: 600; color: var(--brown-2); }
.option-pill:hover > span { border-color: var(--gold); }
.option-pill input:checked + span { border-color: var(--brown); box-shadow: 0 0 0 1px var(--brown); background: #fffaf3; }
.option-pill input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.option-pill.is-out { cursor: not-allowed; }
.option-pill.is-out > span { opacity: .5; text-decoration: line-through; }
.option-colour > span { flex-direction: row; align-items: center; gap: 8px; min-width: 0; padding: 8px 14px 8px 10px; border-radius: 999px; font-size: .9rem; font-weight: 500; }
.swatch { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); flex-shrink: 0; }
.cart-choice { font-size: .82rem; font-weight: 500; color: var(--brown-2); }
.option-colour small { font-size: .8rem; font-weight: 600; color: var(--brown-2); margin-left: 2px; }
