/* =================================
   1. Google Font Import & General Styles
   ================================= */
@font-face {
    font-family: 'Subscribe';
    /* Assumes your font file is named Subscribe.ttf inside the 'fonts' folder */
    src: url('fonts/Subscribe.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-pink: #f24882;
    --primary-purple: #835D9C;
    --bg-main: #F8E3EE;
    --bg-nav-hover: #d94175; /* A slightly darker pink for nav hover */
    --bg-light: #fefaea;
    --bg-product-card: #f9b6e9;
    --bg-video-gallery: #f9b6e9; /* Using the same pink as product cards */
    --font-family: 'Subscribe', sans-serif;
    --shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-main);
    font-family: var(--font-family);
    margin: 0;
    padding: 20px 0; /* Apply padding only to top and bottom */    
    
    /* Sticky Footer Setup */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    /* Part of the Sticky Footer: allows main content to grow */
    flex-grow: 1; /* Grow to fill space between header and footer */
    display: flex; /* Allow child elements to grow */    
    padding: 0 20px; /* Add horizontal padding here */
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

/* =================================
   2. Master Layout Rule for Nav & Footer Bars
   ================================= */
nav,
.footer-bar {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box; /* Include padding in the element's total width */
}

/* =================================
   3. Header & Navigation Styles
   ================================= */
header {
    margin-bottom: 25px;
}

nav {
    background-color: var(--primary-pink);
    border-radius: 50px;
    padding: 8px;
    display: flex;
    justify-content: center;
    box-shadow: var(--shadow);
}

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

nav a {
    text-decoration: none;
    color: var(--bg-light);
    font-weight: 700;
    font-size: 1.4em;
    padding: 10px 25px;
    border-radius: 50px;
    transition: background-color 0.3s, transform 0.2s ease-out;
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center the text */
}

nav a.active {
    background-color: var(--bg-light);
    color: var(--primary-purple);
    box-shadow: var(--shadow);
    /* Adjust padding to visually center the custom font */
    padding: 12px 25px 8px;
}

nav a:not(.active):hover {
    transform: translateY(-2px);
    background-color: var(--bg-nav-hover);
}

/* =================================
   4. Page-Specific Styles
   ================================= */

/* --- Home Page --- */

.intro-box {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    border-radius: 25px;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    flex-grow: 1;
    padding: clamp(20px, 4vw, 40px);
}

.intro-content {
    display: flex;
    align-items: center;
    gap: clamp(15px, 3vmin, 50px); 
    width: fit-content; 
    margin: 0 auto; 
}

.intro-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro-text h1,
.intro-text h2 {
    color: var(--primary-pink);
    font-size: clamp(24px, 4vmin, 55px); 
    margin: 0 0 20px 0;
    white-space: nowrap;
    text-align: center;
}

.intro-text p {
    color: var(--primary-purple);
    font-size: clamp(18px, 2.5vmin, 32px);
    line-height: 1.5;
    margin: 0;
    max-width: 65ch; /* Limit line length for readability */
    text-align: center;
    margin-bottom: 20px; /* Add space before the contact link appears on mobile */
}

.contact-email-link {
    color: var(--primary-purple);
    background-color: var(--bg-product-card);
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.4em;
    text-decoration: none;
    font-weight: 700;
    margin-top: 20px;
    transition: transform 0.2s ease-out, background-color 0.3s ease;
    display: inline-block; /* Ensures transform works correctly */
}

.contact-email-link:hover {
    transform: translateY(-2px);
    background-color: #f7a8e1; /* A slightly darker version of the background */
}

/* Generic action button for links styled as buttons */
.action-button {
    color: var(--primary-purple);
    background-color: var(--bg-product-card);
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.4em;
    text-decoration: none;
    font-weight: 700;
    margin-top: 20px;
    transition: transform 0.2s ease-out, background-color 0.3s ease;
    display: inline-block; /* Ensures transform works correctly */
}
.action-button:hover {
    transform: translateY(-2px);
    background-color: #f7a8e1; /* A slightly darker version of the background */
}
.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px; 
    white-space: nowrap; /* Handle long text */
    word-wrap: normal; /* Prevent wrapping of long words */
}

.character-image {
    
    width: clamp(180px, 30vmin, 350px);
    height: auto;
    flex-shrink: 0;
}

/* --- Shop Page --- */
.shop-box {
    width: 100%; 
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    list-style: none;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    background-color: var(--bg-light);
    border-radius: 25px;
    padding: clamp(20px, 4vw, 40px); /* Match homepage for consistent spacing */
    box-shadow: var(--shadow);
    margin: 0 auto; /* Remove default UL margin and keep horizontal centering */
    flex-grow: 1; 
    box-sizing: border-box;
}

.product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.product-card {
    background-color: var(--bg-product-card);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    transform-origin: center; /* Ensures the wiggle is centered */
    height: auto;
    transition: transform 0.3s ease-in-out;
}

.buy-button {
    background-color: var(--primary-purple);
    color: var(--bg-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.4em;
    /* Adjust padding to visually center the custom font */
    padding: 12px 30px 8px;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease-out;
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center the text */
}

.buy-button:hover {
    background-color: var(--primary-pink);
    transform: translateY(-2px);
}

.product-item:hover .product-image {
    transform: scale(0.95); /* Gently scale the image down on hover */
}

/* --- Videos Page --- */
.video-gallery-container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--bg-light); /* Match shop and home page */
    border-radius: 25px; /* Matches other main containers */
    padding: clamp(20px, 4vw, 40px); /* Match homepage for consistent spacing */
    box-shadow: var(--shadow);
    flex-grow: 1;
    box-sizing: border-box;

    display: grid;
    /* Creates a responsive grid. It's 1 column on small screens, and 3 on larger screens */
    grid-template-columns: repeat(3, 1fr); /* Default to 3 equal columns */
    gap: 30px; /* Use a single gap value for simplicity */
}

.video-gallery-container.loading {
    display: block; /* Temporarily override grid for loading message */
    text-align: center;
    color: var(--primary-purple);
    font-size: 1.2em;
    padding-top: 50px;
}

.video-placeholder {
    background-color: white;
    border-radius: 15px; /* Matches product cards */
    box-shadow: var(--shadow-sm);
    /* Creates a 16:9 rectangle that maintains its aspect ratio */
    aspect-ratio: 16 / 9;
    width: 100%;
    box-sizing: border-box;
    
    /* New styles for thumbnail functionality */
    position: relative; /* For positioning the play icon */
    cursor: pointer;
    overflow: hidden; /* Ensures image corners are rounded */
    transition: transform 0.2s ease-out;

    /* Reset default button styles */
    border: none;
    padding: 0;
    font: inherit;
}

.video-placeholder:hover {
    transform: translateY(-5px) scale(1.02);
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the container */
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Icon doesn't interfere with clicks */
    transition: transform 0.2s ease-out;
    
    /* Create a play triangle with CSS */
    width: 0; 
    height: 0; 
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 30px solid rgba(255, 255, 255, 0.9);
    /* Adjust position to center the triangle */
    margin-left: 5px;

    /* Add a shadow to the icon itself for better contrast on all thumbnails */
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.video-placeholder:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.open {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
}

.video-embed-container {
    /* This container holds the iframe and maintains its aspect ratio */
    position: relative;
    width: 100%;
    height: 100%;
}


.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.close-modal-btn {
    position: absolute;
    top: -40px; /* Position it above the video frame */
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--primary-pink);
}




/* =================================
   5. Footer Styles
   ================================= */
footer {
    margin-top: 40px;
    text-align: center;
}

.footer-bar {
    background-color: var(--primary-pink);
    border-radius: 50px;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.contact-button {
    background-color: var(--bg-light);
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.4em;
    padding: 10px 25px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease-out;    
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically center the text */
    /* Adjust padding to visually center the custom font */
    padding: 12px 25px 8px;
}

.contact-button.disabled {
    pointer-events: none; /* Makes the button not clickable */
    opacity: 0.6; /* Visually indicates it's disabled */
    cursor: default;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-icons img {
    height: 30px;
    display: block;
    transition: transform 0.2s ease-out;
}

.contact-button:hover, .social-icons a:hover img {
    transform: translateY(-2px);
}

.copyright {
    color: var(--primary-purple);    
    font-size: 11px;
}

/* =================================
   6. Media Queries (Responsive Styles)
   ================================= */

   @media (max-width: 900px) {
    
    /* --- Home Page adjustments --- */
    .intro-content {
        flex-direction: column;
        text-align: center;
        gap: 20px; /* Add some space between image and text */
    }

    .intro-text p {
        font-size: clamp(16px, 2.5vmin, 22px);
    }

    .intro-text h2 {
        font-size: clamp(24px, 4vmin, 40px);
    }
    
    /* Allow the main heading to wrap on smaller screens, overriding 'white-space: nowrap' */
    .intro-text h1,
    .intro-text h2 {
        white-space: normal;
    }

    /* --- Shop Page adjustments --- */
    .shop-box {
        padding: 20px;
    }

    /* --- Videos Page adjustments --- */
    .video-gallery-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
}

@media (max-width: 600px) {
    /* --- Navigation adjustments for mobile --- */
    nav ul {
        flex-direction: column; /* Stack nav items vertically */
        gap: 8px; /* Adjust gap for vertical layout */
        align-items: center; /* Center the items horizontally */
    }

    nav a {
        padding: 10px 15px; /* Reduce horizontal padding */
        text-align: center; /* Center the text inside the link */
        justify-content: center; /* Horizontally center text in the flex container */
    }

    .video-gallery-container {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}