/**
 * Shop by Collection Section Styles
 * Modern flexbox layout with hover animations
 */

.shop-by-collection {
    padding: 60px 20px;
    background: #f8f9fa;
    max-width: 1200px;
    margin: 0 auto;
}

.shop-by-collection h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

.shop-by-collection h2::after {
    content: '';
    width: 80px;
    height: 3px;
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.collection-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    margin: 0 auto;
    max-width: 1200px;
    grid-template-areas: 
        "bridal party"
        "casual lawn"
        "accessories accessories";
}

.collection-item {
    position: relative;
    min-height: 300px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

/* Grid positioning for each category */
.collection-item.bridal {
    grid-area: bridal;
    min-height: 400px;
}

.collection-item.party-wear {
    grid-area: party;
    min-height: 400px;
}

.collection-item.casual {
    grid-area: casual;
    min-height: 300px;
}

.collection-item.lawn {
    grid-area: lawn;
    min-height: 300px;
}

.collection-item.accessories {
    grid-area: accessories;
    min-height: 250px;
}

.collection-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 30px rgba(255, 255, 255, 0.1);
}

.collection-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.1));
    transition: all 0.4s ease;
    z-index: 1;
}

.collection-item:hover::before {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.05));
}

.collection-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
}

.collection-item:hover .collection-image {
    transform: scale(1.1);
}

.collection-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: 80%;
    padding: 20px;
}

/* Special styling for featured categories */
.collection-item.bridal .collection-title {
    font-size: 2.8rem;
}

.collection-item.bridal .collection-subtitle {
    font-size: 1.2rem;
}

.collection-item.party-wear .collection-title {
    font-size: 2.2rem;
}

.collection-item.party-wear .collection-subtitle {
    font-size: 1rem;
}

.collection-title {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8), 1px 1px 20px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    position: relative;
}

.collection-title::after {
    content: '→';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.collection-item:hover .collection-title::after {
    opacity: 1;
    right: -25px;
}

.collection-item:hover .collection-title {
    transform: scale(1.05);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.collection-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-top: 8px;
    font-weight: 400;
    text-transform: capitalize;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.8), 1px 1px 15px rgba(0, 0, 0, 0.6);
}

.collection-item:hover .collection-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* Background Images for Categories */
.collection-item.bridal {
    background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 
                      url('https://images.unsplash.com/photo-1594736797933-d0501ba2fe65?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1974&q=80');
}

.collection-item.party-wear {
    background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 
                      url('https://images.unsplash.com/photo-1610030469983-98e550d6193c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1910&q=80');
}

.collection-item.casual {
    background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 
                      url('https://images.unsplash.com/photo-1583415292354-587703ff02e5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1974&q=80');
}

.collection-item.lawn {
    background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 
                      url('https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
}

.collection-item.accessories {
    background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 
                      url('https://images.unsplash.com/photo-1515562141207-7a88fb7ce338?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
}

/* Responsive Design */
@media (max-width: 1024px) {
    .collection-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "bridal party"
            "casual lawn"
            "accessories accessories";
    }
    
    .collection-item.bridal,
    .collection-item.party-wear {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .shop-by-collection {
        padding: 40px 15px;
    }
    
    .shop-by-collection h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .collection-grid {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "bridal"
            "party"
            "casual"
            "lawn"
            "accessories";
        gap: 15px;
    }
    
    .collection-item,
    .collection-item.bridal,
    .collection-item.party-wear,
    .collection-item.casual,
    .collection-item.lawn,
    .collection-item.accessories {
        min-height: 250px;
    }
    
    .collection-title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .collection-title::after {
        display: none;
    }
    
    .collection-subtitle {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .shop-by-collection h2 {
        font-size: 1.8rem;
    }
    
    .collection-item {
        min-height: 200px;
    }
    
    .collection-title {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collection-item {
    animation: fadeInUp 0.6s ease forwards;
}

.collection-item:nth-child(1) { animation-delay: 0.1s; }
.collection-item:nth-child(2) { animation-delay: 0.2s; }
.collection-item:nth-child(3) { animation-delay: 0.3s; }
.collection-item:nth-child(4) { animation-delay: 0.4s; }
.collection-item:nth-child(5) { animation-delay: 0.5s; }

/* Accessibility improvements */
.collection-item:focus {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

.collection-item:focus .collection-title {
    transform: scale(1.05);
}

/* Print styles */
@media print {
    .shop-by-collection {
        background: white;
        box-shadow: none;
    }
    
    .collection-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
