/* --- CSS Variables for Color Palette REFINEMENT --- */
:root {
    --action-color: #A2AF9B;            /* Muted Green - ACTION COLOR */
    --action-hover: #8fa085;           /* Slightly Darker Green for hover */
    --price-color: #7b9074;            /* Darker Green for Prices */
    --main-bg: #FAF9EE;                /* Light Cream - main background */
    --section-bg: #DCCFC0;             /* Soft Beige - sections & highlights */
    --ui-details: #EEEEEE;             /* Very Light Gray - borders & details */
    --text-color: #333333;             /* Dark Gray - primary text */
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
    --promo-bg: #2c5530;               /* Dark green for promo banner */
    --promo-accent: #ffd700;           /* Gold for promo code */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--main-bg);
}

/* Promotional Banner */
.promo-banner {
    position: static;
    width: 100%;
    background: var(--promo-bg);
    color: var(--white);
    padding: 8px 0;
    z-index: 1001;
    box-shadow: 0 2px 10px var(--shadow);
    animation: slideDown 0.5s ease;
}

.promo-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px 0 20px;
    position: relative;
}

.promo-text {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    flex-shrink: 1;
}

.promo-code {
    background: none;
    color: var(--white);
    padding: 0;
    border: none;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    white-space: nowrap;
    text-decoration: underline;
    cursor: pointer;
}

.promo-signup-btn {
    background: none;
    color: var(--white);
    border: none;
    padding: 0;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    text-decoration: underline;
}

.promo-signup-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.promo-close {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.promo-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Animation for banner */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Hide banner class */
.promo-banner.hidden {
    display: none;
}

/* Adjust body padding when banner is hidden */
body.no-promo-banner {
    padding-top: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    gap: 2rem;
}

.logo {
    font-family: 'Sankofa Display', cursive;
    font-size: 1.9rem;
    font-weight: bold;
    color: var(--action-color);
    margin: 0;
    letter-spacing: 1px;
}

/* Navigation Icons */
.nav-icons {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: auto;
}

/* Search Icon Container */
.search-icon-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-icon:hover {
    background-color: var(--section-bg);
    color: var(--action-color);
}

.search-input-expandable {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: var(--white);
    border-radius: 20px;
    border: 2px solid var(--ui-details);
}

.search-icon-container:hover .search-input-expandable {
    width: 250px;
    opacity: 1;
}

.search-input-hidden {
    width: 100%;
    padding: 8px 16px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
}

/* Cart Icon */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    background-color: var(--section-bg);
    color: var(--action-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--action-color);
    color: var(--white);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Account Icon */
.account-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.account-icon:hover {
    background-color: var(--section-bg);
    color: var(--action-color);
}

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

/* Filters Sidebar */
.filters-sidebar {
    background-color: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px var(--shadow);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ui-details);
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 0;
    font-weight: bold;
}

.clear-filters {
    background: none;
    border: 1px solid var(--action-color);
    color: var(--action-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background-color: var(--action-color);
    color: var(--white);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h4 {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.category-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 0;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.category-option:hover {
    color: var(--action-color);
}

.category-option input[type="radio"] {
    accent-color: var(--action-color);
    margin: 0;
}

/* Price Range Filter */
.price-range {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.price-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--ui-details);
    border-radius: 5px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.price-input:focus {
    border-color: var(--action-color);
}

.apply-price {
    background-color: var(--action-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.apply-price:hover {
    background-color: var(--action-hover);
}

/* Sort Options */
.sort-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 0;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.sort-option:hover {
    color: var(--action-color);
}

.sort-option input[type="radio"] {
    accent-color: var(--action-color);
    margin: 0;
}

/* Content Area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Filters Section */
.filters-section {
    background-color: var(--section-bg);
    padding: 1.5rem;
    border-radius: 10px;
}

.filters-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: bold;
    color: var(--text-color);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--ui-details);
    border-radius: 5px;
    background-color: var(--white);
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--action-color);
}

.results-info {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--action-color);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Product Card */
.product-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid var(--ui-details);
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.product-category {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--price-color);
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-primary {
    background-color: var(--action-color);
    color: var(--white);
    flex: 1;
}

.btn-primary:hover {
    background-color: var(--action-hover);
}

.btn-secondary {
    background-color: var(--section-bg);
    color: var(--text-color);
    border: 1px solid var(--ui-details);
}

.btn-secondary:hover {
    background-color: var(--ui-details);
}

/* Modal Styles */
.cart-modal, .product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.cart-modal.active, .product-modal.active {
    display: flex;
}

.cart-modal-content, .product-modal-content {
    background-color: var(--white);
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--ui-details);
    background-color: var(--section-bg);
}

.close-cart, .close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-items {
    padding: 1.5rem;
    min-height: 200px;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--ui-details);
    background-color: var(--section-bg);
}

.cart-total {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--action-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.checkout-btn:hover {
    background-color: var(--action-hover);
}

/* Footer */
.footer {
    background-color: var(--section-bg);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--ui-details);
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--action-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Promo Banner Mobile */
    .promo-content {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0 40px 0 15px;
        justify-content: center;
    }
    
    .promo-text {
        font-size: 0.75rem;
        order: 1;
        width: 100%;
        margin-bottom: 2px;
    }
    
    .promo-code {
        font-size: 0.8rem;
    }
    
    .promo-signup-btn {
        font-size: 0.8rem;
    }
    
    .promo-close {
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.2rem;
        width: 25px;
        height: 25px;
    }
    
    .header-content {
        justify-content: space-between;
    }
    
    .nav-icons {
        gap: 1rem;
    }
    
    .search-icon-container:hover .search-input-expandable {
        width: 200px;
    }
    
    /* Main Layout Mobile */
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-sidebar {
        order: 2;
        position: static;
        margin-top: 1rem;
    }
    
    .content-area {
        order: 1;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .price-inputs {
        justify-content: center;
    }
    
    .price-input {
        width: 60px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-modal-content, .product-modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Cart Item Styles */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--ui-details);
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--ui-details);
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    overflow: hidden;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--ui-details);
    background-color: var(--white);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.quantity-btn:hover {
    background-color: var(--section-bg);
}

.quantity {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.remove-item {
    background-color: #dc3545;
    color: var(--white);
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-item:hover {
    background-color: #c82333;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Product Details Modal */
.product-modal-content {
    max-width: 800px;
}

.product-details {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.product-detail-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--ui-details);
}

.product-detail-info {
    flex: 1;
}

.product-detail-info h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.product-detail-category {
    color: #666;
    text-transform: capitalize;
    margin-bottom: 0.5rem;
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--price-color);
    margin-bottom: 1rem;
}

.product-description {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.product-rating {
    margin-bottom: 1.5rem;
    color: #666;
}

.add-to-cart-modal {
    width: 100%;
    padding: 12px 24px;
}

/* Error and No Products */
.error-message, .no-products {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #666;
    grid-column: 1 / -1;
}

.error-message {
    color: #dc3545;
}

/* Notification Animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-notification {
    animation: slideIn 0.3s ease;
}

/* Mobile Product Details */
@media (max-width: 768px) {
    .product-details {
        flex-direction: column;
        padding: 1rem;
    }
    
    .product-detail-image {
        width: 100%;
        height: 250px;
        align-self: center;
    }
    
    .cart-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .cart-item-details {
        min-width: 200px;
    }
}