/* =========================================
   AtlasStride — Product page (pd-*) & Home sections (hm-*)
   Builds on the variables defined in app.css
   ========================================= */

/* ── Product page ── */
.pd-section { padding: 40px 0 80px; background: var(--bg); }
.pd-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.88rem; color: var(--text-light); margin-bottom: 28px; }
.pd-breadcrumb a { color: var(--text-light); text-decoration: none; }
.pd-breadcrumb a:hover { color: var(--primary); }
.pd-breadcrumb span { color: var(--light-sand); }
.pd-breadcrumb strong { color: var(--text); font-weight: 500; }

.pd-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.pd-gallery { position: sticky; top: 96px; }
.pd-main-img { position: relative; background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 1 / 1; }
.pd-main-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-badge { position: absolute; top: 16px; inset-inline-start: 16px; padding: 6px 12px; border-radius: 50px; font-weight: 700; font-size: 0.85rem; }
.pd-badge-sale { background: var(--red); color: #fff; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.pd-thumb { flex: 0 0 76px; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg-2); transition: var(--transition); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb:hover { border-color: var(--light-sand); }
.pd-thumb.active { border-color: var(--primary); }
.pd-video-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--primary); font-weight: 600; text-decoration: none; }

.pd-category { color: var(--primary); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.pd-title { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 700; color: var(--text); margin: 8px 0 10px; line-height: 1.2; }
.pd-rating { display: inline-flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 0.9rem; text-decoration: none; margin-bottom: 10px; }
.pd-stars { --rating: 5; position: relative; display: inline-block; color: var(--light-sand); letter-spacing: 2px; }
.pd-stars::before { content: "\2605\2605\2605\2605\2605"; position: absolute; inset-inline-start: 0; top: 0; width: calc(var(--rating) / 5 * 100%); overflow: hidden; color: #F2A600; white-space: nowrap; }
.pd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 8px 0 14px; }
.pd-price strong { font-size: 1.9rem; color: var(--primary); }
.pd-price del { color: var(--text-light); font-size: 1.1rem; }
.pd-save { background: rgba(239,68,68,0.1); color: var(--red); font-weight: 700; font-size: 0.82rem; padding: 4px 10px; border-radius: 50px; }
.pd-short { color: var(--text-light); line-height: 1.7; margin-bottom: 16px; }
.pd-availability { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92rem; margin-bottom: 18px; }
.pd-availability .dot { width: 10px; height: 10px; border-radius: 50%; }
.pd-availability.is-available { color: #047857; }
.pd-availability.is-available .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(16,185,129,0.18); }
.pd-availability.is-unavailable { color: var(--red); }
.pd-availability.is-unavailable .dot { background: var(--red); }

.pd-trust { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.pd-trust li { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--text); background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius); padding: 10px 12px; }
.pd-trust li span { font-size: 1.1rem; }

.pd-order { background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.pd-order h2 { font-size: 1.25rem; margin-bottom: 18px; color: var(--text); }
.pd-errors { background: rgba(239,68,68,0.08); color: #B91C1C; border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 0.9rem; }
.pd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pd-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; font-weight: 600; color: var(--text); }
.pd-field > span { display: flex; justify-content: space-between; gap: 8px; }
.pd-field input, .pd-field select, .pd-coupon input {
  width: 100%; padding: 12px 14px; border: 1px solid #D1D5DB; border-radius: var(--radius);
  background: var(--bg); font: inherit; font-weight: 400; font-size: 1rem; color: var(--text); outline: none; transition: var(--transition);
}
.pd-field input:focus, .pd-field select:focus, .pd-coupon input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(182,141,64,0.15); }
.pd-inline-link { font-weight: 500; color: var(--primary); font-size: 0.8rem; }
.pd-qty { display: flex; border: 1px solid #D1D5DB; border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.pd-qty button { width: 44px; flex-shrink: 0; border: none; background: var(--bg-3); font-size: 1.2rem; cursor: pointer; color: var(--text); }
.pd-qty button:hover { background: var(--light-sand); }
.pd-qty input { border: none; border-radius: 0; text-align: center; -moz-appearance: textfield; min-width: 0; }
.pd-qty input::-webkit-outer-spin-button, .pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pd-coupon { display: flex; gap: 8px; margin-top: 18px; }
.pd-coupon input { text-transform: uppercase; }
.pd-coupon button { flex-shrink: 0; padding: 0 20px; border: 1px solid var(--primary); background: transparent; color: var(--primary); border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; transition: var(--transition); }
.pd-coupon button:hover { background: var(--primary); color: #fff; }
.pd-coupon-msg { min-height: 1.3em; font-size: 0.85rem; margin-top: 6px; }
.pd-coupon-msg.is-ok { color: #047857; }
.pd-coupon-msg.is-error { color: var(--red); }

.pd-summary { margin: 14px 0 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--bg-3); display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; }
.pd-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.pd-sum-discount { color: #047857; font-weight: 600; }
.pd-free { color: #047857; font-weight: 600; }
.pd-sum-total { border-top: 1px solid var(--light-sand); padding-top: 8px; font-size: 1.05rem; }
.pd-sum-total strong { color: var(--primary); font-size: 1.2rem; }
.pd-submit { width: 100%; height: 54px; font-size: 1.05rem; border-radius: var(--radius); }
.pd-submit:disabled { opacity: 0.6; cursor: wait; }
.pd-whatsapp { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 10px; height: 50px; border-radius: var(--radius); background: #25D366; color: #fff; font-weight: 600; text-decoration: none; transition: var(--transition); }
.pd-whatsapp:hover { background: #1EBE5A; color: #fff; }
.pd-unavailable { background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius-lg); padding: 24px; }
.pd-unavailable p { color: var(--text-light); margin-bottom: 8px; }

.pd-tabs { margin-top: 64px; background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius-lg); overflow: hidden; scroll-margin-top: 90px; }
.pd-tab-list { display: flex; overflow-x: auto; border-bottom: 1px solid var(--light-sand); }
.pd-tab-list button { flex-shrink: 0; padding: 16px 22px; border: none; background: none; font: inherit; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; }
.pd-tab-list button:hover { color: var(--text); }
.pd-tab-list button.active { color: var(--primary); border-bottom-color: var(--primary); }
.pd-tab-panel { padding: 28px; }
.pd-text { color: var(--text-light); line-height: 1.8; }
.pd-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pd-specs > div { padding: 14px 16px; border: 1px solid var(--light-sand); border-radius: var(--radius); }
.pd-specs dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 4px; }
.pd-specs dd { font-weight: 600; color: var(--text); }
.pd-table-wrap { overflow-x: auto; margin-top: 16px; }
.pd-size-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.9rem; text-align: center; }
.pd-size-table th, .pd-size-table td { padding: 10px; border: 1px solid var(--light-sand); }
.pd-size-table th { background: var(--bg-3); }
.pd-size-table td:first-child, .pd-size-table th:first-child { text-align: start; font-weight: 600; white-space: nowrap; }
.pd-note { font-size: 0.8rem; color: var(--text-light); margin-top: 8px; }
.pd-list { padding-inline-start: 20px; color: var(--text-light); line-height: 2; }
.pd-faq { border-bottom: 1px solid var(--light-sand); padding: 14px 0; }
.pd-faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
.pd-faq p { color: var(--text-light); margin-top: 8px; line-height: 1.7; }

.pd-reviews { margin-top: 64px; scroll-margin-top: 90px; }
.pd-reviews h2 { font-size: 1.6rem; margin-bottom: 20px; }
.pd-reviews h2 small { font-size: 0.95rem; color: var(--text-light); font-weight: 500; }
.pd-review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pd-review { background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.pd-review p { color: var(--text); line-height: 1.6; flex: 1; }
.pd-review footer { font-size: 0.85rem; color: var(--text-light); }
.pd-verified { display: block; color: #047857; font-size: 0.78rem; margin-top: 2px; }
.pd-related { margin-top: 72px; }
.pd-related h2 { text-align: center; font-size: 1.8rem; margin-bottom: 32px; }

.pd-sticky { display: none; }

/* ── Home sections ── */
.hm-section { padding: 88px 0; }
.hm-alt { background: var(--bg-2); border-top: 1px solid var(--light-sand); border-bottom: 1px solid var(--light-sand); }
.hm-head { text-align: center; margin-bottom: 48px; }
.hm-head h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 12px; }
.hm-head p { color: var(--text-light); max-width: 560px; margin: 0 auto; }
.hm-head::after { content: ""; display: block; width: 60px; height: 3px; background: var(--primary); margin: 16px auto 0; }

.hm-promo { background: linear-gradient(90deg, var(--primary-dk), var(--primary)); color: #fff; text-align: center; padding: 12px 16px; font-size: 0.95rem; }
.hm-promo strong { display: inline-block; background: rgba(255,255,255,0.18); border: 1px dashed rgba(255,255,255,0.7); padding: 2px 10px; border-radius: 6px; margin: 0 6px; letter-spacing: 1px; }
.hm-promo a { color: #fff; text-decoration: underline; margin-inline-start: 6px; }

.hm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -40px; position: relative; z-index: 2; }
.hm-stat { background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius-lg); padding: 20px; text-align: center; box-shadow: var(--shadow-md); }
.hm-stat strong { display: block; font-size: 1.5rem; color: var(--primary); }
.hm-stat span { font-size: 0.88rem; color: var(--text-light); }

.hm-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.hm-cat { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 10; text-decoration: none; background: var(--bg-3); }
.hm-cat img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hm-cat:hover img { transform: scale(1.05); }
.hm-cat-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; background: linear-gradient(to top, rgba(26,26,26,0.75), rgba(26,26,26,0) 60%); color: #fff; }
.hm-cat-overlay h3 { font-size: 1.6rem; margin-bottom: 4px; color: #fff; }
.hm-cat-overlay span { font-size: 0.95rem; opacity: 0.9; }

.hm-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.hm-step { position: relative; background: var(--bg); border: 1px solid var(--light-sand); border-radius: var(--radius-lg); padding: 32px 24px 24px; text-align: center; }
.hm-step::before { counter-increment: step; content: counter(step); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: grid; place-items: center; }
.hm-step-icon { font-size: 2rem; margin-bottom: 10px; }
.hm-step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.hm-step p { color: var(--text-light); font-size: 0.92rem; }

.hm-reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.hm-faq { max-width: 760px; margin: 0 auto; }
.hm-faq .pd-faq { background: var(--bg-2); border: 1px solid var(--light-sand); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px; }

.hm-cta { background: var(--charcoal); color: #fff; border-radius: var(--radius-lg); padding: 48px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hm-cta h2 { color: #fff; font-size: 1.7rem; margin-bottom: 6px; }
.hm-cta p { opacity: 0.8; }
.hm-cta .pd-whatsapp { width: auto; padding: 0 28px; margin: 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .pd-grid { grid-template-columns: 1fr; gap: 28px; }
  .pd-gallery { position: static; }
  .pd-sticky {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 90; background: var(--bg-2);
    border-top: 1px solid var(--light-sand); box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); transition: transform 0.25s ease;
  }
  .pd-sticky.is-hidden { transform: translateY(110%); }
  .pd-sticky div { display: flex; flex-direction: column; line-height: 1.2; }
  .pd-sticky strong { color: var(--primary); font-size: 1.15rem; }
  .pd-sticky span { font-size: 0.78rem; color: #047857; }
  .pd-section { padding-bottom: 110px; }

  .hm-stats { grid-template-columns: 1fr 1fr; margin-top: 24px; }
  .hm-cats, .hm-steps { grid-template-columns: 1fr; }
  .hm-steps { gap: 32px; }
  .hm-section { padding: 64px 0; }
}
@media (max-width: 560px) {
  .pd-fields, .pd-trust { grid-template-columns: 1fr; }
  .pd-order { padding: 18px; }
  .pd-tab-panel { padding: 20px; }
  .hm-cta { padding: 32px 20px; }
  .hm-cta .pd-whatsapp { width: 100%; }
}

/* ── Product card badges ── */
.product-badge-featured.card-badge-out { background: #4B5563; color: #fff; }
.product-badge-featured.card-badge-sale { background: var(--red); color: #fff; }
.card-old-price { display: block; font-size: 0.78rem; color: var(--text-light); font-weight: 400; text-align: end; }

/* [hidden] must win over the flex rows above */
.pd-summary > div[hidden] { display: none; }
.pd-coupon input::placeholder { text-transform: none; }
/* Keep "220.00 MAD" in the right order on Arabic (RTL) pages */
.pd-price strong, .pd-price del, .pd-save, .pd-summary > div > span:last-child, .pd-summary strong,
.pd-sticky strong, .product-price, .card-old-price { direction: ltr; unicode-bidi: isolate; }
.pd-qty { direction: ltr; }

/* Single column on small screens without letting wide content push past the edge */
.pd-info, .pd-gallery { min-width: 0; }
@media (max-width: 900px) {
  .pd-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Site-wide announcement banner (admin → Marketing) ── */
.site-announcement { background: var(--charcoal); color: #fff; text-align: center; font-size: 0.88rem; padding: 9px 16px; }
.site-announcement a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
