/**
 * Kidzora Store - Comprehensive Responsive Design
 * Complete mobile & desktop optimization
 * Breakpoints: 375px, 480px, 768px, 1024px, 1440px, 1920px
 */

/* ===== CSS VARIABLES ===== */
:root {
    --min-touch-target: 44px;
    --container-padding-mobile: 16px;
    --container-padding-tablet: 24px;
    --container-padding-desktop: 40px;
}

/* ===== BASE RESPONSIVE FIXES ===== */

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Base container */
.container,
.cart-container,
.checkout-container,
.product-container,
.shop-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* ===== TOUCH TARGETS (44x44px minimum) ===== */
@media (pointer: coarse) {
    button,
    .btn,
    a.btn,
    input[type="submit"],
    input[type="button"],
    .variant-option,
    .payment-method,
    .cart-quantity button,
    .thumbnail,
    .cart-remove,
    .nav-link,
    .mobile-menu-item {
        min-height: var(--min-touch-target);
        min-width: var(--min-touch-target);
    }
    
    /* Larger tap areas for small buttons */
    .cart-quantity button {
        width: 44px;
        height: 44px;
    }
    
    .thumbnail {
        min-width: 60px;
        min-height: 60px;
    }
}

/* ===== FORM ELEMENTS - iOS ZOOM PREVENTION ===== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea,
.checkout-input,
.checkout-select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
}

/* =====================================================
   LARGE DESKTOP (1920px+)
   ===================================================== */
@media (min-width: 1920px) {
    .cart-container,
    .checkout-container,
    .product-container {
        max-width: 1600px;
    }
    
    .cart-layout {
        grid-template-columns: 1fr 450px;
        gap: 60px;
    }
    
    .checkout-layout {
        grid-template-columns: 1fr 480px;
        gap: 60px;
    }
    
    .product-grid {
        grid-template-columns: 600px 1fr;
        gap: 60px;
    }
    
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 30px;
    }
}

/* =====================================================
   STANDARD DESKTOP (1440px)
   ===================================================== */
@media (min-width: 1440px) and (max-width: 1919px) {
    .cart-container,
    .checkout-container,
    .product-container {
        max-width: 1400px;
        padding: 40px var(--container-padding-desktop);
    }
    
    .cart-layout {
        grid-template-columns: 1fr 400px;
        gap: 50px;
    }
    
    .checkout-layout {
        grid-template-columns: 1fr 440px;
        gap: 50px;
    }
    
    .product-grid {
        grid-template-columns: 550px 1fr;
        gap: 50px;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

/* =====================================================
   SMALL DESKTOP / LARGE TABLET (1024px - 1439px)
   ===================================================== */
@media (min-width: 1024px) and (max-width: 1439px) {
    .cart-container,
    .checkout-container,
    .product-container {
        max-width: 1200px;
        padding: 30px var(--container-padding-tablet);
    }
    
    .cart-layout {
        grid-template-columns: 1fr 360px;
        gap: 40px;
    }
    
    .checkout-layout {
        grid-template-columns: 1fr 380px;
        gap: 40px;
    }
    
    .product-grid {
        grid-template-columns: 480px 1fr;
        gap: 40px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =====================================================
   TABLET (768px - 1023px)
   ===================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .cart-container,
    .checkout-container,
    .product-container {
        padding: 25px var(--container-padding-tablet);
    }
    
    /* Cart Page */
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .cart-summary {
        position: relative;
        top: auto;
    }
    
    .cart-items-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 100px 1fr auto;
        gap: 20px;
        position: relative;
    }
    
    .cart-price {
        display: none;
    }
    
    .cart-quantity {
        grid-column: 2;
        grid-row: 2;
    }
    
    .cart-subtotal {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
    }
    
    .cart-remove {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    
    /* Checkout Page */
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .checkout-summary {
        position: relative;
        top: auto;
        order: 2;
    }
    
    .checkout-form-section {
        order: 1;
    }
    
    .checkout-form-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    /* Product Page */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .product-gallery {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .main-image img {
        max-height: 500px;
    }
    
    .thumbnail-grid {
        justify-content: center;
    }
    
    /* Shop Grid */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Checkout Steps */
    .checkout-steps {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .checkout-step {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* =====================================================
   LARGE MOBILE (481px - 767px)
   ===================================================== */
@media (min-width: 481px) and (max-width: 767px) {
    .cart-container,
    .checkout-container,
    .product-container {
        padding: 20px var(--container-padding-mobile);
    }
    
    /* Typography */
    .cart-title,
    .checkout-title {
        font-size: 28px;
    }
    
    .cart-summary-title,
    .checkout-section-title {
        font-size: 20px;
    }
    
    /* Cart Page */
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .cart-items-section {
        padding: 20px;
        border-radius: 16px;
    }
    
    .cart-items-header {
        display: none;
    }
    
    .cart-item {
        display: grid;
        grid-template-columns: 90px 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px 15px;
        position: relative;
        padding: 20px 0;
    }
    
    .cart-product {
        grid-column: 1 / -1;
        display: flex;
        gap: 15px;
    }
    
    .cart-product-image {
        width: 90px;
        height: 90px;
    }
    
    .cart-price {
        display: none;
    }
    
    .cart-quantity {
        grid-column: 1;
        grid-row: 2;
    }
    
    .cart-subtotal {
        grid-column: 2;
        grid-row: 2;
        text-align: right;
        font-size: 18px;
    }
    
    .cart-remove {
        position: absolute;
        right: 0;
        top: 20px;
        width: 36px;
        height: 36px;
    }
    
    .cart-summary {
        padding: 25px;
        border-radius: 16px;
    }
    
    /* Checkout Page */
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .checkout-form-section {
        padding: 25px 20px;
        border-radius: 16px;
    }
    
    .checkout-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .checkout-steps {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .checkout-step {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 20px !important;
    }
    
    .checkout-step:first-child,
    .checkout-step:last-child {
        border-radius: 20px !important;
    }
    
    .payment-method {
        padding: 15px;
    }
    
    .checkout-summary {
        padding: 25px;
        border-radius: 16px;
    }
    
    /* Product Page */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .main-image {
        border-radius: 16px;
    }
    
    .main-image img {
        max-height: 400px;
    }
    
    .thumbnail-grid {
        gap: 10px;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .thumbnail {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .price-current {
        font-size: 26px;
    }
    
    .variant-options {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .variant-option {
        padding: 12px 16px;
        min-height: var(--min-touch-target);
    }
    
    .quantity-selector {
        width: 100%;
        max-width: 160px;
    }
    
    .add-to-cart-section {
        flex-direction: column;
        gap: 12px;
    }
    
    .add-to-cart-btn,
    .buy-now-btn {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        min-height: 52px;
    }
    
    /* Shop Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-card-image {
        height: 200px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Related Products */
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* =====================================================
   MOBILE (375px - 480px)
   ===================================================== */
@media (max-width: 480px) {
    .cart-container,
    .checkout-container,
    .product-container {
        padding: 15px var(--container-padding-mobile);
    }
    
    /* Typography */
    .cart-title,
    .checkout-title {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .cart-subtitle {
        font-size: 14px;
        margin-bottom: 25px;
    }
    
    .cart-summary-title,
    .checkout-section-title {
        font-size: 18px;
    }
    
    /* Breadcrumb */
    .cart-breadcrumb,
    .checkout-breadcrumb {
        font-size: 12px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }
    
    /* Cart Page */
    .cart-page {
        padding: 20px 0 60px;
    }
    
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-items-section {
        padding: 16px;
        border-radius: 14px;
        margin: 0 -2px;
    }
    
    .cart-items-header {
        display: none;
    }
    
    .cart-item {
        display: flex;
        flex-direction: column;
        gap: 15px;
        position: relative;
        padding: 20px 0;
    }
    
    .cart-product {
        display: flex;
        gap: 15px;
        width: 100%;
    }
    
    .cart-product-image {
        width: 80px;
        height: 80px;
        border-radius: 12px;
        flex-shrink: 0;
    }
    
    .cart-product-info {
        flex: 1;
        min-width: 0;
    }
    
    .cart-product-info h3 {
        font-size: 14px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        padding-right: 35px;
    }
    
    .cart-price {
        display: none;
    }
    
    .cart-item-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .cart-quantity {
        display: flex;
    }
    
    .cart-quantity button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .cart-quantity input {
        width: 50px;
        height: 40px;
        font-size: 15px;
    }
    
    .cart-subtotal {
        font-size: 16px;
        font-weight: 700;
    }
    
    .cart-remove {
        position: absolute;
        right: 0;
        top: 20px;
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .cart-summary {
        padding: 20px;
        border-radius: 14px;
    }
    
    .cart-summary-row {
        font-size: 14px;
    }
    
    .cart-total-row {
        font-size: 18px;
        padding-top: 15px;
        margin-top: 15px;
    }
    
    .checkout-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 15px;
        min-height: 52px;
    }
    
    /* Checkout Page */
    .checkout-page {
        padding: 20px 0 60px;
    }
    
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .checkout-steps {
        display: flex;
        gap: 0;
        margin-bottom: 25px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    .checkout-step {
        padding: 10px 12px;
        font-size: 11px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .checkout-step-number {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .checkout-step-text {
        display: none;
    }
    
    .checkout-step::after {
        content: attr(data-step);
    }
    
    .checkout-form-section {
        padding: 20px 16px;
        border-radius: 14px;
    }
    
    .checkout-section-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .checkout-section-title svg {
        width: 20px;
        height: 20px;
    }
    
    .checkout-form-group {
        margin-bottom: 16px;
    }
    
    .checkout-form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .checkout-label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .checkout-input,
    .checkout-select {
        padding: 14px 16px;
        border-radius: 10px;
        font-size: 16px;
    }
    
    .checkout-divider {
        margin: 25px 0;
    }
    
    /* Pincode Check Row */
    .pincode-row {
        display: flex;
        gap: 10px;
    }
    
    .pincode-row .checkout-input {
        flex: 1;
    }
    
    .pincode-check-btn {
        padding: 14px 20px;
        white-space: nowrap;
        min-height: var(--min-touch-target);
    }
    
    .pincode-status {
        font-size: 13px;
        padding: 12px 14px;
        margin-top: 10px;
    }
    
    /* Payment Methods */
    .payment-methods {
        gap: 10px;
    }
    
    .payment-method {
        padding: 14px 16px;
        border-radius: 10px;
        min-height: 60px;
    }
    
    .payment-radio {
        width: 20px;
        height: 20px;
    }
    
    .payment-radio::after {
        width: 10px;
        height: 10px;
    }
    
    .payment-name {
        font-size: 14px;
    }
    
    .payment-desc {
        font-size: 11px;
    }
    
    .payment-icon {
        font-size: 24px;
    }
    
    /* Order Notes */
    .checkout-textarea {
        min-height: 100px;
        font-size: 16px;
        padding: 14px 16px;
    }
    
    /* Order Summary Sidebar */
    .checkout-summary {
        padding: 20px 16px;
        border-radius: 14px;
        position: relative;
        top: auto;
    }
    
    .summary-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .summary-items {
        max-height: none;
    }
    
    .summary-item {
        padding: 12px 0;
    }
    
    .summary-item-image {
        width: 60px;
        height: 60px;
    }
    
    .summary-item-name {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .summary-item-price {
        font-size: 14px;
    }
    
    .summary-row {
        font-size: 14px;
        padding: 10px 0;
    }
    
    .summary-total {
        font-size: 18px;
        padding-top: 15px;
    }
    
    .place-order-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 15px;
        min-height: 52px;
        margin-top: 20px;
    }
    
    /* Product Page */
    .product-page {
        padding: 0 0 60px;
    }
    
    .breadcrumb {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .product-container {
        padding: 15px 16px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Product Gallery - Touch Friendly - PROPER MOBILE FIX */
    .product-gallery {
        position: relative;
        width: 100%;
    }
    
    .main-image {
        border-radius: 16px;
        margin-bottom: 14px;
        touch-action: pan-y pinch-zoom;
        background: #f8f8f8;
        overflow: hidden;
    }
    
    .main-image img {
        width: 100%;
        height: auto;
        max-height: 450px;
        object-fit: contain;
        object-position: center;
        display: block;
    }
    
    .thumbnail-grid {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding: 8px 4px 16px;
        margin: 0 -4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .thumbnail-grid::-webkit-scrollbar {
        display: none;
    }
    
    .thumbnail {
        width: 65px;
        height: 65px;
        min-width: 65px;
        border-radius: 12px;
        flex-shrink: 0;
        scroll-snap-align: start;
        border: 2px solid #e8e8e8;
        overflow: hidden;
    }
    
    .thumbnail.active {
        border-color: var(--sage-green, #7EB5A6);
    }
    
    /* Swipe Indicator */
    .swipe-indicator {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
    }
    
    .swipe-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #e0e0e0;
        transition: all 0.2s ease;
    }
    
    .swipe-dot.active {
        background: var(--sage-green, #7EB5A6);
        width: 20px;
        border-radius: 4px;
    }
    
    /* Product Info */
    .product-info {
        padding: 0;
    }
    
    .product-badges {
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }
    
    .badge {
        padding: 6px 12px;
        font-size: 11px;
        font-weight: 700;
    }
    
    .product-category-link {
        font-size: 11px;
    }
    
    .product-title {
        font-size: 20px;
        margin-bottom: 12px;
        line-height: 1.35;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .product-price-box {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }
    
    .price-current {
        font-size: 26px;
        font-weight: 700;
    }
    
    .price-original {
        font-size: 16px;
    }
    
    .price-savings {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .product-description {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 20px;
    }
    
    /* Variants */
    .variant-section {
        margin-bottom: 16px;
    }
    
    .variant-label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .variant-options {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .variant-option {
        padding: 10px 14px;
        font-size: 13px;
        min-height: var(--min-touch-target);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Quantity */
    .quantity-section {
        margin-bottom: 20px;
    }
    
    .quantity-label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .quantity-selector {
        width: 140px;
        height: 48px;
    }
    
    .quantity-selector button {
        width: 44px;
        height: 48px;
        font-size: 18px;
    }
    
    .quantity-selector input {
        width: 52px;
        height: 48px;
        font-size: 16px;
    }
    
    /* Action Buttons */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .add-to-cart-btn,
    .buy-now-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 15px;
        min-height: 52px;
        justify-content: center;
        border-radius: 12px;
    }
    
    .add-to-cart-btn {
        background: var(--sage-green, #7EB5A6);
        color: white;
        border: none;
    }
    
    .buy-now-btn {
        background: transparent;
        color: var(--sage-green, #7EB5A6);
        border: 2px solid var(--sage-green, #7EB5A6);
    }
    
    /* Product Features */
    .product-features {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    .feature-item {
        padding: 10px 0;
        font-size: 13px;
    }
    
    .feature-icon {
        font-size: 18px;
    }
    
    /* Product Tabs */
    .product-tabs {
        margin-top: 30px;
    }
    
    .tab-buttons {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        border-bottom: 2px solid #f0f0f0;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: var(--min-touch-target);
    }
    
    .tab-content {
        padding: 20px 0;
        font-size: 14px;
        line-height: 1.7;
    }
    
    /* Related Products */
    .related-section {
        margin-top: 40px;
    }
    
    .related-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .related-products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .related-product-card {
        border-radius: 12px;
    }
    
    .related-product-image {
        height: 140px;
        border-radius: 12px 12px 0 0;
    }
    
    .related-product-info {
        padding: 12px;
    }
    
    .related-product-name {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .related-product-price {
        font-size: 15px;
    }
    
    /* Shop Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-card-image {
        height: 160px;
    }
    
    .product-card-info {
        padding: 12px;
    }
    
    .product-card-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-height: 1.4;
        margin-bottom: 6px;
    }
    
    .product-card-price {
        font-size: 15px;
    }
    
    .product-card-compare {
        font-size: 12px;
    }
    
    .product-card-discount {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .category-image {
        height: 120px;
    }
    
    .category-name {
        font-size: 14px;
    }
    
    .category-count {
        font-size: 12px;
    }
}

/* =====================================================
   EXTRA SMALL MOBILE (< 375px)
   ===================================================== */
@media (max-width: 374px) {
    .cart-container,
    .checkout-container,
    .product-container {
        padding: 12px;
    }
    
    .cart-title,
    .checkout-title {
        font-size: 22px;
    }
    
    .cart-items-section,
    .checkout-form-section,
    .cart-summary,
    .checkout-summary {
        padding: 14px;
        border-radius: 12px;
    }
    
    .cart-product-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-product-info h3 {
        font-size: 13px;
    }
    
    .cart-quantity button {
        width: 36px;
        height: 36px;
    }
    
    .cart-quantity input {
        width: 40px;
        height: 36px;
    }
    
    .checkout-input,
    .checkout-select {
        padding: 12px 14px;
    }
    
    .payment-method {
        padding: 12px 14px;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    .price-current {
        font-size: 22px;
    }
    
    .products-grid {
        gap: 10px;
    }
    
    .product-card-image {
        height: 140px;
    }
    
    .product-card-info {
        padding: 10px;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 896px) and (orientation: landscape) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .main-image img {
        max-height: 50vh;
    }
    
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr 280px;
    }
}

/* ===== STICKY MOBILE CHECKOUT BUTTON ===== */
@media (max-width: 768px) {
    .mobile-checkout-sticky {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 16px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        z-index: 100;
        display: flex;
        gap: 12px;
        align-items: center;
    }
    
    .mobile-checkout-total {
        flex: 1;
    }
    
    .mobile-checkout-total-label {
        font-size: 12px;
        color: #718096;
    }
    
    .mobile-checkout-total-value {
        font-size: 20px;
        font-weight: 700;
        color: #2d3748;
    }
    
    .mobile-checkout-btn {
        flex: 1;
        padding: 16px 24px;
        min-height: 52px;
    }
    
    /* Add padding at bottom to account for sticky button */
    .cart-page,
    .checkout-page,
    .product-page {
        padding-bottom: 100px;
    }
}

/* ===== LOADING STATES ===== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== SAFE AREA INSETS (iPhone X+) ===== */
@supports (padding: max(0px)) {
    .cart-page,
    .checkout-page,
    .product-page {
        padding-bottom: max(60px, env(safe-area-inset-bottom));
    }
    
    .mobile-checkout-sticky {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .cart-page,
    .checkout-page {
        padding: 0;
    }
    
    .cart-summary,
    .checkout-summary {
        box-shadow: none;
        border: 1px solid #e0e0e0;
    }
    
    .checkout-btn,
    .place-order-btn,
    .mobile-checkout-sticky {
        display: none;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .checkout-input,
    .checkout-select,
    .cart-quantity input {
        border-width: 3px;
    }
    
    .payment-method.selected {
        border-width: 3px;
    }
}

/* ===== DARK MODE SUPPORT (Future) ===== */
@media (prefers-color-scheme: dark) {
    /* Placeholder for future dark mode support */
}
