/* Global Selections Slides - Responsive Design */

/* ===== BASE RESPONSIVE CARD STYLES ===== */
.responsive-selection-card {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 44px; /* Minimum touch target */
    box-sizing: border-box;
}

.responsive-selection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #b6d7f0;
}

.responsive-selection-card.selected {
    border: 3px solid #1976d2 !important;
    box-shadow: 0 0 15px rgba(25, 118, 210, 0.3) !important;
    background: rgba(25, 118, 210, 0.05) !important;
}

/* ===== COLLECTION CARDS ===== */
.responsive-collection-card {
    position: relative;
    width: 100%;
    max-width: 300px;
    min-width: 250px;
    margin: 0 auto;
}

.collection-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.responsive-collection-card .base-img img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

/* Tighten top padding on smaller screens to reduce white space above cards */
@media (max-width: 1024px) {
    .collection-slide-content {
        padding-top: 4px !important;
    }
}

/* ===== WOOD SPECIES CARDS ===== */
.responsive-wood-card {
    width: 100%;
    max-width: 140px;
    min-width: 100px;
}

.responsive-wood-card .selection-card-image-container {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== DOOR/DRAWER STYLE CARDS ===== */
.responsive-door-card {
    width: 100%;
    max-width: 140px;
    min-width: 110px;
}

.responsive-door-card .selection-card-image-container {
    width: 100px;
    margin: 0 auto;
    border-radius: 6px;
    overflow: visible;
}

/* ===== DISTRESSING/GLAZE CARDS ===== */
.responsive-enhancement-card {
    width: 100%;
    max-width: 220px;
    min-width: 180px;
    position: relative;
    z-index: 1;
}

.responsive-enhancement-card:hover {
    z-index: 999;
    transform: scale(1.02);
}

.responsive-enhancement-card .selection-card-image-container {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    border-radius: 6px;
    overflow: hidden;
}

/* ===== FINISH CARDS (STAIN/PAINT) ===== */
.responsive-finish-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 4px;
    max-width: 400px;
    width: 100%;
}

.responsive-finish-card img {
    width: 100%;
    height: auto;
    border-radius: 7px;
}

/* ===== OVERLAY CARDS ===== */
.responsive-overlay-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.responsive-overlay-section {
    flex: 1;
    text-align: center;
    padding: 16px;
}

.responsive-overlay-section img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* ===== MOBILE STYLES (≤ 480px) ===== */
@media (max-width: 480px) {
    .responsive-selection-card {
        padding: 8px;
        min-height: 60px;
        margin: 4px 0;
    }
    
    .responsive-collection-card {
        min-width: 200px;
        max-width: 280px;
    }
    
    .responsive-collection-card .series-buttons {
        padding: 8px !important;
    }
    
    .responsive-collection-card .mud-button-group {
        flex-direction: column !important;
        gap: 4px;
    }
    
    .responsive-wood-card {
        min-width: 80px;
        max-width: 120px;
    }
    
    .responsive-wood-card .selection-card-image-container {
        width: 60px;
        height: 60px;
    }
    
    .responsive-door-card {
        min-width: 90px;
        max-width: 120px;
    }
    
    .responsive-door-card .selection-card-image-container {
        width: 80px;
    }
    
    .responsive-enhancement-card {
        min-width: 140px;
        max-width: 180px;
    }
    
    .responsive-enhancement-card .selection-card-image-container {
        max-width: 160px;
    }
    
    .responsive-finish-card {
        max-width: 300px;
    }
    
    .carousel-slide-container {
        padding-bottom: 60px;
    }
    
    /* Stack overlay sections vertically on mobile */
    .responsive-overlay-layout {
        flex-direction: column;
        gap: 16px;
    }
    
    .responsive-overlay-section {
        padding: 8px;
    }
}

/* ===== TABLET STYLES (481px - 768px) ===== */
@media (min-width: 481px) and (max-width: 768px) {
    .responsive-selection-card {
        padding: 10px;
        min-height: 50px;
    }
    
    .responsive-collection-card {
        min-width: 220px;
        max-width: 280px;
    }
    
    .responsive-wood-card {
        min-width: 100px;
        max-width: 130px;
    }
    
    .responsive-wood-card .selection-card-image-container {
        width: 70px;
        height: 70px;
    }
    
    .responsive-door-card {
        min-width: 100px;
        max-width: 130px;
    }
    
    .responsive-door-card .selection-card-image-container {
        width: 90px;
    }
    
    .responsive-enhancement-card {
        min-width: 160px;
        max-width: 200px;
    }
    
    .responsive-finish-card {
        max-width: 350px;
    }
    
    /* Keep overlay sections stacked on tablet portrait */
    .responsive-overlay-layout {
        flex-direction: column;
        gap: 20px;
    }
}

/* ===== LAPTOP STYLES (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .responsive-selection-card {
        padding: 12px;
    }
    
    .responsive-collection-card {
        min-width: 250px;
        max-width: 300px;
    }
    
    .responsive-wood-card {
        min-width: 110px;
        max-width: 140px;
    }
    
    .responsive-door-card {
        min-width: 110px;
        max-width: 140px;
    }
    
    .responsive-enhancement-card {
        min-width: 180px;
        max-width: 220px;
    }
    
    .responsive-finish-card {
        max-width: 380px;
    }
    
    /* Side-by-side layout for overlays on laptop */
    .responsive-overlay-layout {
        flex-direction: row;
        gap: 30px;
    }
    
    .responsive-overlay-section {
        flex: 1;
        min-width: 300px;
    }
}

/* ===== DESKTOP STYLES (> 1024px) ===== */
@media (min-width: 1025px) {
    .responsive-selection-card {
        padding: 12px;
    }
    
    .responsive-collection-card {
        min-width: 280px;
        max-width: 300px;
    }
    
    .responsive-wood-card {
        max-width: 140px;
    }
    
    .responsive-door-card {
        max-width: 140px;
    }
    
    .responsive-enhancement-card {
        max-width: 220px;
    }
    
    .responsive-enhancement-card:hover {
        transform: scale(1.05);
    }
    
    .responsive-finish-card {
        max-width: 400px;
    }
    
    /* Full side-by-side layout for overlays on desktop */
    .responsive-overlay-layout {
        flex-direction: row;
        gap: 40px;
    }
    
    .responsive-overlay-section {
        flex: 1;
        min-width: 400px;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) {
    .responsive-selection-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .responsive-enhancement-card:hover {
        transform: none;
        z-index: 1;
    }
    
    /* Larger touch targets for touch devices */
    .responsive-selection-card {
        min-height: 60px;
        padding: 16px;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .responsive-selection-card {
        border-width: 1px; /* Thinner borders on high DPI */
    }
    
    .responsive-selection-card.selected {
        border-width: 2px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .responsive-selection-card,
    .responsive-enhancement-card {
        transition: none;
    }
    
    .responsive-selection-card:hover,
    .responsive-enhancement-card:hover {
        transform: none;
    }
}

/* ===== UTILITY CLASSES ===== */
.responsive-grid-container {
    width: 100%;
    padding: 0 8px;
}

.responsive-centered-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.responsive-slide-header {
    padding: 8px 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .responsive-slide-header {
        padding: 4px 8px;
        margin-bottom: 8px;
    }
    
    .responsive-slide-header .mud-text {
        font-size: 1rem !important;
    }
}

/* ===== MUDBLAZOR RESPONSIVE OVERRIDES ===== */
@media (max-width: 480px) {
    .mud-grid-item {
        padding: 4px !important;
    }
    
    .mud-button-group .mud-button {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
    
    .mud-chip {
        font-size: 0.7rem !important;
        height: 20px !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .mud-grid-item {
        padding: 6px !important;
    }
    
    .mud-button-group .mud-button {
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
    }
}