/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary: #064e3b;
    --accent: #d1fae5;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Sarabun', sans-serif;
    line-height: 1.7;
    color: var(--dark);
    background: var(--white);
    overflow-x: hidden;
}

body.loading {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    line-height: 1.3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==================== Loading Screen ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #10b981 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.loading-logo {
    margin-bottom: 3rem;
    animation: fadeInScale 0.8s ease-out;
}

.loading-icon {
    font-size: 5rem;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(16, 185, 129, 0.5));
}

.loading-title {
    color: var(--white);
    font-size: 2.5rem;
    margin-top: 1rem;
    font-family: 'Prompt', sans-serif;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.progress-container {
    width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    margin: 0 auto 1.5rem;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
    border-radius: 50px;
    position: relative;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: shimmer 1.5s infinite;
}

.progress-glow {
    position: absolute;
    top: -10px;
    left: 0;
    height: 28px;
    width: 100%;
    background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.4) 0%, transparent 70%);
    filter: blur(10px);
    animation: pulseGlow 2s ease-in-out infinite;
}

.progress-text {
    color: var(--white);
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Prompt', sans-serif;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.progress-number {
    display: inline-block;
    min-width: 100px;
    text-align: right;
}

.progress-percent {
    margin-left: 0.3rem;
}

.loading-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
}

.loading-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.3;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4), transparent);
    animation: float 8s ease-in-out infinite;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 500px;
    height: 500px;
    top: 50%;
    right: -15%;
    animation-delay: 2s;
}

.circle-3 {
    width: 400px;
    height: 400px;
    bottom: -10%;
    left: 30%;
    animation-delay: 4s;
}

/* ==================== Loading Animations ==================== */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(-5deg);
    }
    75% {
        transform: translateY(-10px) rotate(5deg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* ==================== Header & Navigation ==================== */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    font-family: 'Prompt', sans-serif;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

.logo-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
    font-size: 1.05rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary);
    cursor: pointer;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    z-index: 2000;
    padding: 2rem;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    margin-top: 3rem;
}

.mobile-menu ul li {
    margin-bottom: 1.5rem;
}

.mobile-menu ul a {
    color: var(--dark);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    display: block;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu ul a:hover {
    background: var(--accent);
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
}

/* ==================== Hero Section ==================== */
.hero {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
    padding: 8rem 2rem 6rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="%2310b981" opacity="0.1"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: fadeInDown 0.6s ease-out;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
}

.hero-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.floating-card {
    position: absolute;
    font-size: 4rem;
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

.card-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.card-2 {
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.card-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 4s;
}

/* ==================== Section Styles ==================== */
section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.8rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== Products Section ==================== */
.products {
    background: var(--white);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.product-badge.new {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.product-badge.premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.product-image {
    height: 280px;
    background: linear-gradient(135deg, var(--accent) 0%, #a7f3d0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(16, 185, 129, 0.1) 100%);
}

.product-icon {
    font-size: 6rem;
    z-index: 1;
    transition: var(--transition);
}

.product-card:hover .product-icon {
    transform: scale(1.1) rotate(5deg);
}

.product-info {
    padding: 1.8rem;
}

.product-name {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
}

.product-desc {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.price-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.price-old {
    font-size: 1rem;
    color: var(--gray);
    text-decoration: line-through;
}

.btn-cart {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ==================== Brands Section ==================== */
.brands {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.brand-card {
    background: var(--white);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
}

.brand-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.brand-logo {
    margin-bottom: 1.2rem;
}

.brand-logo span {
    font-size: 4rem;
    display: inline-block;
    transition: var(--transition);
}

.brand-card:hover .brand-logo span {
    transform: scale(1.15) rotate(5deg);
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.brand-desc {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ==================== Features Section ==================== */
.features {
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--light-gray);
    border-radius: var(--radius);
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature-card:hover {
    background: var(--white);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 1.2rem;
    display: inline-block;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    transform: scale(1.2);
}

.feature-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.feature-desc {
    color: var(--gray);
    line-height: 1.7;
}

/* ==================== Footer ==================== */
footer {
    background: linear-gradient(135deg, var(--secondary) 0%, #064e3b 100%);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section {
    animation: fadeInUp 0.6s ease-out;
}

.footer-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-desc {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.footer-heading {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-light);
}

.contact-list p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* ==================== Animations ==================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.3rem;
    }
    
    .progress-container {
        width: 350px;
    }
    
    .loading-icon {
        font-size: 4rem;
    }
    
    .loading-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero {
        padding: 5rem 2rem 4rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .products-grid,
    .brands-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .floating-card {
        display: none;
    }
    
    .progress-container {
        width: 280px;
    }
    
    .progress-text {
        font-size: 2.5rem;
    }
    
    .loading-icon {
        font-size: 3.5rem;
    }
    
    .loading-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    nav {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .product-name {
        font-size: 1.2rem;
    }
    
    .price {
        font-size: 1.5rem;
    }
    
    .progress-container {
        width: 240px;
    }
    
    .progress-text {
        font-size: 2rem;
    }
    
    .loading-title {
        font-size: 1.5rem;
    }
}