/* Reusable UI Components for LUNAYA E-commerce */

/* Product Card */
.product-card {
    background-color: var(--color-pure-white);
    border-radius: var(--border-radius-soft);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.product-card-image {
    width: 100%;
    height: 300px; /* Fixed height for consistency */
    overflow: hidden;
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05); /* Subtle zoom on hover */
}

.product-card-info {
    padding: 20px;
    text-align: center;
    flex-grow: 1; /* Allows info section to take available space */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-info h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3em;
    margin-bottom: 5px;
    color: var(--color-dark-gray);
}

.product-card-info p {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--color-powder-mauve);
    margin-top: 10px;
}

/* Carousel (for "Nouveautés" and Lookbook) */
.carousel-container {
    position: relative;
    overflow: hidden;
    margin: 40px 0;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    flex: 0 0 auto; /* Prevent items from shrinking */
    width: 300px; /* Adjust as needed for number of visible items */
    margin-right: 20px; /* Spacing between items */
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none; /* Allow clicks through to items */
}

.carousel-nav button {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    pointer-events: all; /* Re-enable clicks for buttons */
    transition: background-color 0.3s ease;
}

.carousel-nav button:hover {
    background-color: var(--color-powder-mauve);
    color: var(--color-pure-white);
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-pure-white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 30px 0;
    display: none; /* Hidden by default, shown with JS */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.mega-menu.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.mega-menu-column {
    flex: 1;
    min-width: 200px;
    padding: 0 20px;
}

.mega-menu-column h4 {
    font-family: 'Cormorant Garamond', serif;
    margin-bottom: 15px;
    color: var(--color-powder-mauve);
}

.mega-menu-column ul {
    list-style: none;
}

.mega-menu-column ul li {
    margin-bottom: 10px;
}

.mega-menu-column ul li a {
    color: var(--color-dark-gray);
    transition: color 0.3s ease;
}

.mega-menu-column ul li a:hover {
    color: var(--color-powder-mauve);
}

/* Search Bar */
.search-bar {
    position: relative;
    width: 300px; /* Adjust as needed */
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--color-pearl-beige);
    border-radius: var(--border-radius-soft);
    font-family: 'Inter', 'Lato', sans-serif;
    color: var(--color-dark-gray);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-pure-white);
    border-radius: var(--border-radius-soft);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    display: none; /* Hidden by default */
    z-index: 998;
}

.search-results.active {
    display: block;
}

.search-results ul {
    list-style: none;
    padding: 10px 0;
}

.search-results ul li {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-results ul li:hover {
    background-color: var(--color-nude-rose);
}

/* Newsletter Pop-up */
.newsletter-popup {
    background-color: var(--color-pure-white);
    padding: 40px;
    border-radius: var(--border-radius-soft);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    text-align: center;
    position: relative;
}

.newsletter-popup h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--color-powder-mauve);
}

.newsletter-popup p {
    margin-bottom: 25px;
    color: var(--color-dark-gray);
}

.newsletter-popup form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.newsletter-popup input[type="email"] {
    padding: 12px;
    border: 1px solid var(--color-pearl-beige);
    border-radius: var(--border-radius-soft);
    font-family: 'Inter', 'Lato', sans-serif;
}

.newsletter-popup .btn {
    width: 100%;
}

/* Instagram Feed */
.instagram-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 40px;
}

.instagram-post {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-soft);
}

.instagram-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.instagram-post:hover img {
    transform: scale(1.05);
}

.instagram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instagram-post:hover .instagram-overlay {
    opacity: 1;
}

.instagram-overlay i {
    color: var(--color-pure-white);
    font-size: 2em;
}

/* Testimonials / UGC */
.testimonial-card {
    background-color: var(--color-nude-rose);
    border-radius: var(--border-radius-soft);
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 15px;
    color: var(--color-dark-gray);
}

.testimonial-card .author {
    font-weight: bold;
    color: var(--color-powder-mauve);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-dark-gray);
    color: var(--color-pure-white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    z-index: 10000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-banner p {
    margin: 0;
    flex-grow: 1;
    font-size: 0.9em;
}

.cookie-banner .btn {
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 8px;
}

.cookie-banner .btn-accept {
    background-color: var(--color-powder-mauve);
    color: var(--color-pure-white);
}

.cookie-banner .btn-accept:hover {
    background-color: var(--color-pearl-beige);
    color: var(--color-dark-gray);
}

.cookie-banner .btn-decline {
    background-color: transparent;
    border: 1px solid var(--color-pure-white);
    color: var(--color-pure-white);
}

.cookie-banner .btn-decline:hover {
    background-color: var(--color-pure-white);
    color: var(--color-dark-gray);
}