/**
 * Peptide Luxe — Mobile-adaptive layouts (not scaled desktop).
 * Default experience optimized for phones; desktop rules live in main.css min-width blocks.
 */

/* Safe areas & bottom tab bar spacing */
body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

body.has-mobile-tab-bar {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
}

/* —— Header (mobile) —— */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
    --container-pad: 1rem;
  }

  .container {
    width: min(100% - var(--container-pad) * 2, var(--container));
  }

  .top-promo {
    font-size: 0.75rem;
    padding: 0.4rem 0;
  }

  .top-promo-inner {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: center;
  }

  .top-promo-badge {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.9;
    font-weight: 700;
  }

  .top-promo p {
    margin: 0;
    line-height: 1.35;
  }

  .header-inner {
    min-height: var(--header-h);
    gap: 0.5rem;
  }

  .site-logo-text {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
    margin: 0;
    flex-shrink: 0;
  }

  .logo-name {
    font-size: 1.1rem;
  }

  .logo-tagline {
    display: none;
  }

  .custom-logo-link img {
    max-height: 40px;
  }

  .header-account--desktop {
    display: none !important;
  }

  .header-actions button,
  .header-actions a {
    width: 40px;
    height: 40px;
  }

  .lang-switcher.lang-fallback {
    display: none;
  }

  .main-navigation {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu-panel {
    inset: auto 0 0 0;
    top: 0;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0));
    border-radius: 0;
  }

  .mobile-menu-panel-inner {
    max-height: 100%;
    overflow-y: auto;
  }

  .mobile-menu-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
    font-weight: 700;
  }

  .mobile-menu-panel .menu a {
    font-size: 1.35rem;
    padding: 1rem 0;
  }

  .mobile-menu-panel .lang-switcher {
    display: flex;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
  }

  /* —— Hero (mobile-native) —— */
  .hero-section {
    padding: 0 0 1.5rem;
    background: var(--color-bg);
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .hero-visual {
    order: -1;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 1.25rem;
  }

  .hero-image,
  .hero-image-placeholder {
    aspect-ratio: 1 / 1;
    max-height: 52vh;
    border-radius: 0 0 28% 28% / 0 0 12% 12%;
    box-shadow: none;
  }

  .hero-decor {
    display: none;
  }

  .hero-content {
    text-align: left;
    padding: 0 var(--container-pad);
  }

  .hero-rating {
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
  }

  .hero-title {
    font-size: 1.75rem;
    line-height: 1.15;
    margin-bottom: 0.65rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    max-width: none;
    margin: 0;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1.25rem;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .hero-actions .btn-link {
    justify-content: center;
    padding: 0.75rem;
  }

  /* —— Trust bar (horizontal scroll) —— */
  .trust-bar {
    padding: 0.75rem 0 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
  }

  .trust-bar-inner {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .trust-bar-inner::-webkit-scrollbar {
    display: none;
  }

  .trust-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: min(85vw, 280px);
    padding: 0.65rem 0.85rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .trust-icon {
    flex-shrink: 0;
    color: var(--color-primary);
  }

  .trust-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    white-space: nowrap;
  }

  /* —— Features (snap carousel) —— */
  .features-section .section-header {
    text-align: left;
    margin-inline: 0;
    padding: 0 var(--container-pad);
  }

  .features-grid {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 var(--container-pad) 0.5rem;
    margin: 0 calc(-1 * var(--container-pad));
    scrollbar-width: none;
  }

  .features-grid::-webkit-scrollbar {
    display: none;
  }

  .feature-card {
    flex: 0 0 min(78vw, 300px);
    scroll-snap-align: center;
    text-align: left;
    padding: 1.25rem;
  }

  .feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0.85rem;
  }

  /* —— Categories (2-col grid) —— */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .category-card {
    aspect-ratio: 4/5;
    padding: 0.85rem;
  }

  .category-name {
    font-size: 1rem;
  }

  /* —— Products (full-bleed carousel) —— */
  .products-section .section-header-row {
    padding: 0 var(--container-pad);
  }

  .products-carousel {
    margin: 0 calc(-1 * var(--container-pad));
    padding: 0 var(--container-pad);
  }

  .products-carousel .products > li.product {
    flex: 0 0 min(72vw, 260px);
  }

  .carousel-btn {
    display: none;
  }

  /* —— Science —— */
  .science-grid {
    gap: 1.5rem;
  }

  .science-image {
    aspect-ratio: 16/10;
    border-radius: var(--radius);
  }

  .science-content {
    padding: 0 var(--container-pad);
  }

  .concerns-tags {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0 var(--container-pad) 0.5rem;
    margin: 0 calc(-1 * var(--container-pad));
    scrollbar-width: none;
  }

  .concerns-tags::-webkit-scrollbar {
    display: none;
  }

  .concern-tag {
    flex-shrink: 0;
    font-size: 0.85rem;
  }

  /* —— Testimonials (stack cards) —— */
  .testimonials-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .testimonial-card {
    padding: 1.25rem;
  }

  /* —— Blog (horizontal cards) —— */
  .blog-grid {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  .blog-grid::-webkit-scrollbar {
    display: none;
  }

  .blog-card {
    flex: 0 0 min(78vw, 300px);
    scroll-snap-align: center;
  }

  /* —— Footer —— */
  .footer-cta {
    padding: 2rem 0;
  }

  .footer-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .footer-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-bottom .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .back-to-top {
    bottom: calc(72px + env(safe-area-inset-bottom, 0));
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  /* —— Mobile bottom tab bar —— */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 24px rgba(45, 42, 40, 0.08);
  }

  .mobile-tab-bar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    min-height: 56px;
    color: var(--color-text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
  }

  .mobile-tab-bar .tab-item.is-active {
    color: var(--color-primary);
  }

  .mobile-tab-bar .tab-item svg {
    width: 22px;
    height: 22px;
  }

  .mobile-tab-bar .header-cart-count {
    top: 2px;
    right: calc(50% - 22px);
  }

  /* —— WooCommerce mobile shop —— */
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.9rem;
    padding: 0.5rem 0.65rem 0;
  }

  .woocommerce ul.products li.product .price {
    font-size: 0.85rem;
    padding: 0 0.65rem;
  }

  .woocommerce ul.products li.product .button {
    margin: 0.5rem 0.65rem 0.65rem;
    font-size: 0.75rem;
    padding: 0.5rem !important;
  }

  .single-product .product {
    gap: 1.25rem;
  }

  .single-product .product_title {
    font-size: 1.5rem;
  }

  .single-product .single_add_to_cart_button {
    width: 100%;
  }
}

/* Tablet bridge */
@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-bar-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .trust-item--badge {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

/* Hide mobile-only UI on desktop */
@media (min-width: 769px) {
  .mobile-tab-bar {
    display: none !important;
  }

  body.has-mobile-tab-bar {
    padding-bottom: 0;
  }
}
