:root {
  --sf-primary: #0f766e;
  --sf-page-bg: #ffffff;
  --sf-section-heading: #134e4a;
  --sf-card-from: #5eead4;
  --sf-card-to: #0f766e;
  --sf-cta-dark: #115e59;
  --sf-radius: 0px;
  --sf-header-text: #111827;
  --sf-font-family: "Tajawal", "Segoe UI", Tahoma, ui-sans-serif, system-ui, sans-serif;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --ok-50: #f0fdfa;
  --ok-600: #0d9488;
  --ok-700: #0f766e;
}

/* Self-hosted Tajawal (served from Cloudflare Pages) */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/tajawal-400-ar.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/tajawal-400-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/tajawal-700-ar.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/tajawal-700-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sf-page-bg);
  color: #111;
  font-family: var(--sf-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
select {
  font: inherit;
}

.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;
}

.hidden {
  display: none !important;
}

/* Main layout */
.sf-main {
  min-height: 100vh;
  padding-bottom: 6rem;
}

.product-page {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

.product-page--form {
  max-width: 44rem;
}

.checkout-wrap {
  width: 100%;
}

@media (min-width: 640px) {
  .product-page {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .product-page {
    padding-top: 1.5rem;
  }
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.gallery-col {
  min-width: 0;
}

@media (min-width: 1024px) {
  .gallery-col {
    position: sticky;
    top: 6rem;
  }
}

.hero-frame {
  position: relative;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hero-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  cursor: zoom-in;
  user-select: none;
  touch-action: pan-y;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-nav {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  direction: ltr;
  z-index: 5;
  pointer-events: none;
}

.hero-nav button {
  pointer-events: auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--gray-800);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.hero-dots button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  border: 0;
  background: var(--gray-300);
  padding: 0;
  cursor: pointer;
}

.hero-dots button.is-active {
  background: var(--sf-primary);
  width: 1.25rem;
}

.product-brand {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ok-700);
  direction: ltr;
  text-align: start;
}

/* Product form column */
.product-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  direction: ltr;
  text-align: start;
}

@media (min-width: 768px) {
  .product-title {
    font-size: 2.125rem;
  }
}

.product-pricing {
  margin-top: 1rem;
  padding: 1rem 0 0.15rem;
  border-top: 1px solid var(--gray-200);
}

.product-pricing__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.product-pricing__current {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ok-700);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

@media (min-width: 768px) {
  .product-pricing__current {
    font-size: 2.375rem;
  }
}

.product-pricing__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 0.35rem;
  background: var(--ok-700);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  direction: ltr;
  unicode-bidi: isolate;
  line-height: 1;
}

.product-pricing__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-top: 0.55rem;
}

.product-pricing__compare {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-600);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

.product-pricing__save {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ok-700);
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 1.5rem;
}

.card-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card h3 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.field-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-btn {
  min-width: 52px;
  border-radius: 0.5rem;
  border: 2px solid var(--gray-200);
  background: #fff;
  color: var(--gray-900);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.color-btn:hover {
  border-color: var(--gray-300);
}

.color-btn.is-selected {
  border-color: var(--gray-900);
  background: var(--gray-900);
  color: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.shipping-summary {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.shipping-summary[hidden] {
  display: none !important;
}

.shipping-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--gray-600);
}

.shipping-summary__row strong,
.shipping-summary__row span:last-child {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--gray-900);
  font-weight: 600;
}

.shipping-summary__total {
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--gray-200);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
}

.shipping-summary__total strong {
  color: var(--ok-700);
  font-size: 1.15rem;
}

.input-shell {
  display: flex;
  min-height: 46px;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid var(--gray-300);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-shell:focus-within {
  border-color: var(--sf-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sf-primary) 35%, transparent);
}

.input-shell.is-open {
  border-color: var(--sf-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sf-primary) 35%, transparent);
}

.input-shell.is-disabled {
  opacity: 0.6;
}

.input-icon {
  display: flex;
  width: 2.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-inline-end: 1px solid color-mix(in srgb, var(--sf-primary) 35%, #e5e7eb);
  background: var(--sf-primary);
  color: #fff;
}

.input-icon--end {
  border-inline-end: 0;
  border-inline-start: 1px solid color-mix(in srgb, var(--sf-primary) 35%, #e5e7eb);
}

.input-shell input,
.input-shell select {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.75rem 0.75rem;
  color: #111827;
  outline: none;
  box-shadow: none;
  font-weight: 500;
}

.input-shell input::placeholder {
  color: #6b7280;
}

.input-shell select:disabled {
  cursor: not-allowed;
}

.wilaya-wrap {
  position: relative;
}

.wilaya-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  inset-inline: 0;
  max-height: 16rem;
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.2);
  display: none;
}

.wilaya-dropdown.is-open {
  display: block;
}

.wilaya-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 0.875rem;
  text-align: right;
  cursor: pointer;
}

.wilaya-option:hover,
.wilaya-option.is-active {
  background: color-mix(in srgb, var(--sf-primary) 12%, white);
  color: #111827;
}

.wilaya-option.is-selected {
  font-weight: 700;
}

.wilaya-code {
  display: inline-flex;
  min-width: 2.25rem;
  justify-content: center;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--sf-primary) 14%, white);
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  font-family: ui-monospace, monospace;
  color: #111827;
  direction: ltr;
}

.wilaya-option:hover .wilaya-code,
.wilaya-option.is-active .wilaya-code {
  background: color-mix(in srgb, var(--sf-primary) 22%, white);
  color: #111827;
}

.wilaya-empty {
  padding: 1rem 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-400);
}

.delivery-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
}

.delivery-options {
  display: flex;
  gap: 0.75rem;
}

.delivery-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.5rem;
  border: 2px solid var(--gray-200);
  background: #fff;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.delivery-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: color-mix(in srgb, var(--sf-primary) 45%, gray);
}

.delivery-box.is-selected {
  border-color: var(--sf-primary);
  background: color-mix(in srgb, var(--sf-primary) 8%, white);
}

.delivery-icon {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.delivery-box.is-selected .delivery-icon {
  background: var(--sf-primary);
  color: #fff;
}

.delivery-box .label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
}

.delivery-box .fee {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sf-primary);
  white-space: nowrap;
}

.delivery-box .fee.is-free {
  color: var(--ok-600);
}

/* CTA button */
#order-cta {
  display: flex;
  width: 100%;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--sf-primary);
  color: #fff;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s, box-shadow 0.15s;
}

#order-cta:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.05);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--sf-primary) 50%, transparent);
}

#order-cta:active:not(:disabled) {
  transform: translateY(1px);
}

#order-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#order-cta:focus-visible,
.sticky-cta__btn:focus-visible {
  outline: 2px solid var(--sf-primary);
  outline-offset: 2px;
}

/* Gallery full */
.gallery-full {
  margin-top: 3rem;
  content-visibility: auto;
  contain-intrinsic-size: 1px 4000px;
}

.gallery-full h2 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.gallery-full__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gallery-full__item {
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: #fff;
  box-shadow: none;
}

.gallery-full__item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Sticky CTA */
.sticky-cta {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px -12px rgba(0, 0, 0, 0.35);
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

.sticky-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-cta__inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sticky-cta__price {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  flex-shrink: 0;
}

.sticky-cta__price small {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.sticky-cta__price strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
}

.sticky-cta__btn {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 0.75rem;
  background: var(--sf-primary);
  color: #fff;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.sticky-cta__btn:hover {
  filter: brightness(0.95);
}

.sticky-cta__btn:active {
  transform: translateY(1px);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-height: 90vh;
  max-width: 90vw;
  object-fit: contain;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.5rem;
  cursor: pointer;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
}

.lightbox__nav--prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* Success toast */
.toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 10000;
  background: #fff;
  color: var(--gray-900);
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.3);
  font-weight: 600;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  max-width: min(92vw, 28rem);
  text-align: center;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.sf-money {
  white-space: nowrap;
}
