/* Import Poppins Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #5318d1;
    --secondary: #f25dc1;
    --accent: #596def;
    --soft-purple: #ceade4;
    --bg-color: #f7f7f7;
    --white: #ffffff;
    --text: #333333;
}

/* UNIVERSAL RESPONSIVE RESET */
*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    overflow-x: hidden; /* Prevents horizontal scrolling on mobile */
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* HEADER */
.top-bar {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 8px 5%;
    font-size: 0.85rem;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px 5%;
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    gap: 15px;
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    white-space: nowrap;
}

.search-box {
    flex: 1;
    margin: 0 20px;
    display: flex;
    min-width: 250px;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.search-btn {
    padding: 0 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* HAMBURGER MENU BUTTON */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
}

/* MEGA MENU (DESKTOP) */
.nav-bar {
    background: var(--white);
    border-bottom: 1px solid #eee;
    padding: 0 5%;
    display: flex;
    gap: 30px;
    justify-content: center;
    position: relative;
    z-index: 5;
    flex-wrap: wrap;
}

.nav-item {
    position: relative;
    padding: 15px 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-item > a {
    color: var(--text);
    display: block;
}

.nav-item:hover > a {
    color: var(--secondary);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-top: 3px solid var(--secondary);
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
    z-index: 1000;
}

.nav-item:hover .dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown li a {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.9rem;
    color: var(--text);
}

.dropdown li a:hover {
    background: var(--bg-color);
    color: var(--primary);
    padding-left: 20px;
}

/* MOBILE NAV (BOOK OPEN ANIMATION) */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s;
    backdrop-filter: blur(3px);
}

.mobile-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: var(--white);
    z-index: 9999;
    overflow-y: auto;
    padding: 30px 20px;
    box-shadow: 5px 0 20px rgba(0,0,0,0.2);
    /* The 3D Book Fold Magic */
    transform-origin: left center;
    transform: perspective(1500px) rotateY(-90deg);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    visibility: hidden;
}

body.nav-active .mobile-nav-overlay {
    opacity: 1;
    visibility: visible;
}

body.nav-active .mobile-nav-container {
    transform: perspective(1500px) rotateY(0deg);
    visibility: visible;
}

.mobile-nav-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.mobile-nav-links a {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: var(--text);
}

.mobile-nav-links a:hover {
    color: var(--secondary);
    padding-left: 10px;
}

.mobile-sub-links {
    padding-left: 15px;
    margin-top: 10px;
    border-left: 2px solid var(--soft-purple);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-sub-links a {
    font-size: 0.95rem;
    font-weight: 400;
    border: none;
    padding: 5px 0;
}

/* HERO */
.hero {
    position: relative;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center; /* Centers everything horizontally */
    text-align: center; /* Centers the text and button */
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Adds a very soft dark tint to the image so the white text is always readable */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); 
    z-index: 2;
}

.hero-overlay {
    position: relative;
    z-index: 3; /* Puts the text above the image tint */
    max-width: 800px;
    width: 90%;
    padding: 0 20px;
    /* Removed the white background, blur, and left-alignment */
}

.hero-title {
    color: #ffffff; /* White text looks most premium over images */
    font-size: 3.5rem; /* Slightly larger for a centered layout */
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 800;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6); /* Beautiful shadow to separate text from image */
}
.hero-subtitle {
    color: #f8f9fa; /* Slightly off-white for a softer, premium look */
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 25px;
    font-weight: 400;
    max-width: 600px; /* Prevents the text from stretching too wide on big screens */
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 3px 10px rgba(0,0,0,0.5); /* Helps the text pop off the image */
}

.btn-primary {
    background: var(--secondary);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    display: inline-block;
    margin-top: 15px;
    font-family: inherit;
    border: none;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 10px rgba(242, 93, 193, 0.4); /* Optional: gives the button a slight glow */
}

/* PRODUCTS */
.section-title {
    text-align: center;
    margin: 50px 5% 30px;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--primary);
    font-weight: 700;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 0 5%;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-img {
    aspect-ratio: 1/1;
    position: relative;
    width: 100%;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary);
    color: white;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    z-index: 2;
}

.product-details {
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.product-details h3 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
    line-height: 1.3;
}

.price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 5px 0;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    margin-right: 5px;
    font-weight: 400;
}

/* EXTENDED HOMEPAGE SECTIONS */
.promo-split {
    display: flex;
    flex-wrap: wrap;
    margin: 60px 5%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.promo-split-content {
    flex: 1;
    min-width: 300px;
    background: var(--soft-purple);
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.promo-split-content h2 {
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.promo-split-image {
    flex: 1;
    min-width: 300px;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    min-height: 300px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
}

.features-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    background: white;
    padding: 40px 5%;
    margin: 0 0 40px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.feature-box {
    transition: 0.3s;
    padding: 20px;
    border-radius: 12px;
}

.feature-box:hover {
    background: #fdfbfd;
    box-shadow: 0 5px 15px rgba(83, 24, 209, 0.05);
    transform: translateY(-5px);
}

.premium-icon {
    width: 45px;
    height: 45px;
    margin-bottom: 15px;
    color: var(--primary);
    transition: transform 0.3s;
}

.feature-box:hover .premium-icon {
    transform: scale(1.1);
    color: var(--secondary);
}

.feature-box h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.feature-box p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.testimonial-section {
    background: #fdfcfd;
    padding: 60px 5%;
    margin: 60px 0;
    border-top: 1px solid #f0e6f5;
    border-bottom: 1px solid #f0e6f5;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.testimonial-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    position: relative;
    transition: 0.3s;
    border: 1px solid #fff;
}

.testimonial-card:hover {
    border-color: var(--soft-purple);
    transform: translateY(-5px);
}

.quote-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    color: rgba(242, 93, 193, 0.1);
}

.stars {
    color: #ffc107;
    margin-bottom: 15px;
    display: flex;
    gap: 4px;
}

.star-svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.banner-highlight {
    background: linear-gradient(135deg, #fdfbfd, #f0e6f5);
    border-radius: 20px;
    padding: 40px 5%;
    margin: 60px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(83,24,209,0.05);
}

.banner-text {
    flex: 1;
    min-width: 300px;
}

.banner-text h2 {
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.banner-image-placeholder {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    color: var(--secondary);
    border: 2px dashed var(--soft-purple);
}

/* FOOTER */
footer {
    background: linear-gradient(135deg, #3a0d9b, var(--primary));
    color: var(--white);
    padding: 70px 5% 30px;
    margin-top: 80px;
    border-top: 5px solid var(--secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--white);
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

.footer-col p {
    color: #d1c4e9;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #d1c4e9;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-col ul li a::before {
    content: '›';
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.2rem;
    transition: 0.3s;
}

.footer-col ul li a:hover {
    color: var(--white);
    transform: translateX(5px);
}

.footer-col ul li a:hover::before {
    transform: translateX(3px);
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d1c4e9;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.contact-info svg {
    width: 20px;
    height: 20px;
    color: var(--secondary);
    flex-shrink: 0;
}

.social-icons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.3s;
}

.social-icons a:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(242, 93, 193, 0.4);
}

.social-icons svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.payment-methods {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.payment-methods span {
    background: white;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #b39ddb;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

/* FORM STYLING */
.form-container {
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--secondary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(242, 93, 193, 0.1);
    outline: none;
}

.errorlist {
    color: red;
    font-size: 0.85rem;
    margin-top: 5px;
    list-style: none;
    padding: 0;
}

.helptext {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

/* FLASH MESSAGES (TOASTS) */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90vw;
}

.toast {
    min-width: 250px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.5s forwards, fadeOut 0.5s forwards 4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.toast.success { background-color: #28a745; border-left: 5px solid #1e7e34; }
.toast.error { background-color: #dc3545; border-left: 5px solid #bd2130; }
.toast.warning { background-color: #ffc107; color: #333; border-left: 5px solid #d39e00; }
.toast.info { background-color: #17a2b8; border-left: 5px solid #117a8b; }

@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.7;
}

.toast-close:hover { opacity: 1; }

/* --- RESPONSIVE MEDIA QUERIES --- */

/* Tablets & Small Laptops (Max 992px) */
@media (max-width: 992px) {
    .main-header {
        flex-wrap: wrap;
    }
    .search-box {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 10px 0 0 0;
    }
}

/* Mobile Phones (Max 768px) */
@media (max-width: 768px) {
    .nav-bar { 
        display: none; /* Hide desktop nav */
    }
    .hamburger { 
        display: block; /* Show hamburger icon */
    }
    .logo { 
        font-size: 1.5rem; 
    }
    .hero { 
        height: 400px; 
    }
    .hero-title { 
        font-size: 2.5rem; 
    }
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
        padding: 0 10px;
    }
    .product-grid { 
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
        gap: 15px; 
    }
    .copyright { 
        flex-direction: column; text-align: center; justify-content: center; 
    }
    .user-actions .hide-mobile { 
        display: none; /* Hide the word 'Account' next to icon on mobile */
    }
    
    /* --- THE DROPDOWN FIX --- */
    .user-actions .nav-item {
        position: static; /* Releases the dropdown from the tiny icon container */
    }
    .user-actions .dropdown {
        top: 65px !important; /* Pushes it neatly below the header icons */
        right: 5% !important; /* Aligns perfectly with the screen padding */
        left: auto !important; 
        min-width: 160px;
        z-index: 9999; /* Ensures it sits above the search bar */
        border-radius: 8px;
    }
}

/* Tiny Devices / Smartwatches (Max 360px) */
@media (max-width: 360px) {
    .product-grid {
        grid-template-columns: 1fr; /* 1 item per row */
    }
    .hero {
        height: 300px;
    }
    .hero-title {
        font-size: 1.5rem;
    }
    .hero-overlay {
        padding: 20px;
    }
    .btn-primary {
        width: 100%;
    }
}