/**
 * Responsive Styles
 * Varied Cozy Shop
 */

/* Base responsive styles */
html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    overflow-x: hidden;
}

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

/* Container responsive adjustments */
.container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Large devices (desktops, 992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Header adjustments */
    .site-header {
        padding: 10px 0;
    }
    
    .header-search {
        width: 300px;
    }
    
    /* Product grid adjustments */
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    /* Footer adjustments */
    .footer-widgets {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    /* Header adjustments */
    .site-header {
        padding: 10px 0;
    }
    
    .header-logo img {
        max-height: 40px;
    }
    
    .header-search {
        width: 100%;
        margin: 10px 0;
    }
    
    .header-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    /* Navigation adjustments */
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Product grid adjustments */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Product page adjustments */
    .product-detail {
        flex-direction: column;
    }
    
    .product-gallery {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .product-info {
        width: 100%;
    }
    
    /* Cart page adjustments */
    .cart-items {
        overflow-x: auto;
    }
    
    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item-details {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Checkout page adjustments */
    .checkout-layout {
        flex-direction: column;
    }
    
    .checkout-main {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .checkout-sidebar {
        width: 100%;
    }
    
    /* Footer adjustments */
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    /* Header adjustments */
    .site-header {
        padding: 10px 0;
    }
    
    .header-container {
        flex-direction: column;
    }
    
    .header-logo {
        margin-bottom: 10px;
    }
    
    .header-logo img {
        max-height: 35px;
    }
    
    .header-search {
        width: 100%;
        margin: 10px 0;
    }
    
    .header-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    /* Navigation adjustments */
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Mobile menu */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100%;
        background-color: var(--color-white);
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .mobile-menu-close {
        font-size: 24px;
        color: var(--color-gray-700);
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .mobile-menu-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-menu-nav li {
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .mobile-menu-nav a {
        display: block;
        padding: 15px;
        color: var(--color-gray-800);
        text-decoration: none;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    /* Hero section adjustments */
    .hero-content {
        padding: 30px 15px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    /* Product grid adjustments */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Product page adjustments */
    .product-detail {
        flex-direction: column;
    }
    
    .product-gallery {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .product-info {
        width: 100%;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    /* Cart page adjustments */
    .cart-items {
        overflow-x: auto;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-item-image {
        margin-bottom: 10px;
    }
    
    .cart-item-details {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .cart-item-price,
    .cart-item-quantity,
    .cart-item-total,
    .cart-item-remove {
        margin-top: 5px;
    }
    
    .cart-summary {
        flex-direction: column;
    }
    
    .cart-totals {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .cart-actions {
        width: 100%;
    }
    
    /* Checkout page adjustments */
    .checkout-layout {
        flex-direction: column;
    }
    
    .checkout-main {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .checkout-sidebar {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .existing-addresses {
        grid-template-columns: 1fr;
    }
    
    /* Order confirmation adjustments */
    .order-info {
        grid-template-columns: 1fr;
    }
    
    .addresses {
        grid-template-columns: 1fr;
    }
    
    /* Account page adjustments */
    .account-layout {
        flex-direction: column;
    }
    
    .account-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .account-content {
        width: 100%;
    }
    
    /* Footer adjustments */
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        margin-top: 10px;
    }
}

/* Utility classes for responsive design */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

@media (min-width: 576px) {
    .d-sm-none {
        display: none !important;
    }
    
    .d-sm-block {
        display: block !important;
    }
    
    .d-sm-flex {
        display: flex !important;
    }
}

@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }
    
    .d-md-block {
        display: block !important;
    }
    
    .d-md-flex {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
    
    .d-lg-block {
        display: block !important;
    }
    
    .d-lg-flex {
        display: flex !important;
    }
}

@media (min-width: 1200px) {
    .d-xl-none {
        display: none !important;
    }
    
    .d-xl-block {
        display: block !important;
    }
    
    .d-xl-flex {
        display: flex !important;
    }
}