/* Shop Page Styles */

/* Shop Filter Header - Based on the provided design */
.shop-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #6D3E25;
    color: white;
    padding: 15px 25px;
    margin-bottom: 30px;
    position: relative; /* Important for absolute positioning of dropdown */
}

.filter-option, .sort-option {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-option i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.sort-option.active i {
    transform: rotate(180deg);
}

/* Make sure sort option has position relative for absolute positioning of dropdown */
.sort-option {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Original product grid with modified spacing for 2 columns */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 60px;
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 15px;
}

.product-item {
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    background-color: none!important;
    flex: 0 0 auto;
    width: 100%;
    
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(107, 52, 0, 0.2);
}

.product-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(45deg, #693208, #5E2900);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 0;
    z-index: 2;
}

.badge-made-to-order {
    background: linear-gradient(45deg, #693208, #5E2900);
    color: white;
}

.add-to-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: white;
    border: 1px solid rgba(107, 52, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.add-to-wishlist.active {
    background-color: white !important;
    color: #333 !important;
    border-color: #ddd !important;
}

.add-to-wishlist.active i {
    color: #333 !important;
}

.product-details {
    padding: 12px 5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-name {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0;
    line-height: 1.3;
    padding: 5px 0;
}

.product-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-price {
    font-family: 'Lato', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #888 !important;
}

/* Sort Dropdown Menu */
.sort-dropdown {
    position: absolute;
    top: 100%; /* Position right below the sort option */
    right: 25px; /* Match the padding of the header */
    width: 200px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000; /* High z-index to stay on top */
    display: none;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    margin-top: 5px; /* Small gap from the button */
    transition: all 0.3s ease;
}

.sort-dropdown.active {
    display: block;
}

.sort-dropdown-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
}

.sort-dropdown-option:hover {
    background-color: #f9f9f9;
    color: #B08F4C;
    padding-left: 18px; /* Slight indent on hover */
}

.sort-dropdown-option:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* Adding .active state for the sort dropdown option */
.sort-dropdown-option.active {
    background-color: #f5f5f5;
    color: #B08F4C;
    font-weight: 600;
    padding-left: 18px; /* Keeps the indent for active item */
}

/* Filter Modal */
.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000; /* Higher z-index to ensure it's above everything */
    display: none;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.filter-modal.active {
    display: flex;
}

.filter-modal-content {
    background-color: white;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 5px;
}

.filter-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    margin: 0;
}

.close-filter-modal {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
}

.filter-modal-body {
    padding: 20px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.filter-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.apply-filter-btn, .clear-filter-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.apply-filter-btn {
    background-color: #6D3E25;
    color: white;
}

.clear-filter-btn {
    background-color: #f5f5f5;
    color: #333;
}

/* Filter Animation */
.product-item.hidden {
    display: none;
}

.product-item.visible {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message for Limited Products */
.more-products-message {
    grid-column: 1 / -1;
    padding: 20px;
    margin-top: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    animation: fadeIn 0.5s ease forwards;
}

.more-products-message p {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.show-all-btn {
    background-color: #6D3E25;
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.show-all-btn:hover {
    background-color: #5d341f;
}

/* Newsletter Section */
.newsletter-section {
    background-color: #f9f9f9;
    padding: 60px 0;
    margin-top: 40px;
}

.newsletter-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #333;
    margin-bottom: 15px;
}

.newsletter-content p {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-right: none;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
}

.newsletter-form button {
    padding: 12px 25px;
    background-color: #6D3E25;
    color: white;
    border: none;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #5d341f;
}

/* Responsive Styles */
@media (min-width: 992px) {
    .products-grid {
        padding: 0 30px;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 500px));
        justify-content: center;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 10px;
    }
    
    .product-image {
        height: 250px; /* Slightly smaller images on mobile */
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        border-right: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .newsletter-form button {
        border-radius: 4px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 5px;
    }
    
    .product-image {
        height: 200px; /* Even smaller images on small mobile */
    }
    
    .product-name {
        font-size: 14px;
    }
    
    .current-price {
        font-size: 15px;
    }
}