/* =========================================================
   SouqJoy — الاستجابة / الهاتف أولاً في التفاصيل
   ========================================================= */

@media (max-width: 1180px) {
  .main-nav { gap: 15px; }
  .header-main { gap: 12px; }
  .hero-copy { padding-inline: 30px; }
  .app-panel { padding: 27px 26px; }
}

@media (max-width: 1023px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-cta { grid-column: 1 / -1; min-height: 150px; }
  .category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 7px; }
  .category-tile__image { width: 66px; height: 66px; }
  .app-panel { grid-template-columns: 1fr; min-height: 0; gap: 12px; }
  .app-panel__copy { order: 1; max-width: none; padding: 0; }
  .app-panel__media { order: 2; width: min(100%, 520px); margin-inline: auto; }
  .app-panel__copy h2 { font-size: clamp(28px, 4.8vw, 38px); }
  .footer-grid { grid-template-columns: 1.35fr 0.8fr 1fr; }
  .footer-contact { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .footer-contact h2 { grid-column: 1 / -1; }
  .footer-contact .footer-badges { margin-top: 0; }
}

@media (max-width: 979px) {
  .main-nav { display: none; }
  .header-main { grid-template-columns: 1fr auto; }
  .header-actions { justify-self: end; }
  .hero-carousel { height: 440px; }
  .hero-copy { padding: 28px 27px; }
  .hero-title { font-size: clamp(28px, 4.2vw, 38px); }
  .hero-media img { object-position: 54% center; }
  .promo-banner { min-height: 260px; }
  .promo-copy { width: min(50%, 440px); padding: 24px 26px; }
  .how-card { padding: 15px; }
  .faq-layout { grid-template-columns: 1fr; gap: 14px; }
  .faq-intro { position: static; }
  .faq-intro p { max-width: 540px; }
}

@media (max-width: 979px) and (min-width: 768px) {
  .main-nav { display: flex; gap: 11px; font-size: 11px; }
  .header-main { grid-template-columns: auto 1fr auto; }
  .header-actions { justify-self: end; }
  .header-download span { display: inline; }
}

@media (max-width: 767px) {
  :root {
    --pad: 12px;
    --appbar-height: 64px;
  }

  html { scroll-padding-top: 127px; }
  section[id], #categoriesTitle, #browseResults { scroll-margin-top: 117px; }
  #browseResults { scroll-margin-top: 175px; }
  body { font-size: 14px; padding-bottom: calc(var(--appbar-height) + env(safe-area-inset-bottom, 0px) + 14px); }

  .topbar__inner { min-height: 30px; font-size: 10px; }
  .topbar__meta { font-size: 9px; gap: 6px; }
  .topbar__meta span:last-child { display: none; }
  .preview-chip { font-size: 8.5px; padding-inline: 6px; }
  .header-main { min-height: 60px; gap: 7px; }
  .brand { gap: 7px; }
  .brand__mark { width: 37px; height: 37px; border-radius: 9px; }
  .brand__copy strong { font-size: 17px; }
  .brand__copy small { display: none; }
  .header-actions { gap: 4px; }
  .header-gift { min-height: 35px; padding: 4px 8px; font-size: 10px; gap: 4px; }
  .header-gift .icon { width: 15px; height: 15px; }
  .header-download { min-height: 35px; padding-inline: 10px; font-size: 10.5px; }
  .header-download .icon { width: 15px; height: 15px; }
  .header-download__text { display: none; }
  .search-row { padding-bottom: 8px; }
  .search-form { height: 43px; }
  .search-form__input { font-size: 12px; }
  .search-form__submit { min-width: 54px; height: 35px; padding-inline: 9px; font-size: 11px; }
  .search-form__icon { width: 16px; height: 16px; margin-inline: 8px 3px; }
  .search-suggestions { margin-top: 5px; font-size: 9px; }
  .suggestion-chip { padding: 1px 7px; font-size: 9px; }

  .coupon-ribbon__inner { min-height: 52px; gap: 9px; }
  .coupon-ribbon__value strong { font-size: 23px; }
  .coupon-ribbon__value span { font-size: 14px; }
  .coupon-ribbon__copy strong { font-size: 10.5px; }
  .coupon-ribbon__copy span { display: none; }
  .coupon-ribbon__button { min-height: 30px; padding-inline: 9px; font-size: 9.5px; }

  .hero-section { padding-block: 9px 2px; }
  .hero-carousel { height: 550px; border-radius: 11px; }
  .hero-slide { display: flex; flex-direction: column-reverse; }
  .hero-media { flex: 0 0 224px; }
  .hero-media img { object-position: 52% center; }
  .hero-copy { flex: 1; justify-content: center; padding: 16px 15px 13px; }
  .hero-copy::before { inset-block: 18px; width: 2px; }
  .hero-eyebrow { min-height: 23px; font-size: 9.5px; }
  .hero-title { margin-top: 8px; font-size: clamp(25px, 7.1vw, 32px); line-height: 1.28; }
  .hero-subtitle { margin-top: 7px; font-size: 11.5px; line-height: 1.7; }
  .hero-actions { margin-top: 11px; gap: 5px; }
  .hero-actions .button { min-height: 36px; padding: 6px 10px; font-size: 10.5px; }
  .hero-actions .button .icon { width: 15px; height: 15px; }
  .hero-note { display: none; }
  .hero-products { display: none; }
  .hero-controls { inset-inline-end: 13px; top: 11px; bottom: auto; }
  .hero-arrow { width: 29px; height: 29px; }
  .hero-dots { padding: 4px 6px; }
  .hero-dot { width: 5px; height: 5px; }
  .hero-dot[aria-selected="true"] { width: 16px; }

  .coupon-spotlight { padding-block: 7px 1px; }
  .coupon-spotlight__panel { flex-wrap: wrap; gap: 9px 10px; min-height: 0; padding: 12px; border-radius: 10px; }
  .coupon-spotlight__icon { width: 40px; height: 40px; border-radius: 9px; }
  .coupon-spotlight__icon .icon { width: 21px; height: 21px; }
  .coupon-spotlight__copy { flex: 1 1 calc(100% - 56px); }
  .coupon-spotlight__copy h2 { font-size: 17px; }
  .coupon-spotlight__copy p { font-size: 10px; }
  .coupon-spotlight__panel .button { width: 100%; min-height: 38px; font-size: 11.5px; }
  .coupon-spotlight__value strong { font-size: 32px; }
  .coupon-spotlight__value span { font-size: 17px; }

  .section { padding-block: 20px; }
  .categories-section { padding-block: 14px 17px; }
  .section-heading { margin-bottom: 10px; gap: 8px; }
  .section-heading h2, .browse-results__heading h2, .faq-intro h2 { font-size: 21px; }
  .section-heading__hint { display: none; }
  .eyebrow { font-size: 9.5px; }
  .section-link { font-size: 9.5px; }
  .category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px 3px; }
  .category-tile { padding: 3px 1px; gap: 4px; border-radius: 7px; }
  .category-tile__image { width: 54px; height: 54px; border-width: 1.5px; }
  .category-tile__label { font-size: 8.8px; }

  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .section-cta { grid-column: 1 / -1; min-height: 158px; padding: 16px; }
  .product-rail { gap: 8px; padding-inline: 1px; }
  .product-rail .product-card { flex-basis: clamp(150px, 43vw, 192px); }
  .product-card { border-radius: 8px; }
  .product-card__media { aspect-ratio: 1.03; }
  .product-card__body { padding: 7px 7px 8px; }
  .product-card__category { font-size: 8px; }
  .product-card__title { font-size: 11.3px; min-height: 2.72em; }
  .product-card__footer { margin-top: 5px; }
  .product-card__offer { font-size: 9px; }
  .product-card__offer strong { font-size: 12px; }
  .product-card__download { width: 25px; height: 25px; }
  .product-card__download .icon { width: 13px; height: 13px; }
  .product-card__more { min-height: 27px; margin-top: 5px; font-size: 9px; }
  .product-card__badge { top: 6px; inset-inline-start: 6px; min-height: 19px; padding: 1px 6px; font-size: 8px; }
  .product-card__badge .icon { width: 10px; height: 10px; }

  .promo-block { padding-block: 4px; }
  .promo-banner { display: flex; flex-direction: column; min-height: 0; border-radius: 10px; background: #FBF4EB; }
  .promo-banner__media { position: relative; inset: auto; width: 100%; height: 165px; flex: 0 0 auto; }
  .promo-banner__media img { object-position: center; }
  .promo-banner__media::after, .promo-banner--dark .promo-banner__media::after {
    background: linear-gradient(0deg, rgba(251, 244, 235, 0.18), transparent 60%);
  }
  .promo-banner--dark .promo-banner__media::after {
    background: linear-gradient(0deg, rgba(11, 53, 39, 0.22), transparent 60%);
  }
  .promo-copy { width: 100%; padding: 13px 15px 16px; background: #FBF4EB; }
  .promo-banner--dark .promo-copy { background: #0B3527; }
  .promo-copy h2 { font-size: 21px; }
  .promo-copy p { margin-top: 4px; font-size: 10.5px; line-height: 1.7; }
  .promo-copy .button { min-height: 34px; margin-top: 8px; font-size: 10.5px; }

  .app-panel { padding: 20px 16px 15px; border-radius: 11px; gap: 9px; }
  .app-panel__brand { margin-bottom: 12px; }
  .app-panel__brand img { width: 41px; height: 41px; border-radius: 9px; }
  .app-panel__copy h2 { font-size: clamp(25px, 7vw, 32px); }
  .app-panel__lead { margin-top: 7px; font-size: 11.5px; line-height: 1.8; }
  .app-panel__features { gap: 6px; margin-top: 12px; }
  .app-panel__features li { font-size: 10px; }
  .app-panel__coupon { margin-top: 11px; padding: 7px 9px; font-size: 9.5px; }
  .app-panel__actions { margin-top: 12px; gap: 6px; }
  .app-panel__actions .button { flex-basis: 100%; min-height: 40px; font-size: 11.5px; }
  .app-panel__note { font-size: 8.5px; }
  .app-panel__media img { width: min(100%, 480px); border-radius: 9px; }

  .how-section { padding-block: 20px 16px; }
  .how-grid { grid-template-columns: 1fr; gap: 7px; }
  .how-card { min-height: 0; padding: 12px; display: grid; grid-template-columns: 31px 1fr; column-gap: 9px; align-items: start; }
  .how-card__step { grid-row: 1 / span 2; margin: 0; width: 28px; height: 28px; }
  .how-card h3 { font-size: 12px; }
  .how-card p { margin-top: 1px; font-size: 10px; }
  .how-card:not(:last-child)::after { display: none; }

  .trust-section { padding-block: 15px 21px; }
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .trust-card { min-height: 92px; padding: 10px; gap: 7px; }
  .trust-card__icon { width: 30px; height: 30px; border-radius: 7px; }
  .trust-card__icon .icon { width: 16px; height: 16px; }
  .trust-card h3 { font-size: 10px; }
  .trust-card p { font-size: 8.5px; }
  .trust-note { font-size: 8.5px; }

  .faq-section { padding-block: 19px 24px; }
  .faq-layout { gap: 9px; }
  .faq-intro p { margin-top: 5px; font-size: 10.5px; }
  .faq-intro .text-link { margin-top: 8px; font-size: 10.5px; }
  .faq-item summary { padding: 12px 0; font-size: 11.5px; gap: 8px; }
  .faq-item summary::after { width: 21px; height: 21px; font-size: 14px; }
  .faq-item__answer { padding-bottom: 12px; font-size: 10.5px; line-height: 1.85; }

  .site-footer { padding-top: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px 14px; padding-bottom: 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand > p { margin-top: 8px; font-size: 10px; }
  .footer-demo { margin-top: 8px; }
  .footer-column h2 { font-size: 10.5px; }
  .footer-column a, .footer-link-button, .footer-column p { font-size: 9.5px; }
  .footer-contact { grid-column: 1 / -1; display: block; padding-top: 14px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 3px; padding-block: 10px 15px; font-size: 8.5px; }

  .app-bar { padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px)); }
  .app-bar__inner { min-height: 50px; gap: 7px; }
  .app-bar__icon { width: 40px; height: 40px; border-radius: 9px; }
  .app-bar__copy strong { font-size: 11.5px; }
  .app-bar__copy span { font-size: 8.5px; }
  .app-bar__button { min-height: 36px; padding-inline: 10px; font-size: 10.5px; }
  .app-bar__button .icon { width: 14px; height: 14px; }
  .back-to-top { width: 34px; height: 34px; bottom: calc(var(--appbar-height) + env(safe-area-inset-bottom, 0px) + 12px); inset-inline-end: 10px; }

  .browse-results { padding-block: 12px 24px; }
  .browse-results__top { margin-bottom: 10px; }
  .browse-results__heading { flex-direction: column; align-items: flex-start; gap: 6px; }
  .browse-results__summary { font-size: 9.5px; }
  .filter-chip { min-height: 26px; padding-inline: 9px; font-size: 9px; }

  .layer { padding: 6px; }
  .gift-layer { align-items: center; }
  .gift-panel { width: min(450px, 100%); max-height: calc(100dvh - 12px); padding: 11px 11px 15px; border-radius: 15px; }
  .gift-panel h2 { font-size: 22px; }
  .gift-intro > p:not(.gift-hint) { font-size: 10px; }
  .gift-stage { width: min(80%, 270px); }
  .gift-open-button { min-height: 42px; font-size: 12.5px; }
  .gift-result h2 { font-size: 21px; }
  .gift-result__lead { font-size: 9.5px; }
  .coupon-ticket { grid-template-columns: 39px 1fr 64px; margin-block: 10px 8px; }
  .coupon-ticket__value { font-size: 43px; }
  .coupon-ticket__value small { font-size: 19px; }
  .coupon-ticket__notch { inset-inline-start: calc(39px + (100% - 39px - 64px) * 0.5); }
  .coupon-ticket__body p { font-size: 8px; }
  .coupon-ticket__stub { font-size: 6.5px; }
  .gift-result .button { min-height: 40px; font-size: 11.5px; }
  .gift-result__note { font-size: 8px; }
  .gift-result__terms { font-size: 7.5px; }

  #productLayer { align-items: flex-end; padding: 0; }
  .product-panel { width: 100%; max-height: calc(100dvh - 12px); padding: 12px 12px calc(15px + env(safe-area-inset-bottom, 0px)); border-radius: 15px 15px 0 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .product-panel > .layer-close { top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; background: rgba(255, 255, 255, 0.94); }
  .product-detail { grid-template-columns: 1fr; gap: 10px; }
  .product-detail__media { max-height: 28dvh; min-height: 160px; aspect-ratio: 1.35 / 1; border-radius: 8px; }
  .product-detail__copy { padding-top: 0; }
  .product-detail__copy h2 { font-size: 19px; padding-inline-end: 30px; }
  .product-detail__desc { margin-top: 5px; font-size: 10.5px; line-height: 1.8; }
  .product-detail__features { margin-top: 8px; padding-top: 7px; gap: 4px; }
  .product-detail__features li { font-size: 9.5px; }
  .product-detail__coupon { margin-top: 9px; padding: 8px 9px; }
  .product-detail__coupon-label strong { font-size: 19px; }
  .product-detail__actions { margin-top: 9px; }
  .product-detail__actions .button { min-height: 38px; font-size: 10.5px; }
  .product-detail__note { margin-top: 7px; font-size: 8px; }

  .toast-region { bottom: calc(var(--appbar-height) + env(safe-area-inset-bottom, 0px) + 11px); }
  body.modal-open .toast-region { top: 8px; bottom: auto; }
  .toast { max-width: calc(100vw - 28px); padding: 7px 12px; font-size: 9.5px; }
}

@media (max-width: 430px) {
  :root { --pad: 10px; }
  .topbar__welcome { font-size: 9.5px; }
  .topbar__meta { font-size: 8.5px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__copy strong { font-size: 16px; }
  .header-gift { padding-inline: 7px; font-size: 9.5px; }
  .header-gift .icon { width: 14px; height: 14px; }
  .header-download { padding-inline: 9px; }
  .search-suggestions { display: none; }
  .search-form__input { font-size: 11.5px; }
  .hero-media { flex-basis: 205px; }
  .hero-carousel { height: 535px; }
  .hero-title { font-size: clamp(23px, 7.3vw, 29px); }
  .category-tile__image { width: 50px; height: 50px; }
  .category-tile__label { font-size: 8.3px; }
  .product-grid { gap: 6px; }
  .product-card__title { font-size: 10.8px; }
  .product-card__body { padding-inline: 6px; }
  .app-panel__media img { width: 100%; }
  .coupon-ticket { grid-template-columns: 34px 1fr 57px; }
  .coupon-ticket__side strong { display: none; }
  .coupon-ticket__value { font-size: 38px; }
  .coupon-ticket__body p { max-width: 130px; line-height: 1.5; }
  .coupon-ticket__stub .icon { width: 15px; height: 15px; }
  .coupon-ticket__notch { inset-inline-start: calc(34px + (100% - 34px - 57px) * 0.5); }
  .app-bar__copy strong { font-size: 11px; }
  .app-bar__button { font-size: 10px; }
}

@media (max-width: 360px) {
  :root { --pad: 8px; --appbar-height: 61px; }
  .topbar__meta { display: none; }
  .brand { gap: 5px; }
  .brand__mark { width: 32px; height: 32px; border-radius: 8px; }
  .brand__copy strong { font-size: 15px; }
  .header-gift .header-gift__locked { display: none; }
  .header-gift { width: 34px; padding-inline: 0; justify-content: center; }
  .header-gift__unlocked { font-size: 8px; text-align: center; line-height: 1.15; }
  .header-download { width: 34px; padding-inline: 0; justify-content: center; }
  .header-download .icon { width: 16px; height: 16px; }
  .search-form__submit { min-width: 49px; font-size: 10px; }
  .search-form__input { font-size: 11px; }
  .hero-carousel { height: 520px; }
  .hero-media { flex-basis: 192px; }
  .hero-copy { padding: 13px 12px 11px; }
  .hero-title { font-size: 22px; }
  .hero-subtitle { font-size: 10.5px; }
  .hero-actions .button { font-size: 9.8px; padding-inline: 8px; }
  .coupon-spotlight__copy h2 { font-size: 16px; }
  .coupon-ribbon__button { display: none; }
  .coupon-ribbon__inner { gap: 6px; }
  .category-tile__image { width: 47px; height: 47px; }
  .category-tile__label { font-size: 7.8px; }
  .product-card__title { font-size: 10.2px; }
  .product-card__offer strong { font-size: 11px; }
  .product-card__more { font-size: 8.5px; }
  .product-rail .product-card { flex-basis: 46vw; }
  .app-bar__icon { width: 37px; height: 37px; }
  .app-bar__button { padding-inline: 8px; font-size: 9.5px; }
  .app-bar__button .icon { display: none; }
  .gift-panel { padding-inline: 9px; }
  .gift-stage { width: min(75%, 235px); }
  .coupon-ticket { grid-template-columns: 30px 1fr 50px; }
  .coupon-ticket__value { font-size: 34px; }
  .coupon-ticket__notch { inset-inline-start: calc(30px + (100% - 30px - 50px) * 0.5); }
}

@media (hover: none) {
  .product-card:hover { transform: none; box-shadow: 0 1px 4px rgba(20, 32, 25, 0.03); }
  .product-card:hover .product-card__media img { transform: none; }
}

@media print {
  .site-header, .app-bar, .back-to-top, .layer, .toast-region, .hero-controls, .search-row { display: none !important; }
  body { padding-bottom: 0; background: #fff; }
  .hero-slide { position: relative; display: none; }
  .hero-slide.is-active { display: grid; }
}
