@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Outfit:wght@300;400;600&display=swap');

:root {
    --primary-pink: #ffc0cb;
    --soft-pink: #fff5f7;
    --deep-pink: #ff758c;
    --light-red: #ff6b6b; /* สีแดงอ่อนๆ */
    --pure-white: #ffffff;
    --text-color: #4a3737;
    --accent-gold: #e6be8a;
    --divine-glow: rgba(230, 190, 138, 0.4);
    --glass: rgba(255, 255, 255, 0.85);
    --shadow: 0 10px 40px 0 rgba(255, 182, 193, 0.3);
    --gradient-primary: linear-gradient(135deg, var(--deep-pink) 0%, #ffadb9 100%);
}
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--pure-white) 100%);
    background-image: 
        radial-gradient(at 0% 0%, rgba(230, 190, 138, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(255, 117, 140, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, .brand-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

/* Background elements for "Garden" feel */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(255,192,203,0.4) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    filter: blur(50px);
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(255,182,193,0.3) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    filter: blur(60px);
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-name {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--light-red);
    text-decoration: none;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-shadow: 0 0 15px rgba(255, 107, 107, 0.2);
}

.brand-logo {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    object-fit: contain;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 15px var(--divine-glow);
    flex-shrink: 0;
    background: transparent;
    mix-blend-mode: multiply; /* ตัดพื้นหลังสีขาวออก */
    filter: contrast(1.1); /* เพิ่มความคมชัด */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--deep-pink);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 10%;
    animation: fadeIn 1.5s ease-out;
}

.hero h1 {
    font-size: 3.8rem;
    margin-bottom: 1.5rem;
    color: var(--light-red);
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.4);
    letter-spacing: -2px;
    font-weight: 700;
    background: linear-gradient(to right, var(--light-red), #ffadb9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: divineFloat 3s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.hero-logo {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 30px var(--divine-glow);
    flex-shrink: 0;
    background: transparent;
    object-fit: contain;
    mix-blend-mode: multiply; /* ตัดพื้นหลังสีขาวออก */
    filter: contrast(1.1);
}

@keyframes divineFloat {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 5px var(--divine-glow)); }
    50% { transform: translateY(-10px); filter: drop-shadow(0 0 20px var(--divine-glow)); }
}

.hero p {
    font-size: 1.5rem;
    color: #8c7373;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    max-width: 800px;
    margin: 0 auto;
}

/* Product Grid */
.product-container {
    padding: 2rem 10%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background: var(--pure-white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 1px solid rgba(255, 192, 203, 0.2);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-15px) scale(1.03);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 40px rgba(230, 190, 138, 0.25);
}

.product-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    max-height: 380px;
    background: var(--soft-pink);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

.product-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.product-info .price {
    font-weight: 600;
    color: var(--deep-pink);
}

/* Modal / Form Overlay - Optimized for performance */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(80, 20, 40, 0.45);
    /* Removed backdrop-filter: blur() - it causes severe lag */
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 4vh;
    z-index: 2000;
    overflow-y: auto;
}

.form-modal {
    background: #fff;
    width: 94%;
    max-width: 580px;
    padding: 2rem 2.2rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    position: relative;
    margin-bottom: 4vh;
    /* GPU acceleration for smooth rendering */
    transform: translateZ(0);
    will-change: transform;
}


.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--deep-pink);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: 1rem;
    min-width: 0;
}

.form-row .form-group input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}


.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--soft-pink);
    border-radius: 12px;
    outline: none;
    transition: 0.3s;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    min-width: 0;
}

.form-group input:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 4px rgba(255, 192, 203, 0.2);
}

.submit-btn {
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 15px;
    background: linear-gradient(45deg, var(--deep-pink), #ffadb9);
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(255, 141, 161, 0.3);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(255, 141, 161, 0.5);
    filter: brightness(1.1);
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    background: var(--pure-white);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--deep-pink);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--soft-pink);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-pink);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--deep-pink);
}
/* Responsive Adjustments */
@media (max-width: 768px) {
    nav {
        padding: 1rem 5%;
        flex-direction: column;
        gap: 12px;
    }

    .brand-name {
        font-size: 1.6rem;
        gap: 10px;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .nav-links {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-links li {
        white-space: nowrap;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    /* Hero Section Mobile */
    .hero {
        padding: 3rem 5%;
    }

    .hero h1 {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 15px;
    }

    .hero-logo {
        width: 70px;
        height: 70px;
        min-width: 70px;
    }

    .hero p {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    /* Product Grid Mobile */
    .product-container {
        padding: 1rem 5%;
        gap: 1.5rem;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .product-card {
        padding: 1rem;
    }

    .product-info h3 {
        font-size: 1.3rem;
    }

    /* Modal Mobile */
    .form-modal {
        padding: 1.5rem 1.2rem;
        width: 96%;
    }

    .form-modal h2 {
        font-size: 1.4rem !important;
    }

    /* Success Modal Mobile */
    #successModal .form-modal {
        padding: 2rem 1.5rem !important;
    }
    
    #successModal .form-modal div[style*="width: 260px"] {
        width: 180px !important;
        height: 180px !important;
    }

    #successModal h2 {
        font-size: 1.4rem !important;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 8px;
    }
    
    .nav-links a {
        font-size: 0.8rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
    
    .product-container {
        grid-template-columns: 1fr;
    }
}

/* Footer Styling */
.main-footer {
    background: linear-gradient(135deg, #ffd1dc 0%, #fff0f5 100%);
    padding: 4rem 10% 2rem;
    margin-top: 5rem;
    border-top: 2px solid var(--primary-pink);
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '★';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2rem;
    color: var(--primary-pink);
    opacity: 0.5;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 3rem;
}

.footer-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 10px 20px rgba(255, 182, 193, 0.4);
    margin-bottom: 1rem;
}

.footer-title {
    font-size: 2.2rem;
    color: var(--deep-pink);
    margin-bottom: 0.2rem;
    font-weight: 800;
}

.footer-subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    background: #fff;
    display: inline-block;
    padding: 4px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 0.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    text-align: left;
    margin-top: 3rem;
}

.footer-info-box {
    background: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    transition: 0.3s;
}

.footer-info-box:hover {
    transform: translateY(-5px);
    background: #fff;
    box-shadow: 0 15px 30px rgba(255, 182, 193, 0.2);
}

.footer-info-box h3 {
    color: var(--deep-pink);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-info-box h3::before {
    content: '✦';
}

.footer-info-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    font-weight: 500;
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 182, 193, 0.3);
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

@media (max-width: 768px) {
    .main-footer {
        padding: 3rem 5% 2rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-title {
        font-size: 1.8rem;
    }
}
