/* ============================================================
   Growth Stage — Responsive Stylesheet
   ============================================================ */

/* ---- 1200px: Large Tablets ---- */
@media (max-width: 1200px) {
    .hero-content {
        gap: 2.5rem;
    }

    .footer-container {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 2rem;
    }

    .checkout-grid {
        gap: 1.5rem;
    }
}

/* ---- 992px: Tablets ---- */
@media (max-width: 992px) {
    /* Navbar */
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(13, 21, 38, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.25rem;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
        z-index: 1001;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-link {
        padding: 0.85rem 1rem;
        border-radius: var(--radius-sm);
        font-size: 1rem;
    }

    /* Hero compact on tablets */
    .hero-content-compact {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.25rem;
        padding: 2rem 1.25rem;
    }

    .hero-title-compact {
        font-size: clamp(1.4rem, 4vw, 1.8rem);
    }

    .hero-subtitle-compact {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-visual-compact {
        order: -1;
    }

    .hero-stats-compact {
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Hero */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 4rem 1.5rem;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-camera-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    /* Products grid: 2 columns */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    /* Checkout */
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1/-1;
    }

    /* Admin dashboard stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Admin sidebar */
    .admin-layout {
        grid-template-columns: 1fr !important;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px;
        z-index: 1300;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
        box-shadow: var(--shadow-lg);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 1200;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    .admin-main {
        padding: 1.5rem 1rem !important;
    }

    .admin-topbar {
        padding-left: 1rem !important;
    }
}

/* ---- 768px: Mobile ---- */
@media (max-width: 768px) {
    /* Navbar: smaller padding, hamburger more visible */
    .nav-container {
        height: 60px;
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .nav-links {
        max-height: calc(100vh - 60px);
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .hamburger {
        width: 42px;
        height: 42px;
    }

    .cart-btn {
        width: 42px;
        height: 42px;
    }

    /* Hero */
    .hero-content {
        padding: 3rem 1rem;
        min-height: auto;
    }

    .hero-title {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-camera-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Filter bar */
    .filter-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-tabs {
        width: 100%;
    }

    .filter-tab {
        font-size: 0.8rem;
        padding: 0.4rem 0.9rem;
    }

    .sort-select {
        width: 100%;
    }

    /* Products: single column on mobile */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Cart drawer: full width */
    .cart-drawer {
        width: 100%;
    }

    /* Checkout */
    .checkout-page {
        padding: 2rem 1rem;
    }

    /* Toast */
    .toast-container {
        left: 1rem;
        right: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }

    /* Buttons */
    .btn-lg {
        width: 100%;
    }

    /* Admin */
    .admin-topbar-title {
        display: none;
    }

    .admin-content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-row {
        flex-direction: column !important;
        gap: 0.75rem;
    }

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

    /* Modal */
    .modal {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Hero actions */
    .hero-actions .btn {
        width: 100%;
    }
}

/* ---- 480px: Small Mobile ---- */
@media (max-width: 480px) {
    body { font-size: 14px; }

    .navbar { padding: 0 1rem; }

    .logo-icon { width: 36px; height: 36px; }

    .hero-title { font-size: 1.75rem; }

    .hero-badge { font-size: 0.7rem; }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .hero-stats-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
        max-width: 100%;
    }

    .hero-stat {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 0.75rem 1rem;
    }

    .hero-stat .stat-label {
        order: -1;
    }

    /* Keep compact stats horizontal and centered on small phones */
    .hero-stats-compact .hero-stat {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0.5rem 0.35rem;
    }

    .hero-stats-compact .stat-label {
        order: 0;
    }

    .hero-camera-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Full-width buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-sm {
        width: auto;
    }

    .product-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .product-footer .product-price {
        text-align: center;
        font-size: 1.3rem;
    }

    .add-to-cart-btn {
        width: 100%;
        justify-content: center;
    }

    .checkout-card-body {
        padding: 1rem;
    }

    .form-group { margin-bottom: 1rem; }

    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item-subtotal {
        display: none;
    }

    /* Admin table */
    .admin-table td, .admin-table th {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Section */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Modal full screen */
    .modal-content {
        max-height: 100vh;
        border-radius: 0 !important;
    }
}

/* ---- Print styles ---- */
@media print {
    .navbar, .cart-drawer, .cart-overlay, .toast-container, .site-footer { display: none; }
    body { background: white; color: black; }
    .admin-sidebar { display: none; }
    .admin-layout { display: block !important; }
}

/* ---- Product Detail Page responsive ---- */
@media (max-width: 768px) {
    /* Product detail 2-col → 1-col */
    .checkout-page > .checkout-grid,
    div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 3rem"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* ---- Filter bar scroll on tiny screens ---- */
@media (max-width: 480px) {
    .filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .filter-tab {
        flex-shrink: 0;
    }

    /* Don't make ALL buttons full-width — exclude icon-only admin buttons */
    .admin-btn { width: auto; }

    /* Cart page item layout */
    .cart-page-item {
        flex-wrap: wrap;
    }
}
