/* Oskar Store — shared storefront styles (header, cards, footer, product, cart). Home sections: home.css */
.boot { display: grid; place-items: center; min-height: 40vh; }
.btn-lg { min-height: 54px; padding-inline: 1.6rem; font-size: 1.02rem; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; }

/* ---------- Moving announcement ---------- */
.marquee { overflow: hidden; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 500; }
.marquee-track { display: flex; width: max-content; animation: marquee 42s linear infinite; }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem 1.5rem; white-space: nowrap; }
.marquee-item .icon { opacity: .55; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* ---------- Header: only the bar with logo, language and cart stays pinned ---------- */
.site-header { display: contents; }
.header-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  height: 66px; padding: 0 16px;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: block; }
.brand img { height: 48px; width: auto; }
.header-nav { display: none; gap: 1.6rem; font-size: .92rem; font-weight: 500; }
.header-nav a { position: relative; color: var(--navy); text-decoration: none; padding: .3rem 0; }
.header-nav a::after {
  content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--navy);
  transform: scaleX(0); transform-origin: center; transition: transform .3s var(--ease);
}
.header-nav a:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: .35rem; margin-inline-start: auto; }
.lang-btn {
  height: 38px; padding: 0 .95rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy); font-size: .85rem; font-weight: 600;
  transition: border-color .2s, background .2s;
}
.lang-btn:hover { border-color: var(--navy); }
.header-cart {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 999px; color: var(--navy); text-decoration: none;
}
.header-cart:hover { background: var(--navy-soft); }
.cart-badge {
  position: absolute; top: 3px; inset-inline-end: 1px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; line-height: 1;
  border: 2px solid #fff;
}
.cart-badge[hidden] { display: none; }
.header-cart.bump { animation: bump .45s var(--ease); }
@keyframes bump { 30% { transform: scale(1.18); } 60% { transform: scale(.95); } }

/* ---------- Product grid and cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
.grid > .empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: .5rem; }
.card-product { display: grid; gap: .65rem; align-content: start; text-decoration: none; color: inherit; }
.card-media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 14px;
  background: var(--mist);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .45s var(--ease); }
.card-img-alt { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) {
  .card-product:hover .card-media img { transform: scale(1.04); }
  .card-product:hover .card-img-alt { opacity: 1; }
}
.card-placeholder { display: grid; place-items: center; height: 100%; color: #A9B2BD; }
.card-badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; flex-wrap: wrap; gap: .3rem; z-index: 1; }
.card-badges.static { position: static; }
.card-badges:empty { display: none; }
.card-body { display: grid; gap: .2rem; padding-inline: 2px; }
.card-title {
  margin: 0; font-family: var(--font); font-size: .95rem; font-weight: 500; line-height: 1.45; color: var(--navy-deep);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price { margin: 0; display: flex; align-items: baseline; gap: .45rem; font-size: 1.02rem; }
.card-product.is-out .card-media img { filter: grayscale(.85); opacity: .6; }
.card-product.is-out .price-now { color: var(--muted); }

.is-skeleton .card-media,
.card-product.is-skeleton .card-body span,
.cat-tile.is-skeleton {
  background: linear-gradient(90deg, #E9ECF0 25%, #F3F5F7 50%, #E9ECF0 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
.card-product.is-skeleton .card-body span { display: block; height: 12px; border-radius: 6px; }
.card-product.is-skeleton .card-body span + span { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Scroll reveal (motion.js) ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Floating cart bar + WhatsApp button ---------- */
.cart-bar {
  position: fixed; inset-inline: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 35;
  display: flex; align-items: center; gap: .6rem; max-width: 520px; margin: 0 auto;
  padding: .85rem 1.1rem; border-radius: 999px;
  background: var(--navy); color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 10px 30px rgba(11, 26, 40, .28);
  animation: rise .35s var(--ease);
}
.cart-bar[hidden] { display: none; }
.cart-bar-count { margin-inline-start: auto; padding: .1rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .85rem; }
body.has-cart-bar .site-footer { padding-bottom: 96px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

.wa-fab {
  position: fixed; z-index: 34; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: .5rem; height: 56px; min-width: 56px; padding: 0 14px;
  border-radius: 999px; background: var(--wa); color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 10px 24px rgba(29, 168, 81, .35); transition: bottom .3s var(--ease);
}
.wa-fab::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--wa); z-index: -1;
  animation: wa-pulse 2.8s var(--ease) infinite;
}
.wa-fab-label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .4s var(--ease); }
@media (hover: hover) { .wa-fab:hover .wa-fab-label { max-width: 220px; } }
body.has-cart-bar .wa-fab { bottom: calc(86px + env(safe-area-inset-bottom)); }
@keyframes wa-pulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(1.45); opacity: 0; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #D7DDE4; margin-top: 48px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 40px 20px 28px; display: grid; gap: 1.5rem; }
.footer-logo { height: 60px; width: auto; filter: brightness(0) invert(1); }
.footer-brand p { margin: .5rem 0 0; font-size: .9rem; }
.footer-tagline { letter-spacing: .3em; font-size: .7rem !important; color: #8A97A6; }
.footer-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; font-size: .9rem; }
.footer-facts li { display: flex; gap: .6rem; align-items: flex-start; }
.footer-facts .icon { color: #fff; margin-top: 2px; }
.footer-actions { display: flex; flex-wrap: wrap; align-content: start; gap: .6rem; }
.footer-fb { color: #fff; }
.footer-fb:hover { background: rgba(255, 255, 255, .08) !important; }
.footer-copy { margin: 0; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .78rem; color: #8A97A6; }

/* ---------- Related products (product page) ---------- */
.related { max-width: 1180px; margin: 56px auto 0; padding: 0 16px; }
.related h2 { margin: 0 0 1rem; font-size: clamp(1.35rem, 3vw, 1.8rem); color: var(--navy); }

/* ---------- Product page ---------- */
.product-page { max-width: 1180px; margin: 0 auto; padding: 12px 16px 48px; }
.crumbs { display: flex; align-items: center; gap: .35rem; margin-bottom: .8rem; font-size: .82rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.product-layout { display: grid; gap: 1.4rem; }
.gallery { display: grid; gap: .6rem; margin-inline: -16px; min-width: 0; }
.gallery-stage { position: relative; }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  aspect-ratio: 4 / 5; background: var(--white);
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline-offset: -3px; }
/* contain = the whole garment is always visible, never cropped */
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.gallery-empty { display: grid; place-items: center; aspect-ratio: 4 / 5; background: var(--navy-soft); color: #A9B2BD; }

.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--navy-deep);
  box-shadow: 0 2px 10px rgba(11, 26, 40, .18); transition: opacity .2s, transform .2s var(--ease);
}
.gallery-nav:hover { transform: translateY(-50%) scale(1.06); }
.gallery-nav:disabled { opacity: 0; pointer-events: none; }
.gallery-prev { inset-inline-start: 10px; }
.gallery-next { inset-inline-end: 10px; }
.gallery-count {
  position: absolute; bottom: 10px; inset-inline-start: 10px; direction: ltr;
  padding: .1rem .65rem; border-radius: 999px; background: rgba(11, 26, 40, .72); color: #fff;
  font-size: .78rem; font-weight: 600;
}

.gallery-thumbs { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: 2px 16px; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
  flex: none; width: 60px; height: 75px; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: 10px; background: var(--white); opacity: .65;
  transition: opacity .2s, border-color .2s;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.is-active { border-color: var(--navy); opacity: 1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-info { display: grid; gap: .9rem; align-content: start; }
.product-title { margin: 0; font-size: 1.45rem; line-height: 1.35; color: var(--navy-deep); }
.product-price { margin: -.3rem 0 0; display: flex; align-items: baseline; gap: .6rem; font-size: 1.5rem; }
.product-price .price-old { font-size: 1rem; }
.product-desc { margin: 0; color: #3E4C5B; white-space: pre-line; }
.pick { display: grid; gap: .5rem; }
.pick-label { margin: 0; font-weight: 600; font-size: .9rem; color: var(--navy); }
.pick-value { font-weight: 400; color: var(--muted); }
.size-chip { min-width: 52px; justify-content: center; }
.swatch-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch-btn {
  width: 40px; height: 40px; padding: 3px; border-radius: 50%;
  border: 2px solid transparent; background: none; transition: border-color .2s;
}
.swatch-btn span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.swatch-btn[aria-pressed="true"] { border-color: var(--navy); }
.swatch-btn:disabled { opacity: .4; cursor: not-allowed; }

.qty {
  display: inline-flex; align-items: center; justify-self: start;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
}
.qty-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--navy); border-radius: 999px; }
.qty-btn:disabled { opacity: .3; }
.qty-value { min-width: 2rem; text-align: center; font-weight: 600; }
.qty-sm .qty-btn { width: 36px; height: 36px; }

.trust { list-style: none; margin: .4rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .65rem; font-size: .88rem; color: #3E4C5B; }
.trust li { display: flex; gap: .6rem; align-items: center; }
.trust .icon { color: var(--navy); }

/* ---------- Cart ---------- */
.cart-page { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
.page-title { margin: 0 0 1rem; font-size: 1.5rem; color: var(--navy); }
.cart-empty { display: grid; justify-items: center; gap: .4rem; }
.cart-empty h2 { margin: .4rem 0 0; color: var(--navy); }
.cart-empty p { margin: 0 0 .8rem; }
.cart-layout { display: grid; gap: 1rem; align-items: start; }
.cart-lines { display: grid; gap: .7rem; }
.cart-line {
  display: grid; grid-template-columns: 80px 1fr; gap: .8rem; padding: .7rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
}
.cart-line.is-unavailable { border-color: #F4CACA; background: #FFF9F9; }
.cart-line.is-unavailable .cart-thumb { opacity: .5; filter: grayscale(1); }
.cart-thumb { display: grid; place-items: center; width: 80px; height: 100px; border-radius: 12px; overflow: hidden; background: var(--navy-soft); color: #A9B2BD; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-body { display: grid; gap: .1rem; min-width: 0; align-content: start; }
.cart-line-name { font-weight: 600; text-decoration: none; color: var(--navy-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-meta { margin: 0; font-size: .84rem; color: var(--muted); }
.cart-line-warn { margin: .1rem 0; font-size: .84rem; color: var(--red); font-weight: 600; }
.cart-line-foot { display: flex; align-items: center; gap: .6rem; margin-top: .35rem; }
.cart-line-total { margin-inline-start: auto; }
.cart-remove { width: 38px; height: 38px; color: var(--muted); }
.cart-line.is-unavailable .cart-remove { margin-inline-start: auto; color: var(--red); }

.cart-side { display: grid; gap: 1rem; }
.regions { margin: 0; padding: 1rem; border: 1px solid var(--line); }
.regions legend { padding: 0 .3rem; font-weight: 700; color: var(--navy); }
.region-options { display: grid; gap: .5rem; }
.region-option {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s, background .2s;
}
.region-option input { accent-color: var(--navy); width: 18px; height: 18px; margin: 0; }
.region-option.is-selected { border-color: var(--navy); background: var(--navy-soft); }
.region-price { margin-inline-start: auto; font-weight: 600; }

.invoice { padding: 1rem; display: grid; gap: .8rem; }
.invoice h2 { margin: 0; font-size: 1.05rem; color: var(--navy); }
.invoice dl { margin: 0; display: grid; gap: .45rem; }
.invoice dl > div { display: flex; justify-content: space-between; gap: 1rem; }
.invoice dt { color: #3E4C5B; }
.invoice dd { margin: 0; font-weight: 600; }
.invoice-total { padding-top: .6rem; border-top: 1px dashed var(--line); font-size: 1.2rem; }
.invoice-total dt, .invoice-total dd { font-weight: 700; color: var(--navy-deep); }
.invoice-note { margin: 0; padding: .55rem .8rem; border-radius: 10px; background: #FFF6E5; color: #8A5A00; font-size: .85rem; }
.invoice-hint { margin: 0; text-align: center; }

/* ---------- Checkout sheet ---------- */
.sheet {
  width: min(100% - 24px, 480px); max-height: calc(100dvh - 24px); padding: 0;
  border: 0; border-radius: 22px; box-shadow: 0 24px 60px rgba(11, 26, 40, .3);
}
.sheet::backdrop { background: rgba(11, 26, 40, .45); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-in .3s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
.sheet-form, .sent { display: grid; gap: .9rem; padding: 1.1rem 1.1rem 1.3rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; color: var(--navy); }
.sheet-summary { display: flex; justify-content: space-between; padding: .6rem .85rem; border-radius: 12px; background: var(--navy-soft); font-size: .9rem; }
.sheet .form-error:empty { display: none; }
.sent { justify-items: center; text-align: center; padding-top: 1.8rem; }
.sent h2 { margin: 0; color: var(--navy); }
.sent p { margin: 0; color: #3E4C5B; }
.sent-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #E6F8EE; color: var(--wa-deep); }
.sent-id { font-weight: 700; color: var(--navy) !important; }

/* ---------- Larger screens ---------- */
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 18px; }
  .gallery { margin: 0; }
  /* Fit the photo on screen on desktop instead of a tall 4:5 box that runs below the fold. */
  .gallery-track { aspect-ratio: auto; height: min(68vh, 640px); border-radius: var(--radius); border: 1px solid var(--line); }
  .gallery-thumbs { padding: 2px; flex-wrap: wrap; overflow: visible; }
  .gallery-thumb { width: 64px; height: 80px; }
  .product-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.5rem; }
  .product-info { position: sticky; top: 96px; }
  .cart-layout { grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); }
  .cart-side { position: sticky; top: 88px; }
  .footer-inner { grid-template-columns: 1.2fr 1.5fr 1fr; align-items: start; }
  .footer-copy { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .header-bar { padding: 0 28px; }
  .header-nav { display: flex; margin-inline: auto; }
  .header-actions { margin-inline-start: 0; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .wa-fab::before { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
