/* Motoparcacin.com — Mobile Professional UI */

/* Safe areas & bottom nav spacing */
:root {
    --mobile-nav-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.has-mobile-nav {
    padding-bottom: 0;
}

@media (max-width: 1023px) {
    body.has-mobile-nav main {
        padding-bottom: calc(var(--mobile-nav-h) + var(--safe-bottom));
    }

    .site-footer {
        padding-bottom: calc(var(--mobile-nav-h) + var(--safe-bottom));
    }
}

/* Page container */
.page-container {
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 1024px) {
    .page-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: var(--safe-bottom);
    display: none;
}
@media (max-width: 1023px) {
    .mobile-bottom-nav { display: block; }
}
.mobile-bottom-nav-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: var(--mobile-nav-h);
    max-width: 32rem;
    margin: 0 auto;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #737373;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item svg { width: 1.35rem; height: 1.35rem; }
.mobile-nav-item.active { color: var(--brand); }
.mobile-nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--brand);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile drawer menu */
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.mobile-drawer-overlay.open { opacity: 1; visibility: visible; }

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    background: #111;
    z-index: 61;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
    -webkit-overflow-scrolling: touch;
}
.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: rgba(255,255,255,.8);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.2s;
}
.mobile-drawer-link:hover, .mobile-drawer-link:active { background: rgba(255,255,255,.08); color: #fff; }
.mobile-drawer-link svg { width: 1.25rem; height: 1.25rem; opacity: 0.7; }

/* Mobile search bar */
.mobile-search-bar {
    display: none;
    padding: 0.5rem 1rem 0.75rem;
    background: rgba(10,10,10,.95);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
@media (max-width: 767px) {
    .mobile-search-bar { display: block; }
}

/* Filter drawer (products) */
.filter-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 55;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.filter-drawer-overlay.open { opacity: 1; visibility: visible; }
.filter-drawer {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(340px, 90vw);
    background: #fff;
    z-index: 56;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
    overflow-y: auto;
    padding: 1.25rem;
    -webkit-overflow-scrolling: touch;
}
.filter-drawer.open { transform: translateX(0); }
.filter-drawer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f5f5f5;
}

/* Sticky product bar */
.product-sticky-bar {
    position: fixed;
    bottom: calc(var(--mobile-nav-h) + var(--safe-bottom));
    left: 0;
    right: 0;
    z-index: 44;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0,0,0,.08);
    padding: 0.75rem 1rem;
    display: none;
    gap: 0.75rem;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
@media (max-width: 1023px) {
    .product-sticky-bar.visible { display: flex; }
}

/* Sticky cart checkout */
.cart-sticky-checkout {
    position: fixed;
    bottom: calc(var(--mobile-nav-h) + var(--safe-bottom));
    left: 0;
    right: 0;
    z-index: 44;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.08);
    padding: 0.875rem 1rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
@media (max-width: 1023px) {
    .cart-sticky-checkout.visible { display: flex; }
}

/* Scrollable tabs */
.tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll nav { min-width: max-content; }

/* Footer accordion */
.footer-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 0;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease);
}
.footer-accordion-panel.open { max-height: 300px; padding-bottom: 1rem; }
@media (min-width: 768px) {
    .footer-accordion-btn { pointer-events: none; border: none; padding: 0; margin-bottom: 1rem; }
    .footer-accordion-panel { max-height: none !important; overflow: visible; padding-bottom: 0 !important; }
    .footer-accordion-chevron { display: none; }
}

/* Account nav horizontal scroll */
.account-nav-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.account-nav-scroll::-webkit-scrollbar { display: none; }
@media (max-width: 1023px) {
    .account-nav-scroll nav {
        display: flex;
        gap: 0.5rem;
        padding: 0.25rem;
        min-width: max-content;
    }
    .account-nav-scroll nav a {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ─── Mobile breakpoints ─── */
@media (max-width: 1023px) {
    .section-title { font-size: 1.5rem; }
    .section-desc { font-size: 0.9375rem; }
    .section { padding: 2.5rem 0; }

    .site-header .header-inner { height: 60px; }
    .hero-gradient .hero-content { padding-top: 3rem; padding-bottom: 3rem; }

    .trust-item { padding: 1rem; }
    .trust-icon { width: 38px; height: 38px; }

    .auth-card { padding: 1.5rem; border-radius: 16px; }

    .product-card .img-wrap img { padding: 1rem; }
    .product-card .badge { font-size: 0.6rem; padding: 0.25rem 0.5rem; }
    .product-card > div:last-child { padding: 0.75rem; }
    .product-card h3 { font-size: 0.8125rem; min-height: 2.25rem; }
    .product-card .text-lg { font-size: 0.9375rem; }

    .cat-card { aspect-ratio: 1; }

    .brand-pill { min-width: 100px; height: 52px; font-size: 0.75rem; padding: 0 1rem; }

    .btn { padding: 0.75rem 1.25rem; font-size: 0.875rem; min-height: 44px; }
    .input-field { min-height: 44px; font-size: 16px; } /* prevents iOS zoom */

    /* Specs table stack on mobile */
    .spec-row { flex-direction: column !important; }
    .spec-row > div { width: 100% !important; }
    .spec-row > div:first-child { border-bottom: none; padding-bottom: 0.5rem; }
}

@media (max-width: 767px) {
    .announcement-bar span:not(:first-child) { display: none; }

    .hero-gradient h1 { font-size: 1.875rem !important; line-height: 1.15; }
    .hero-stats { gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; }
    .hero-stats p.text-2xl { font-size: 1.25rem; }

    .product-page-title { font-size: 1.375rem !important; }
    .product-page-price { font-size: 1.75rem !important; }

    .breadcrumb-nav { font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .cart-item-row { flex-wrap: wrap; }
    .cart-item-actions { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 0.5rem; }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: calc(var(--mobile-nav-h) + var(--safe-bottom) + 1rem);
    }

    .filters-desktop { display: none; }
    .filter-toggle-btn { display: flex !important; }

    .reviews-summary-mobile { margin-bottom: 1.5rem; }
}

@media (min-width: 768px) {
    .filter-toggle-btn { display: none !important; }
    .filters-desktop { display: block; }
}

/* Touch feedback */
@media (hover: none) {
    .product-card:hover { transform: none; box-shadow: none; }
    .product-card:active { transform: scale(0.98); }
    .btn-primary:hover { transform: none; }
}

/* Hide desktop add-to-cart on mobile when sticky bar exists */
@media (max-width: 1023px) {
    .product-add-form-desktop { display: none; }
}

@media (min-width: 1024px) {
    .product-sticky-bar { display: none !important; }
    .cart-sticky-checkout { display: none !important; }
    .mobile-search-bar { display: none !important; }
}
