/* --- CSS Variables & Global Setup --- */
:root {
    --bg-color: #FFFFFF;
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --accent-color: #8E44AD;
    --border-color: #e5e5e6;
    --header-height: 70px;
}

/* --- Animations --- */
@keyframes subtleFadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- Header Styles --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.2s ease-in-out;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.header-icons a {
    font-size: 1.5rem;
    text-decoration: none;
}

/* --- Main Layout & Hero Image (Default Mobile Layout) --- */
.product-focus-layout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.hero-image-container {
    margin: 30px auto;
    animation: subtleFadeInUp 0.8s ease-out;
}

.hero-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* --- Product Header (Title) --- */
.product-header {
    text-align: center;
    padding: 10px 20px 20px 20px;
    animation: subtleFadeInUp 0.8s 0.1s ease-out backwards;
}
.product-header h1 { font-family: 'Source Serif 4', serif; font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 700; margin: 0; line-height: 1.2; }

/* --- UPDATED STYLE FOR THE HEADER BUTTON --- */
.product-header-cta {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    border: none;
    border-radius: 50px; /* Fully rounded edges */
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    background: linear-gradient(45deg, #a737f5, #e94a86, #f57d42);
    background-size: 200% 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-header-cta:hover {
    background-position: 100% 0;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(233, 74, 134, 0.4);
}


/* --- Content Layout (Body + Side Box) --- */
.content-layout {
    animation: subtleFadeInUp 0.8s 0.2s ease-out backwards;
}

/* --- Side Purchase Box --- */
.side-purchase-box {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    margin: 20px 0 40px 0;
    transition: box-shadow 0.3s ease;
}
.side-purchase-box:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.side-purchase-box .price { font-size: 1.75rem; font-weight: 700; margin-bottom: 15px; }
.side-purchase-box .add-to-cart-btn { font-size: 1rem; font-weight: 600; background-color: var(--accent-color); color: #fff; border: none; border-radius: 8px; padding: 15px 20px; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; width: 100%; }
.side-purchase-box .add-to-cart-btn:hover { transform: scale(1.02); box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4); }
.side-purchase-box .trust-signal { margin-top: 15px; font-size: 0.9rem; color: var(--text-secondary); }

/* --- Product Body (The Focus) --- */
.product-body { max-width: 720px; }
.product-body h2 { font-family: 'Source Serif 4', serif; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: 40px; margin-bottom: 20px; line-height: 1.3; }
.product-body h3 { font-size: 1.3rem; margin-top: 30px; font-family: 'Inter', sans-serif; font-weight: 600; }
.product-body p, .product-body ul { color: var(--text-secondary); margin-bottom: 20px; }
.product-body ul { padding-left: 20px; }
.product-body .body-image { margin: 40px 0; }
.product-body .body-image img { width: 100%; border-radius: 8px; }
.product-body .body-image figcaption { font-size: 0.9rem; color: #888; text-align: center; margin-top: 10px; }

/* --- PRETTY THUMBNAIL STYLE (Unused by script, but available) --- */
.in-body-thumbnail {
    margin: 40px auto;
    max-width: 400px;
    width: 100%;
}
.in-body-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.in-body-thumbnail img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* --- Responsive Photo Gallery Styles --- */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 40px;
    margin-bottom: 40px;
}
.photo-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}
.photo-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* --- Rating Section Styles --- */
.rating-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}
.rating-form {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}
.star-input { display: flex; flex-direction: row-reverse; justify-content: center; margin-bottom: 25px; }
.star-input > input { display: none; }
.star-input > label { font-size: 2.5rem; color: #ccc; cursor: pointer; transition: color 0.2s; }
.star-input:not(:hover) > input:checked ~ label,
.star-input:hover > label:hover ~ label,
.star-input > label:hover { color: #ffc107; }
.submit-rating-btn { font-size: 1rem; font-weight: 600; background-color: var(--text-secondary); color: #fff; border: none; border-radius: 8px; padding: 12px 30px; cursor: pointer; transition: background-color 0.2s ease; }
.submit-rating-btn:hover { background-color: var(--accent-color); }

/* --- Footer --- */
.site-footer-main { text-align: center; padding: 40px 20px; margin-top: 40px; border-top: 1px solid var(--border-color); color: var(--text-secondary); font-size: 0.9rem; }
.site-footer-main a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s ease; }
.site-footer-main a:hover { color: var(--accent-color); }

/* --- Responsive Media Queries --- */
/* For tablets and larger */
@media (min-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

/* For desktops */
@media (min-width: 992px) {
    /* Create a 2-column grid for the whole layout */
    .product-focus-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 40px; /* No row-gap, 40px column-gap */
        align-items: center;
        margin: 40px auto;
    }

    .hero-image-container {
        grid-column: 1 / 2;
        margin: 0;
    }

    .product-header {
        grid-column: 2 / 3;
        text-align: left;
        padding: 0;
    }

    /* Make the content layout span both columns below */
    .content-layout {
        grid-column: 1 / -1;
        margin-top: 60px; /* Add space above the content */

        /* Existing rules for the inner grid (article + aside) */
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 60px;
        align-items: flex-start;
    }

    .product-body {
        grid-column: 1 / 2;
        grid-row: 1;
    }
    .side-purchase-box {
        grid-column: 2 / 3;
        grid-row: 1;
        position: sticky;
        top: 100px;
        margin: 0;
    }
}