/* =========================================================
   MEMOKART — responsive.css
   Mobile-first base lives in style.css (360–430px)
   This file progressively enhances for larger screens.
   ========================================================= */

/* ---------- Mobile only: one review image per slide ---------- */
@media (max-width: 767px) {
  .site-footer {
    padding-bottom: calc(80px + var(--safe-bottom));
  }

  .header-inner {
    width: 100%;
    max-width: none;
    min-height: 48px;
    padding: 7px 10px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
  }
  .mobile-header-actions {
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-self: start;
    gap: 2px;
  }
  .mobile-header-action {
    width: clamp(23px, 8vw, 31px);
    height: clamp(23px, 8vw, 31px);
    padding: 2px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
  }
  .mobile-header-action svg { width: calc(100% - 4px); height: calc(100% - 4px); display: block; }
  .header-inner .logo-link { grid-column: 2; justify-self: center; }
  .header-inner .logo-img {
    height: clamp(28px, 8vw, 33px);
    width: auto;
  }
  .header-inner .btn-sample {
    grid-column: 3;
    justify-self: end;
    min-height: 28px;
    padding: 4px 6px;
    border-radius: 7px;
    font-size: 9px;
    white-space: nowrap;
  }
  .sample-label-full { display: none; }
  .sample-label-mobile { display: inline; }

  .review-track { justify-content: flex-start; }
  .review-card { flex: 0 0 calc(100% - 4px); }

  .social-links {
    --mobile-social-size: clamp(30px, 9vw, 34px);
    flex-wrap: nowrap;
    gap: clamp(4px, 1.8vw, 7px);
  }
  .social-link {
    flex: 0 0 var(--mobile-social-size);
    width: var(--mobile-social-size);
    height: var(--mobile-social-size);
  }
  .social-link svg { width: 65%; height: 65%; }

  .option-grid-size { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .option-grid-size .option-card:nth-child(1),
  .option-grid-size .option-card:nth-child(2) { grid-column: span 3; }
  .option-grid-size .option-card:nth-child(3),
  .option-grid-size .option-card:nth-child(4),
  .option-grid-size .option-card:nth-child(5) {
    grid-column: span 2;
    padding-left: 3px;
    padding-right: 3px;
    font-size: 14px;
    text-align: center;
  }
}

/* ---------- Tablet 768px+ ---------- */
@media (min-width: 768px) {
  .header-inner { max-width: 560px; padding: 12px 0 10px; justify-content: center; gap: 28px; }
  .logo-img { height: 43px; }

  .gallery { max-width: 560px; }

  .product-title { font-size: 26px; }
  .product-subtitle { font-size: 15.5px; max-width: 640px; }

  .section-heading { font-size: 22px; }

  .option-grid { grid-template-columns: repeat(6, 1fr); }
  .option-grid-size { grid-template-columns: repeat(5, 1fr); }

  .configurator { max-width: 640px; }

  .video-card { flex: 0 0 200px; }
  .review-card { flex: 0 0 170px; }

  .process-list { flex-direction: row; flex-wrap: wrap; }
  .process-item { flex: 1 1 45%; }

  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Sticky CTA only needed on smaller viewports */
  .sticky-cta { display: none; }
}

/* ---------- Tablet-only presentation 768px–1023px ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .header-inner {
    width: calc(100% - 32px);
    max-width: 760px;
    min-height: 54px;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
  }
  .header-socials {
    display: flex;
    align-items: center;
    justify-self: start;
    gap: 6px;
  }
  .header-socials a {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }
  .header-socials svg { width: 24px; height: 24px; display: block; }
  .header-inner .logo-link { grid-column: 2; justify-self: center; }
  .header-inner .btn-sample {
    grid-column: 3;
    justify-self: end;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  main { text-align: center; }
  main .container { margin-left: auto; margin-right: auto; }
  .product-info .container,
  .product-title,
  .product-subtitle,
  .section-heading,
  .section-subtext,
  .faq-question,
  .faq-answer { text-align: center; }
  .product-subtitle,
  .section-subtext { margin-left: auto; margin-right: auto; }
  .trust-badges { justify-content: center; }
  .timeline-card {
    justify-content: center;
    text-align: center;
  }
  .timeline-card p { max-width: 680px; }
  .configurator { text-align: left; }
  .configurator > .section-heading { text-align: center; }
  .process-section { text-align: left; }
  .process-section > .section-heading { text-align: center; }
}

/* ---------- Desktop 1024px+ ---------- */
@media (min-width: 1024px) {
  .container { padding: 0 32px; }

  .header-inner { max-width: 620px; padding-left: 0; padding-right: 0; }

  /* Two-column layout: gallery left, product+configurator right */
  .gallery-section {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-info,
  .usp-section,
  .configurator {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
  }

  .product-info .container {
    max-width: 760px;
    text-align: center;
  }
  .product-subtitle { margin-left: auto; margin-right: auto; }
  .trust-badges { justify-content: center; }
  .gallery-section .container { display: flex; justify-content: center; }
  .gallery-section .container .gallery { margin: 0 auto; width: 100%; }

  .gallery { max-width: 620px; }

  .configurator { max-width: 720px; }
  .timeline-section { max-width: 900px; }
  .timeline-card { justify-content: center; text-align: center; }
  .configurator > .section-heading,
  .configurator > .config-note { text-align: center; }
  .configurator .config-title-row { justify-content: center; }
  .configurator .config-step-title { text-align: center; }
  .configurator .frame-savings { display: flex; width: max-content; margin-left: auto; margin-right: auto; }

  .option-card { min-height: 64px; font-size: 16px; }

  .process-item { flex: 1 1 22%; }

  .video-card { flex: 0 0 calc((100% - 40px) / 5); }
  .review-card { flex: 0 0 190px; }

  .section-heading { font-size: 24px; }

  .btn-sample { padding: 8px 15px; font-size: 13px; }

  .videos-section,
  .trust-section,
  .process-section,
  .faq-section,
  .social-section { text-align: center; }
  .videos-section,
  .trust-section,
  .process-section,
  .faq-section { max-width: 1120px; }
  .process-item,
  .faq-question,
  .faq-answer { text-align: left; }
  .video-track { justify-content: flex-start; }
  .review-track { justify-content: center; }
  .order-info-card { text-align: left; }

}

/* ---------- Tablet and desktop: show exactly three reviews ---------- */
@media (min-width: 768px) {
  .review-track { justify-content: flex-start; }
  .review-card { flex: 0 0 calc((100% - 24px) / 3); }
}

/* ---------- Large desktop 1440px+ ---------- */
@media (min-width: 1440px) {
  :root { --container-width: 1280px; }

  .gallery { max-width: 680px; }
  .header-inner { max-width: 680px; }
  .configurator { max-width: 780px; }
}

/* ---------- Revised desktop product layout ---------- */
@media (min-width: 1024px) {
  .header-inner {
    width: calc(100% - 64px);
    max-width: 1280px;
    min-height: 54px;
    padding: 7px 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
  }
  .header-socials {
    display: flex;
    align-items: center;
    justify-self: start;
    gap: 9px;
  }
  .header-socials a {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform .15s ease, filter .15s ease;
  }
  .header-socials a:hover { transform: translateY(-1px); filter: saturate(1.12); }
  .header-socials svg { width: 26px; height: 26px; display: block; }
  .header-inner .logo-link { grid-column: 2; justify-self: center; }
  .header-inner .btn-sample { grid-column: 3; justify-self: end; }

  .desktop-product-layout {
    width: calc(100% - 64px);
    max-width: 1280px;
    margin: 22px auto 44px;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    grid-template-rows: auto;
    gap: 18px 36px;
    align-items: stretch;
  }
  .desktop-product-layout > .desktop-left-column {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 70px;
    align-self: start;
    height: max-content;
  }
  .desktop-left-column > .gallery-section {
    width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    top: auto;
  }
  .desktop-left-column > .gallery-section,
  .desktop-left-column > .gallery-section .container,
  .desktop-left-column > .gallery-section .gallery,
  .desktop-left-column > .gallery-section .gallery-main-wrap,
  .desktop-left-column > .gallery-section .gallery-main { min-width: 0; }
  .desktop-left-column > .gallery-section .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  .desktop-left-column > .gallery-section .gallery {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  .desktop-product-layout > .desktop-right-column {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .desktop-right-column > .product-info {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .desktop-right-column > .product-info .container {
    max-width: none;
    padding: 0;
    text-align: left;
  }
  .desktop-product-layout .product-title { font-size: 30px; }
  .desktop-product-layout .product-subtitle { max-width: none; margin-left: 0; margin-right: 0; }
  .desktop-product-layout .trust-badges {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .desktop-product-layout .trust-badges .badge {
    min-width: 0;
    padding: 5px 4px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
  }

  .desktop-right-column > .usp-section,
  .desktop-right-column > .timeline-section { display: none; }
  .desktop-left-column > .desktop-left-details {
    width: 100%;
    min-width: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .desktop-left-details .usp-section {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 1px solid #e9ca76;
    border-radius: var(--radius-md);
  }
  .desktop-left-details .timeline-section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .desktop-left-details .timeline-card { text-align: left; }
  .desktop-product-layout .usp-track-wrap { max-width: 100%; }
  .desktop-product-layout .usp-track {
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .desktop-product-layout .usp-item { flex: 0 0 auto; }

  .desktop-product-layout > .timeline-section { display: none; }
  .desktop-right-column > .configurator {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    margin: 0;
    padding: 20px 22px 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    box-shadow: var(--shadow-md);
  }
  .desktop-product-layout .configurator > .section-heading,
  .desktop-product-layout .configurator > .config-note,
  .desktop-product-layout .configurator .config-step-title { text-align: left; }
  .desktop-product-layout .configurator .config-title-row { justify-content: space-between; }
  .desktop-product-layout .configurator .frame-savings {
    display: inline-flex;
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }
  .desktop-product-layout .configurator .frame-savings[hidden] { display: none; }
  .desktop-product-layout .config-step { margin-bottom: 16px; }
  .desktop-product-layout .option-card { min-height: 58px; font-size: 14px; }
  .desktop-product-layout .config-note { margin-bottom: 16px; }
}
