/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Playfair+Display:wght@700&display=swap');

/* --- CSS Variables (Color Palette) --- */
:root {
    --bg-color: #fefdefdb;
    --text-color: #333333;
    --primary-red: #B93751;
    --primary-green: #5C6D47;
    --heading-font: 'Playfair Display', serif;
    --body-font: 'Lato', sans-serif;
}

/* --- General Styles & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

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

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--heading-font);
    color: var(--primary-green);
    margin-top: 0;
}

h1 { font-size: 3rem; margin-bottom: 0.5em; }
h2 { font-size: 2.2rem; text-align: center; margin-bottom: 1em; }
h3 { font-size: 1.4rem; color: var(--primary-green); margin-bottom: 0.5em;}

/* --- Header & Navigation --- */
.main-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 10px 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-image {
    height: 120px;
    width: auto;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--primary-green);
    font-weight: 700;
    font-size: 1.1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.main-nav a:hover, .main-nav a.active {
    border-color: var(--primary-red);
}

/* --- Hero Section --- */
.hero {
    background-image: url('https://perdignus-llc.github.io/Brambles-Berries.com/images/hero-background.jpg');
    background-size: cover;
    background-position: center;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 70vh;
    overflow: hidden;
}

.hero-content {
    max-width: 700px;
    margin: 0 20px;
    background-color: rgba(254, 253, 239, 0.85);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    z-index: 1;
    flex-shrink: 0;
}

.hero-raspberry {
    position: absolute;
    height: 350px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
    z-index: 0;
}

.hero-raspberry.left {
    left: -60px;
    top: 50%;
    transform: translateY(-50%) rotate(-15deg);
}

.hero-raspberry.right {
    right: -60px;
    top: 50%;
    transform: translateY(-50%) rotate(15deg) scaleX(-1);
}

/* --- Reusable Button --- */
.btn {
    display: inline-block;
    background-color: var(--primary-red);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    margin-top: 20px;
    transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
    background-color: #a02d45;
    transform: translateY(-2px);
}

/* --- Intro & CTA Sections --- */
.intro, .cta {
    padding: 20px 0;
    text-align: center;
}

.intro p, .cta p {
    max-width: 650px;
    margin: 0 auto 1em;
}

.cta {
    background-color: #fdfdfd;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* --- Featured Products Section --- */
.featured-products {
    padding: 30px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-card h3 {
    padding: 20px 20px 25px;
    margin: 0;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--primary-green);
    color: var(--bg-color);
    text-align: center;
    padding: 30px 0;
    margin-top: 30px;
}

.main-footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.main-footer a {
    color: var(--bg-color);
    text-decoration: underline;
}

.footer-vine {
    margin-bottom: 20px;
    padding: 0 20px;
}

/* --- Media Query for Mobile Responsiveness --- */
@media (max-width: 900px) {
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .hero {
        min-height: auto;
        padding: 3rem 1rem;
    }

    .hero-content {
        flex-shrink: 1;
        margin: 0;
        padding: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-raspberry {
        display: none;
    }
}

/* --- Shop Page Styles --- */
.shop-page {
    padding: 40px 0 60px 0;
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-red);
    margin: -15px 0 15px 0;
}

.product-card .btn {
    font-size: 0.9rem;
    padding: 10px 25px;
    margin-bottom: 25px;
}

/* --- Customizer Styles --- */

/* Default stacked layout for mobile */
#customizer {
    max-width: 700px;
    margin: 40px auto;
    text-align: center;
}

#customizer .preview {
    position: relative;
    max-width: 500px; /* Give a max-width for mobile */
    margin: 0 auto 20px;
}

#customizer #base-image {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

#customizer #eyes-image, #customizer #mouth-image {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    height: auto;
    z-index: 2;
}

#customizer #eyes-image {
    width: 20%;
    top: 30%;
}

#customizer #mouth-image {
    width: 10%;
    top: 35%;
    z-index: 3;
}

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

.selector-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.selector-grid img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.selector-grid img.selected {
    border-color: var(--primary-red);
}

#add-to-cart {
    display: inline-block;
    margin-top: 25px;
    padding: 4px 16px;
    font-size: 1.1rem;
    background-color: #af7de0ff; /* Fuchsia color */
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#add-to-cart:hover {
    background-color: #d100d1;
    transform: translateY(-2px);
}

/* --- FIXED TWO-COLUMN DESKTOP LAYOUT --- */
@media (min-width: 901px) {
    #customizer {
        max-width: 1200px;
        display: flex;
        align-items: flex-start;
        gap: 25px;
    }

    /* LEFT Column: Preview Image + Button */
    #customizer .preview {
        flex: 1 1 60%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Contain the base image without overflow */
    #customizer .preview #base-image {
        max-width: 100%;
        max-height: 70vh; /* keeps it inside viewport height */
        object-fit: contain;
    }

    /* Eyes & mouth stay properly positioned on top */
    #customizer #eyes-image, 
    #customizer #mouth-image {
        max-width: 30%; /* will shrink with base image */
        height: auto;
    }

    /* Add-to-Cart button stays under the image */
    #add-to-cart {
        margin-top: 20px;
        align-self: center;
    }

    /* RIGHT Column: Selectors */
    #customizer .selectors {
        flex: 1 1 40%;
        max-width: 400px;
        text-align: left;
        overflow-y: auto; /* ensures scrolling if too tall */
        max-height: 80vh;
    }

    /* Align thumbnails to the left */
    .selector-grid {
        justify-content: flex-start;
    }
}
