/* Color Palette & Global Styles */
:root {
    --primary-dark: #000000;
    --text-light: #ECF0F1;
    --secondary-light: #F8F9FA;
    --card-bg: #FFFFFF;
    --accent-red: #E74C3C;
    --text-dark: #000000;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --remove-button-bg: #ccc;
    --remove-button-hover-bg: #999;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-light);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header Styling */
header {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 4px 10px var(--shadow-medium);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8em;
    margin-bottom: 0.4rem;
    letter-spacing: 1px;
}

header p {
    font-size: 1em;
    opacity: 0.85;
}

/* AdSense Ad Styling */
.ad-container {
    margin: 2rem auto;
    max-width: 1200px;
    text-align: center;
}

.ad-header-banner {
    padding: 1rem 0;
    background-color: var(--card-bg);
}

.ad-in-feed {
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-light);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex-grow: 1;
}

/* Tab Navigation */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-light);
    overflow: hidden;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0.5rem;
    gap: 0.5rem;
}

.tab-button {
    padding: 1rem 1.5rem;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 48%;
    min-width: 200px;
    max-width: 350px;
    text-align: center;
    border-radius: 8px;
}

.tab-button:hover {
    background-color: var(--secondary-light);
}

.tab-button.active {
    background-color: var(--primary-dark);
    color: var(--text-light);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Selection Panel (Dropdowns) - Browse Products */
.selection-panel {
    background-color: var(--card-bg);
    padding: 1.8rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-light);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    min-width: 180px;
    max-width: 250px;
}

.dropdown-group label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--primary-dark);
    font-size: 0.95em;
}

.dropdown-group select {
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--primary-dark);
    border-radius: 8px;
    background-color: var(--secondary-light);
    color: var(--text-dark);
    font-size: 0.9em;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232C3E50%22%20d%3D%22M287%20197.3l-11.4-11.4c-3.1-3.1-8.2-3.1-11.4%200l-123.6%20123.6L20.4%20185.9c-3.1-3.1-8.2-3.1-11.4%200L-3%20197.3c-3.1%203.1-3.1%208.2%200%2011.4l146.4%20146.4c3.1%203.1%208.2%203.1%2011.4%200L287%20197.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 0.8em top 50%;
    background-size: 0.6em auto, 100%;
    transition: all 0.3s ease;
}

.dropdown-group select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25);
}

.dropdown-group select:disabled {
    background-color: #EFEFEF;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Product Cards Container (3 per row) */
.product-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 1rem 0;
    justify-content: center;
    text-align: center;
    font-size: 1.1em;
    color: #888;
    min-height: 200px;
    align-items: flex-start;
}

.initial-message {
    grid-column: 1 / -1;
    color: #888;
    text-align: center;
}

/* Product Card Styling */
.product-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 6px 20px var(--shadow-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    position: relative;
    border: 1px solid #e0e0e0;
    height: 480px;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 30px var(--shadow-medium);
}

.product-card-image {
    width: 100%;
    height: 60%;
    overflow: hidden;
    border-bottom: 1px solid var(--secondary-light);
    position: relative;
    background-color: #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: brightness(0.95);
}

.product-card:hover .product-card-image img {
    transform: scale(1.08);
    filter: brightness(1);
}

.product-card-content {
    padding: 1rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 40%;
}

.product-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4em;
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 0.6rem;
}

.product-card p {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 1rem;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.shop-button {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    background-color: var(--accent-red);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
    margin-top: auto;
}

.shop-button:hover {
    background-color: #C0392B;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

/* Wishlist Button on Card */
.wishlist-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em;
    color: #ccc;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.wishlist-button:hover {
    color: var(--accent-red);
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.wishlist-button.active {
    color: var(--accent-red);
}

/* Remove Button for Wishlist Tab */
.remove-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--remove-button-bg);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-light);
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.remove-button:hover {
    background-color: var(--remove-button-hover-bg);
    transform: scale(1.1);
}

/* Footer Styling */
footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    text-align: center;
    padding: 1.2rem 0;
    margin-top: 3rem;
    font-size: 0.85em;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header {
        padding: 1rem 0;
    }

    header h1 {
        font-size: 2em;
        margin-bottom: 0.2rem;
    }

    header p {
        font-size: 0.8em;
    }
    
    .container {
        padding: 0 0.8rem;
    }

    .selection-panel {
        padding: 1rem;
    }

    .dropdown-group {
        width: 100%;
        max-width: none;
    }

    .dropdown-group select {
        font-size: 1em;
        padding: 0.9rem 1.2rem;
    }

    .tabs {
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .tab-button {
        flex-basis: 48%;
        max-width: none;
        font-size: 1em;
        padding: 0.8rem 1rem;
        margin: 0;
    }

    .product-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        padding: 0.5rem;
    }

    .product-card {
        height: 400px;
    }

    .product-card-image {
        height: 60%;
    }

    .product-card-content {
        height: 40%;
        padding: 0.8rem;
    }

    .product-card h3 {
        font-size: 1.2em;
    }

    .product-card p {
        font-size: 0.8em;
        -webkit-line-clamp: 4;
    }

    .shop-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .product-cards-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-card {
        height: auto;
    }

    .product-card-image {
        height: 250px;
    }
}