/* MOBILE */

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
    padding-top: 104px;
  }

  .header {
    position: fixed;
    top: 10px;
    left: 50%;
    z-index: 1000;
    width: min(94%, calc(100% - 24px));
    margin-top: 0;
    margin-bottom: 0;
    gap: 8px;
    padding: 10px 12px;
    transform: translateX(-50%);
  }

  .logo {
    gap: 8px;
    min-width: 0;
  }

  .logo img {
    width: 54px;
    flex: 0 0 auto;
  }

  .logo span,
  .logo-text {
    min-width: 0;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
  }

  .menu-toggle {
    display: inline-grid;
    width: 68px;
    height: 68px;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    background:
      radial-gradient(circle at center, rgba(255, 20, 147, 0.16), rgba(20, 0, 16, 0.78) 68%),
      rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 184, 228, 0.28);
    border-radius: 999px;
    color: white;
    font-size: 0;
    cursor: pointer;
    line-height: 1;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 12px 28px rgba(0, 0, 0, 0.28),
      0 0 22px rgba(255, 20, 147, 0.18);
  }

  .menu-toggle img {
    width: 100%;
    height: 100%;
    transform: scale(1.28);
  }

  .nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 6%;
    width: min(300px, 88vw);
    max-height: calc(100vh - 98px);
    overflow-y: auto;
    padding: 22px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    background: rgba(10, 0, 12, 0.96);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    z-index: 999;
  }

  .nav.active {
    display: flex;
  }

  .nav a {
    width: 100%;
    padding: 12px 14px;
    color: #fff7fc;
  }

  .nav a.active::after {
    display: none;
  }

  .hero {
    padding: 44px 6%;
    min-height: auto;
    display: block;
    text-align: left;
  }

  .hero-content,
  .hero-text,
  .hero-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .eyebrow {
    font-size: 14px;
    letter-spacing: 3px;
  }

  .hero h1 {
    font-size: 36px;
    line-height: 1.05;
    letter-spacing: -1px;
    max-width: 100%;
    word-break: normal;
  }

  .hero-text {
    font-size: 16px;
    line-height: 1.7;
    margin-top: 18px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 14px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .section,
  .cta {
    padding: 34px 6%;
  }

  .section h2,
  .cta h2 {
    font-size: 34px;
    line-height: 1.1;
  }

  .section-tag,
  .eyebrow {
    margin-bottom: 8px;
  }

  .opening-sale-card,
  .sale-card {
    margin-top: 34px;
  }

  .btn {
    margin-bottom: 14px;
  }

  .template-grid,
  .service-grid,
  .pricing-grid,
  .process-grid,
  .faq-grid,
  .about-stats,
  .card-grid,
  .card-grid--three,
  .card-grid--four,
  .path-grid,
  .detail-grid,
  .templates-grid,
  .featured-product,
  .contact-form-layout,
  .template-version-grid,
  .template-collection-grid,
  .launch-grid,
  .addon-grid,
  .page-content-grid,
  .brand-color-grid,
  .three-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .featured-template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    padding: 16px;
  }

  .featured-template-card .template-version-media {
    max-height: 320px;
  }

  .featured-template-card .template-version-actions {
    justify-self: stretch;
    width: 100%;
  }

  .template-mini-card img {
    height: 300px;
  }

  .trust-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .trust-chip {
    min-height: 72px;
    padding: 12px 10px;
    border-radius: 18px;
  }

  .trust-chip span {
    display: none;
  }

  .trust-chip strong {
    font-size: 0.88rem;
    line-height: 1.25;
    overflow-wrap: normal;
  }

  .homepage-templates-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .template-mini-card {
    width: min(100%, 420px);
    margin: 0 auto;
  }

  .template-mini-body {
    min-width: 0;
  }

  .template-mini-body p {
    overflow-wrap: anywhere;
  }

  .template-mini-meta {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .template-mini-meta > span {
    min-width: 0;
    white-space: normal;
  }

  .card,
  .pricing-card,
  .template-card,
  .product-price,
  .path-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pricing-card {
    padding: 28px 22px;
  }

  .pricing-card h3 {
    font-size: 20px;
    line-height: 1.3;
  }

  .pricing-card p,
  .pricing-card li {
    font-size: 16px;
    line-height: 1.6;
  }

  .pricing-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px;
  }

  .pricing-row > * {
    width: 100%;
    max-width: 100%;
  }

  .template-version-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .template-version-media {
    width: 100%;
    max-height: 340px;
  }

  .template-version-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .template-version-price {
    justify-items: start;
    text-align: left;
  }

  .template-version-actions {
    align-items: stretch;
  }

  .template-version-actions .btn,
  .btn,
  .learn-more {
    max-width: 100%;
    white-space: normal;
  }

  .form-row--three,
  .form-row--service-layout,
  .choice-grid,
  .choice-grid--tight,
  .choice-grid--brand-palette {
    grid-template-columns: 1fr;
  }

  .pricing-row h3,
  .pricing-row strong {
    font-size: 1rem;
    line-height: 1.2;
  }

  .pricing-row .price,
  .pricing-row .sale-price {
    display: block;
    font-size: 1.15rem;
    margin-top: 6px;
  }

  .pricing-row p {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .pricing-table,
  .pricing-list {
    overflow: hidden;
  }

  .hero-quick-prices {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .quick-price-row {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding: 16px;
  }

  .quick-price-row:last-child {
    border-bottom: none;
  }

  .template-meta {
    flex-direction: column;
  }

  .path-card {
    padding: 24px;
  }

  .path-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .path-list .service-sale-compact {
    justify-items: start;
    text-align: left;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand p {
    max-width: 100%;
  }

  .footer-logo {
    margin: 0 auto 15px;
  }

  .template-section-jumps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    gap: 10px;
    padding-bottom: 0;
    margin-right: 0;
  }

  .template-browser-sale {
    display: grid;
    width: 100%;
    min-height: 144px;
    gap: 14px;
    padding: 20px 14px;
  }

  .template-browser-sale__prices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .template-browser-sale__prices > span {
    justify-content: center;
    min-height: 58px;
    padding: 14px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    white-space: normal;
  }

  .template-section-jump {
    min-width: 0;
    padding: 11px 12px;
    font-size: 0.78rem;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  .featured-carousel-dots {
    margin-top: 14px;
  }

  .featured-carousel-btn {
    top: auto;
    bottom: -6px;
    width: 36px;
    height: 36px;
    font-size: 1.7rem;
    transform: none;
  }

  .featured-carousel-btn:hover,
  .featured-carousel-btn:focus-visible {
    transform: scale(1.04);
  }

  .featured-carousel-prev {
    left: 0;
  }

  .featured-carousel-next {
    right: 0;
  }
}

/* CART TABLET */

@media (max-width: 980px) {
  .cart-page-grid {
    grid-template-columns: 1fr;
  }

  .cart-checkout-card {
    position: static;
  }

  .cart-image-wrap--placeholder {
    min-height: 340px;
    padding: 24px;
  }

  .cart-image-wrap img {
    height: 280px;
  }

  .cart-image-wrap--placeholder img {
    width: min(100%, 560px);
    height: auto;
    max-height: 380px;
  }
}

/* SMALL MOBILE */

@media (max-width: 650px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-request-card {
    padding: 24px;
  }

  .cart-section {
    margin-top: 36px;
  }

  .cart-item-content,
  .cart-checkout-card {
    padding: 24px;
  }

  .cart-image-wrap img {
    height: 220px;
  }

  .cart-image-wrap--placeholder {
    min-height: 260px;
    padding: 18px;
  }

  .cart-image-wrap--placeholder img {
    width: min(100%, 420px);
    height: auto;
    max-height: 280px;
  }

  .summary-row,
  .summary-total {
    flex-direction: column;
    gap: 6px;
  }

  .success-main {
    min-height: auto;
    padding: 50px 6%;
  }

  .success-card {
    padding: 34px 22px;
    border-radius: 28px;
  }

  .success-card h1 {
    font-size: 38px;
  }
}

@media (max-width: 420px) {
  .header {
    width: min(96%, calc(100% - 16px));
    top: 8px;
    padding: 8px 10px;
  }

  .logo {
    gap: 6px;
  }

  .logo img {
    width: 44px;
  }

  .logo span,
  .logo-text {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .menu-toggle {
    width: 58px;
    height: 58px;
  }

  .template-section-jumps {
    grid-template-columns: 1fr;
  }

  .template-browser-sale__prices {
    grid-template-columns: 1fr;
  }

  .template-section-jump {
    font-size: 0.82rem;
  }

  .section h2,
  .cta h2 {
    font-size: 30px;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .trust-chip {
    min-height: 60px;
  }

  .template-mini-card img {
    height: 260px;
  }
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 640px) {

  .store-hero {
    min-height: auto;
    padding: 70px 0;
  }

  .store-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .store-button {
    width: 100%;
  }

  .hero-feature-row,
  .hero-stat-row {
    flex-direction: column;
    gap: 8px;
  }

  .store-nav {
    gap: 6px;
  }

}
/* Keep headers pinned on mobile without covering store-page heroes */
@media (max-width: 760px) {
  html {
    padding-top: 0;
  }

  body.store-page {
    padding-top: 0;
  }

  body:not(.store-page) {
    padding-top: 88px;
  }

  .store-header {
    position: sticky;
    top: 0;
    z-index: 3000;
  }

  body.store-page .store-hero {
    padding-top: 16px;
  }

  .header {
    position: fixed;
    top: 0;
    z-index: 3000;
  }

  .nav {
    z-index: 2999;
  }
}

@media (max-width: 420px) {
  .header {
    top: 0;
  }
}
/* Final mobile sticky navigation spacing */
@media (max-width: 760px) {
  html {
    padding-top: 0;
    scroll-padding-top: 88px;
  }

  body.store-page {
    padding-top: 0;
  }

  body:not(.store-page) {
    padding-top: 88px;
  }

  .store-header,
  .header {
    top: 0;
    z-index: 10000;
  }

  .store-header {
    position: sticky;
  }

  .header {
    position: fixed;
  }

  .store-nav,
  .nav {
    z-index: 10001;
  }

  .nav {
    top: calc(100% + 8px);
    max-height: calc(100vh - 88px);
  }
}
/* Final fixed header visibility guard */
@media (max-width: 760px) {
  :root {
    --store-fixed-header-offset: 52px;
    --legacy-fixed-header-offset: 148px;
  }

  html {
    padding-top: 0;
    scroll-padding-top: var(--legacy-fixed-header-offset);
  }

  body.store-page {
    padding-top: var(--store-fixed-header-offset);
  }

  body:not(.store-page) {
    padding-top: var(--legacy-fixed-header-offset);
  }

  body.store-page > .store-header {
    position: fixed;
    top: 0;
    z-index: 20000;
  }

  .header {
    position: fixed;
    top: 0;
    z-index: 20000;
  }

  .store-nav,
  .nav {
    z-index: 20001;
  }
}

@media (max-width: 560px) {
  :root {
    --store-fixed-header-offset: 56px;
  }
}
