/**
 * Comprehensive Responsive Design System
 * Screen Sizes: 320px - 1024px
 * Light, Clean, Professional Theme
 */

:root {
    /* Responsive Breakpoints */
    --mobile-xs: 320px;
    --mobile-sm: 375px;
    --mobile-md: 425px;
    --tablet: 768px;
    --desktop: 1024px;
    
    /* Responsive Spacing */
    --spacing-mobile: 0.75rem;
    --spacing-tablet: 1rem;
    --spacing-desktop: 1.5rem;
    
    /* Touch Target Size */
    --touch-target: 44px;
    
    /* Colors - Light Theme */
    --color-white: #ffffff;
    --color-light: #f8f9fa;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-primary: #4A90A4;
    --color-shadow: rgba(0, 0, 0, 0.1);
}

/* ================================
   RESET & BASE STYLES
   ================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    font-size: 16px;
    line-height: 1.6;
    background: var(--color-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent horizontal scroll */


/* ================================
   RESPONSIVE NAVBAR
   ================================ */

.responsive-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-white);
    box-shadow: 0 2px 8px var(--color-shadow);
    padding: 0.75rem 1rem;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.navbar-logo {
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    position: relative;
    transition: all 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.3s ease;
}

.hamburger-icon::before {
    top: -7px;
}

.hamburger-icon::after {
    bottom: -7px;
}

.hamburger-menu.active .hamburger-icon {
    background: transparent;
}

.hamburger-menu.active .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.hamburger-menu.active .hamburger-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Mobile Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation Drawer */
.nav-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--color-white);
    box-shadow: -2px 0 8px var(--color-shadow);
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 1rem;
}

.nav-drawer.active {
    right: 0;
}

.nav-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-gray-200);
    margin-bottom: 1rem;
}

.nav-drawer-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary);
    padding: 0.25rem;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.nav-drawer-items {
    list-style: none;
}

.nav-drawer-item {
    margin-bottom: 0.5rem;
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-height: var(--touch-target);
}

.nav-drawer-link:hover,
.nav-drawer-link.active {
    background: var(--color-gray-100);
    color: var(--color-primary);
}

.nav-drawer-icon {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

/* Desktop Navigation */
.nav-menu-desktop {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
}

/* Search Bar */
.navbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
}

.navbar-search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 25px;
    font-size: 0.875rem;
}

/* ================================
   RESPONSIVE SIDEBAR (FILTERS)
   ================================ */

.filter-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.filter-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-sidebar-mobile {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--color-white);
    box-shadow: 2px 0 8px var(--color-shadow);
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 999;
    padding: 1rem;
}

.filter-sidebar-mobile.active {
    left: 0;
}

.filter-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-gray-200);
    margin-bottom: 1rem;
}

.filter-sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.filter-sidebar-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary);
    padding: 0.25rem;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.filter-toggle-btn {
    display: none;
    width: 100%;
    padding: 0.75rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
    min-height: var(--touch-target);
}

.filter-toggle-btn i {
    margin-right: 0.5rem;
}

/* Desktop Sidebar */
.sidebar-desktop {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* ================================
   RESPONSIVE PRODUCT GRID
   ================================ */

.product-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
}

/* Mobile: 1 column */
.product-grid {
    grid-template-columns: 1fr;
}

/* Small Mobile: 375px+ : 2 columns */
@media (min-width: 375px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet: 768px+ : 3 columns */
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 1024px+ : 4 columns */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Product Card */
.product-card-responsive {
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: all 0.3s ease;
}

.product-card-responsive:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--color-shadow);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-card-content {
    padding: 1rem;
}

.product-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.product-card-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* ================================
   RESPONSIVE BUTTONS
   ================================ */

.btn-responsive {
    min-height: var(--touch-target);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-responsive:hover {
    transform: translateY(-2px);
}

.btn-primary-responsive {
    background: var(--color-primary);
    color: white;
}

/* ================================
   RESPONSIVE UTILITIES
   ================================ */

/* Hide on Mobile */
.hide-mobile {
    display: none;
}

/* Show on Desktop */
.show-desktop {
    display: none;
}

/* ================================
   RESPONSIVE BREAKPOINTS
   ================================ */

/* Mobile Small: 320px */
@media (max-width: 374px) {
    body {
        font-size: 14px;
    }
    
    .navbar-logo {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Mobile Medium: 375px - 424px */
@media (min-width: 375px) and (max-width: 424px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }
}

/* Mobile Large: 425px - 767px */
@media (min-width: 425px) and (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .hamburger-menu {
        display: none;
    }
    
    .nav-menu-desktop {
        display: flex;
    }
    
    .hide-mobile {
        display: block;
    }
    
    .filter-toggle-btn {
        display: none;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    
    .sidebar-desktop {
        display: block;
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .hamburger-menu {
        display: none;
    }
    
    .nav-menu-desktop {
        display: flex;
    }
    
    .hide-mobile {
        display: block;
    }
    
    .show-desktop {
        display: block;
    }
    
    .filter-toggle-btn {
        display: none;
    }
    
    .filter-sidebar-mobile {
        position: static;
        width: 100%;
        max-width: none;
        box-shadow: none;
        padding: 0;
    }
    
    .filter-sidebar-header {
        display: flex;
    }
    
    .filter-sidebar-close {
        display: none;
    }
    
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile Only Styles */
@media (max-width: 767px) {
    .hamburger-menu {
        display: block;
    }
    
    .nav-menu-desktop {
        display: none;
    }
    
    .filter-toggle-btn {
        display: block;
    }
    
    .sidebar-desktop {
        display: none;
    }
    
    .navbar-search {
        display: none;
    }
}

/* ================================
   SCROLLBAR STYLES
   ================================ */

.nav-drawer::-webkit-scrollbar,
.filter-sidebar-mobile::-webkit-scrollbar {
    width: 6px;
}

.nav-drawer::-webkit-scrollbar-track,
.filter-sidebar-mobile::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

.nav-drawer::-webkit-scrollbar-thumb,
.filter-sidebar-mobile::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 3px;
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideInRight 0.3s ease;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

/* ================================
   SCROLL TO TOP BUTTON
   ================================ */

.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--color-shadow);
    z-index: 997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--color-shadow);
}

.scroll-top-btn:active {
    transform: translateY(-1px);
}

@media (max-width: 767px) {
    .scroll-top-btn {
        width: 44px;
        height: 44px;
        bottom: 15px;
        right: 15px;
        font-size: 1rem;
    }
}

