/* ===================================================================
   MOBILE-FIRST DESIGN SYSTEM FOR GEARUP PERCUSSION
   Standard CSS (no @apply - works with Tailwind CDN)
   =================================================================== */

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #800000;
    --primary-dark: #5d1212;
    --primary-light: #a03030;
    --secondary: #1a0000;
    --accent: #ffd700;
    --muted: #64748b;
    --bg: #fefefe;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #222222;
    --text-muted: #64748b;
    --nav-height: 60px;
    --mobile-padding: 12px;
    --tablet-padding: 20px;
    --desktop-padding: 32px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ===== BASE MOBILE STYLES ===== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 14px;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

@media (min-width: 1024px) {
    html { font-size: 16px; }
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* ===== MOBILE NAVIGATION TOGGLE ===== */
/* COMPLETELY HIDE these - use mobile-menu-btn from mobile-navigation.js instead */
.mobile-nav-toggle,
button.mobile-nav-toggle,
#mobile-nav-toggle,
.mobile-cart-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

.mobile-nav-toggle:hover,
.mobile-cart-toggle:hover {
    background: transparent !important;
}

.mobile-cart-toggle {
    position: absolute !important;
    left: -9999px !important;
}

.mobile-cart-toggle .cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: var(--accent);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-nav-toggle,
    .mobile-cart-toggle {
        display: flex !important;
    }
}

/* ===== MOBILE DRAWER ===== */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-nav-drawer.active {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .mobile-nav-drawer {
        display: block;
    }
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.mobile-nav-logo {
    height: 32px;
    width: auto;
}

.mobile-nav-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.mobile-nav-content {
    padding: 16px;
}

.mobile-nav-section {
    margin-bottom: 20px;
}

.mobile-nav-section h4 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0e0e0;
}

.mobile-nav-section a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #333;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.mobile-nav-section a:hover,
.mobile-nav-section a:active {
    background: #f7eaea;
    color: var(--primary);
}

.mobile-nav-section a i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
}

.mobile-nav-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: #fff !important;
    justify-content: center;
    margin-top: 8px;
}

.mobile-nav-login i {
    color: #fff !important;
}

.mobile-nav-admin {
    background: var(--accent) !important;
    color: var(--primary) !important;
    justify-content: center;
    font-weight: 600;
}

.mobile-nav-admin i {
    color: var(--primary) !important;
}

/* ===== HEADER MOBILE ===== */
@media (max-width: 768px) {
    .main-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 12px !important;
        gap: 10px !important;
        height: auto !important;
        min-height: 56px !important;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .main-header .navbar-left,
    .main-header .navbar-right {
        display: none !important;
    }
    
    .main-header .logo {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    .main-header .logo img,
    .main-header .logo-icon {
        height: 32px !important;
        width: auto !important;
    }
}

/* ===== PRODUCT GRID MOBILE ===== */
@media (max-width: 768px) {
    .products-grid,
    .products-grid-modern,
    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 4px;
    }
}

@media (max-width: 360px) {
    .products-grid,
    .products-grid-modern,
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* ===== PRODUCT CARD MOBILE ===== */
@media (max-width: 768px) {
    .product-card,
    .product-card-modern {
        border-radius: var(--radius-md) !important;
        overflow: hidden;
    }
    
    .product-image,
    .card-image-modern {
        height: 140px !important;
        min-height: 140px !important;
    }
    
    .product-content,
    .card-body-modern {
        padding: 10px !important;
    }
    
    .product-title,
    .card-title-modern {
        font-size: 0.85rem !important;
        line-height: 1.25 !important;
        margin-bottom: 4px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-description,
    .card-desc-modern {
        display: none !important;
    }
    
    .product-category,
    .card-category-modern {
        font-size: 9px !important;
        margin-bottom: 4px !important;
    }
    
    .product-rating,
    .card-rating-modern {
        font-size: 9px !important;
        margin-bottom: 6px !important;
    }
    
    .product-rating i,
    .card-rating-modern i {
        font-size: 9px !important;
    }
    
    .product-footer,
    .card-footer-modern {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .price,
    .card-price-modern {
        font-size: 1rem !important;
        text-align: center !important;
    }
    
    .btn-add-cart,
    .card-btn-modern {
        width: 100% !important;
        padding: 10px 12px !important;
        font-size: 11px !important;
        justify-content: center !important;
        border-radius: var(--radius-md) !important;
        min-height: 40px;
    }
    
    .product-badge,
    .card-badge-modern {
        font-size: 9px !important;
        padding: 3px 6px !important;
        top: 6px !important;
        right: 6px !important;
    }
    
    .product-overlay,
    .card-overlay-modern {
        display: none !important;
    }
}

/* ===== CART SIDEBAR MOBILE ===== */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
    }
    
    .cart-sidebar-header {
        padding: 14px 16px !important;
    }
    
    .cart-sidebar-header h3 {
        font-size: 1rem !important;
    }
    
    .cart-sidebar-content {
        padding: 12px !important;
    }
    
    .cart-sidebar-item {
        gap: 10px !important;
        padding: 10px !important;
    }
    
    .cart-sidebar-item-image {
        width: 60px !important;
        height: 60px !important;
        flex-shrink: 0;
    }
    
    .cart-sidebar-item-info h4 {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    
    .cart-sidebar-item-info p {
        font-size: 0.8rem !important;
    }
    
    .cart-sidebar-footer {
        padding: 14px 16px !important;
        padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
    }
    
    .checkout-btn-sidebar {
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
    }
}

/* ===== HERO MOBILE ===== */
@media (max-width: 768px) {
    .modern-hero,
    .shop-hero {
        min-height: 60vh !important;
        padding: 60px 16px 40px !important;
    }
    
    .hero-container,
    .shop-hero-content {
        padding: 0 !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.1 !important;
        margin-bottom: 16px !important;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 24px !important;
        padding: 0 8px !important;
    }
    
    .hero-badge {
        font-size: 0.7rem !important;
        padding: 5px 12px !important;
        margin-bottom: 16px !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 0 20px !important;
    }
    
    .hero-btn {
        width: 100% !important;
        padding: 14px 24px !important;
        font-size: 13px !important;
        text-align: center !important;
    }
    
    .hero-logo-img {
        max-width: 250px !important;
    }
    
    .stats-container {
        gap: 24px !important;
        margin-top: 20px !important;
    }
    
    .stat-number {
        font-size: 1.4rem !important;
    }
    
    .stat-label {
        font-size: 0.7rem !important;
    }
}

/* ===== FORM INPUTS MOBILE ===== */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
        padding: 12px 14px !important;
        border-radius: var(--radius-md) !important;
        min-height: 44px;
    }
    
    button,
    .btn,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px !important;
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
    }
}

/* ===== MODAL MOBILE ===== */
@media (max-width: 768px) {
    .modal {
        padding: 0 !important;
        align-items: flex-end !important;
    }
    
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
        margin: 0 !important;
    }
    
    .quick-view-modal .quick-view-content {
        flex-direction: column !important;
        max-width: 100% !important;
        max-height: 95vh !important;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    }
    
    .quick-view-gallery {
        width: 100% !important;
        height: 250px !important;
    }
    
    .quick-view-details {
        width: 100% !important;
        padding: 20px !important;
    }
    
    .qv-title {
        font-size: 1.2rem !important;
    }
    
    .qv-price {
        font-size: 1.3rem !important;
    }
    
    .qv-actions {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .qv-actions .add-to-cart-btn {
        flex: 1 !important;
        min-width: 150px !important;
    }
}

/* ===== FOOTER MOBILE ===== */
@media (max-width: 768px) {
    .main-footer {
        padding: 30px 16px 20px !important;
    }
    
    .footer-content {
        flex-direction: column !important;
        gap: 24px !important;
        text-align: center !important;
    }
    
    .footer-column {
        width: 100% !important;
        text-align: center !important;
    }
    
    .footer-column h3 {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }
    
    .footer-column h3::after {
        margin: 6px auto 0 !important;
    }
    
    .footer-logo {
        justify-content: center !important;
    }
    
    .footer-logo img {
        height: 36px !important;
    }
    
    .social-links {
        justify-content: center !important;
        gap: 12px !important;
    }
    
    .copyright {
        padding-top: 16px !important;
        margin-top: 16px !important;
        font-size: 0.8rem !important;
    }
}

/* ===== SECTIONS MOBILE ===== */
@media (max-width: 768px) {
    .section-header {
        margin-bottom: 24px !important;
        padding: 0 8px !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    .section-subtitle {
        font-size: 0.9rem !important;
    }
    
    .category-icons-section {
        padding: 30px 0 !important;
        overflow: hidden !important;
    }
    
    .category-icons-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px !important;
        padding: 8px 16px !important;
        justify-content: flex-start !important;
    }
    
    .category-icons-grid::-webkit-scrollbar {
        display: none;
    }
    
    .category-icon-item {
        flex: 0 0 auto !important;
        scroll-snap-align: start;
        min-width: 70px !important;
    }
    
    .category-icon-circle {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 6px !important;
    }
    
    .category-icon-label {
        font-size: 10px !important;
        white-space: nowrap !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .feature-card {
        padding: 20px !important;
    }
    
    .feature-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
    }
    
    .feature-card h3 {
        font-size: 1rem !important;
    }
    
    .feature-card p {
        font-size: 0.85rem !important;
    }
    
    .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .category-card {
        height: 160px !important;
    }
    
    .category-card.large {
        height: 200px !important;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .testimonial-card {
        padding: 20px !important;
    }
    
    .newsletter-content {
        flex-direction: column !important;
        text-align: center !important;
        gap: 20px !important;
    }
    
    .newsletter-form .input-group {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .newsletter-form input[type="email"] {
        width: 100% !important;
    }
    
    .newsletter-form button {
        width: 100% !important;
    }
    
    .store-carousel-wrapper {
        padding: 0 12px !important;
    }
    
    .store-carousel {
        gap: 12px !important;
        scroll-snap-type: x mandatory;
    }
    
    .store-card {
        min-width: 220px !important;
        max-width: 220px !important;
        scroll-snap-align: start;
    }
    
    .carousel-nav {
        display: none !important;
    }
}

/* ===== TOUCH DEVICE ENHANCEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    a, button, .btn, input[type="submit"] {
        min-height: 44px;
    }
    
    .product-card:hover,
    .feature-card:hover,
    .store-card:hover {
        transform: none !important;
    }
    
    .btn:active,
    button:active,
    .product-card:active,
    .store-card:active {
        transform: scale(0.98) !important;
        opacity: 0.9 !important;
    }
    
    .category-icons-grid,
    .store-carousel {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
}

/* ===== SAFE AREA SUPPORT ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
    }
    
    .cart-sidebar-footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    }
    
    .mobile-nav-drawer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 812px) and (orientation: landscape) {
    .modern-hero,
    .shop-hero {
        min-height: auto !important;
        padding: 40px 20px !important;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
    }
    
    .hero-buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
    
    .hero-btn {
        width: auto !important;
    }
    
    .quick-view-modal .quick-view-content {
        flex-direction: row !important;
    }
    
    .quick-view-gallery {
        width: 40% !important;
        height: auto !important;
    }
    
    .quick-view-details {
        width: 60% !important;
    }
}

/* ===== VERY SMALL SCREENS ===== */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.6rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.85rem !important;
    }
    
    .hero-btn {
        padding: 12px 20px !important;
        font-size: 12px !important;
    }
    
    .category-icon-circle {
        width: 50px !important;
        height: 50px !important;
    }
    
    .category-icon-label {
        font-size: 9px !important;
    }
    
    .store-card {
        min-width: 180px !important;
        max-width: 180px !important;
    }
    
    .section-title {
        font-size: 1.3rem !important;
    }
    
    .product-image,
    .card-image-modern {
        height: 160px !important;
    }
    
    .product-title,
    .card-title-modern {
        font-size: 0.9rem !important;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.border-primary { border-color: var(--primary); }

.hide-mobile { display: block; }
.show-mobile { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
}

.touch-target {
    min-height: 44px;
    min-width: 44px;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
