/* Accessories Section Styles */

/* Main Accessories Section */
.accessories-main-section {
    margin-top: 2rem;
    margin-bottom: 6rem;
}

/* Categories Container */
.accessories-categories-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Equal width columns that span full width */
    gap: 3rem; /* Gap between categories on large screens */
    margin-top: 2rem;
    align-items: start;
    width: 100%; /* Ensure full width usage */
}

/* Reduce gap on smaller screens */
@media (max-width: 1250px) {
    .accessories-categories-container {
        gap: 1rem; /* Much tighter spacing for better space utilization */
    }
}

/* Individual Category Section */
.accessory-category-section {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow shrinking - prevents content from expanding grid column */
    max-width: 100%; /* Don't exceed grid column boundaries */
    /* No background here - will be applied from header down */
}

/* Category Navigation Styles */
.category-nav-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.nav-up-container {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-nav-bottom {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding: 0.8rem 0;
    min-height: 50px;
    align-items: center;
}

/* Category Content Container */
.category-content {
    display: flex;
    flex-direction: column;
    min-height: auto;
    background: rgba(249, 249, 249, 0.3); /* Background flows from header */
    padding: 1.5rem 1.5rem 0 1.5rem; /* No bottom padding */
    border-radius: 0 0 16px 16px; /* Only round bottom corners */
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background-color 0.3s ease;
}

.nav-arrow {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-family: inherit;
    transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    color: inherit;
    opacity: 0.7;
}

.nav-arrow:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.nav-arrow svg {
    transition: transform 0.2s ease;
}

.nav-arrow:hover svg {
    transform: scale(1.1);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.nav-arrow:disabled:hover {
    background: transparent;
    transform: none;
}

/* Page Dots Indicators */
.page-dots {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
}

.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.page-dot.active {
    background-color: #7CB342;
    transform: scale(1.2);
}

.page-dot:hover {
    background-color: #7CB342;
    opacity: 0.7;
}

/* Note: .accessories-container is defined above with consistent height */

/* Desktop: No animations - instant transitions for better UX */
.accessories-grid {
    transition: none;
}

.accessories-grid.fade-out,
.accessories-grid.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Single Column: Enable smooth animations for single column layout */
@media (max-width: 1000px) {
    .accessories-grid {
        transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
    }
    
    .accessories-grid.fade-out {
        opacity: 0;
        transform: translateY(-5px);
    }
    
    .accessories-grid.fade-in {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove old category styles - now handled by accessory-category-section */

/* Accessories Container - Simplified */
.accessories-container {
    position: relative;
    overflow: visible;
    flex: 1; /* Take available space in category */
}

/* Mobile: Natural height with smooth transitions */
@media (max-width: 768px) {
    .accessories-container {
        /* No min-height - let content determine size naturally */
        transition: height 0.25s ease-in-out;
    }
}

.category-header {
    text-align: center;
    margin-bottom: 0; /* Remove margin to connect with content */
    padding: 1rem 1.2rem;
    border-radius: 12px 12px 0 0; /* Only round top corners */
    background-color: rgba(249, 249, 249, 0.6);
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background-color 0.3s;
}

.category-title {
    font-size: 1.1rem;
    margin: 0;
    color: inherit;
    font-weight: 600;
}

/* Grid Layout - vertical stack in each column */
.accessories-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /* Desktop: No height transition */
    justify-content: flex-start;
}

/* Mobile: Enable height transitions with coordinated timing */
@media (max-width: 768px) {
    .accessories-grid {
        transition: height 0.25s ease-in-out;
    }
}

/* Mobile touch handling - no fixed height */
@media (max-width: 768px) {
    .accessories-grid {
        touch-action: pan-y pinch-zoom;
        overflow: visible;
        /* Removed fixed min-height - let content determine height naturally */
    }
    
    .accessories-container {
        touch-action: pan-y pinch-zoom;
        overflow: visible;
    }
}

/* Individual Accessory Cards - Compact Design */
.accessory-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.6rem;
    height: clamp(90px, auto, none); /* Fluid height with minimum constraint */
}

.accessory-card:hover {
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}

/* Image Container - Fixed Small Size */
.accessory-image-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    border-radius: 6px;
    margin-right: 0.8rem;
}

.accessory-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.accessory-image.hidden {
    display: none;
}

.accessory-image-container:hover .accessory-image {
    transform: scale(1.1);
}

.image-count-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 500;
    line-height: 1;
}

/* Content Area - Horizontal Layout */
.accessory-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* Allow text to shrink */
    justify-content: space-between;
    overflow: hidden; /* Prevent content from expanding container */
}

.accessory-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.2rem 0;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%; /* Take full width of constrained column */
}


.accessory-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 0.2rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Allow 2 lines instead of 1 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.2rem; /* Fixed height for exactly 2 lines (0.85rem * 1.3 * 2 ≈ 2.2rem) */
    flex-shrink: 0; /* Don't shrink */
}

/* Footer with Price and Button - Horizontal */
.accessory-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}

.accessory-price {
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.accessory-btn {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Dark Mode Support */
.dark .category-header {
    background-color: rgba(30, 30, 30, 0.7); /* Dark header flowing into content */
}

.dark .category-content {
    background: rgba(30, 30, 30, 0.4); /* Dark background flowing from header */
}

.dark .accessory-card {
    background-color: var(--dm_2);
}

.dark .accessory-description {
    color: #ccc;
}

.dark .accessory-price {
    color: #fff;
}

.dark .nav-arrow {
    border-color: rgba(255,255,255,0.2);
    color: var(--lm_2);
}

.dark .nav-arrow:hover {
    background-color: rgba(255,255,255,0.1);
}

.dark .page-dot {
    background-color: rgba(255,255,255,0.3);
}

.dark .page-dot.active {
    background-color: var(--glow_color);
}

.dark .page-dot:hover {
    background-color: var(--glow_color);
}

/* Responsive Design - Single column for better readability */
/* Medium screens (601px-1000px): Narrower single column with side margins */
@media (max-width: 1000px) and (min-width: 601px) {
    .accessories-categories-container {
        grid-template-columns: 1fr; /* Single column for better readability */
        gap: 2.5rem; /* Consistent spacing for all small screens */
        max-width: clamp(500px, 70vw, 700px); /* Narrower with responsive width */
        margin: 0 auto; /* Center the narrower layout */
    }
}

/* Small mobile screens (≤600px): Full width single column */
@media (max-width: 600px) {
    .accessories-categories-container {
        grid-template-columns: 1fr; /* Single column for better readability */
        gap: 2.5rem; /* Consistent spacing for all small screens */
    }
    
    .accessory-category-section {
        margin-bottom: 1rem; /* Additional bottom margin for mobile separation */
    }
    
    .category-header {
        padding: 1rem 0.8rem; /* Reduce horizontal padding on mobile */
    }
    
    .category-content {
        padding: 1rem 0.8rem 0 0.8rem; /* No bottom padding on mobile either */
    }
    
    .category-nav-top {
        margin-bottom: 1rem;
    }
    
    .category-nav-bottom {
        margin-top: 1rem;
        padding: 1rem 0;
    }
    
    .accessory-card {
        height: clamp(100px, auto, none); /* Slightly larger minimum for mobile */
        padding: 0.8rem;
    }
    
    .accessory-image-container {
        width: 85px;
        height: 85px;
    }
    
    .accessory-description {
        font-size: 0.9rem;
    }
    
    .accessory-price {
        font-size: 0.95rem;
    }
    
    .accessory-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
    }
    
    /* Mobile Navigation Adjustments */
    .nav-arrow {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .page-dot {
        width: 10px;
        height: 10px;
    }
    
    .nav-up-container {
        height: 44px;
    }
    
    .category-nav-bottom {
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .accessories-categories-container {
        gap: 2rem; /* Slightly smaller gap on very small screens */
    }
    
    .category-header {
        padding: 0.6rem;
    }
    
    .category-title {
        /* Use consistent 1.1rem across all devices */
    }
    
    .accessory-card {
        height: clamp(85px, auto, none); /* Smaller minimum for very small screens */
    }
}