/* ============================================================
   Monothailand - Main Stylesheet
   Smart Energy Solutions Hub
   ============================================================ */

/* ============================================================
   Base & Reset
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Thai', sans-serif;
    scroll-behavior: smooth;
}

/* ============================================================
   Navigation Links
   ============================================================ */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.nav-link:hover {
    color: #16a34a;
    background-color: #f0fdf4;
}
.nav-active {
    color: #16a34a;
    background-color: #f0fdf4;
}

.mobile-nav-link {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #334155;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}
.mobile-nav-link:hover {
    color: #16a34a;
    background-color: #f0fdf4;
}

/* ============================================================
   Product Card
   ============================================================ */
.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
.product-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: #bbf7d0;
}
.product-card .product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f8fafc;
}
.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.product-card:hover .product-image img {
    transform: scale(1.08);
}
.product-card .product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    z-index: 2;
}
.product-card .product-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}
.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}
.product-card .product-body {
    padding: 1rem 1.25rem 1.25rem;
}
.product-card .product-category {
    font-size: 0.75rem;
    color: #16a34a;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.product-card .product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 0.25rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .product-price {
    margin-top: 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.product-card .price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: #16a34a;
}
.product-card .price-compare {
    font-size: 0.875rem;
    color: #94a3b8;
    text-decoration: line-through;
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a2f 50%, #14532d 100%);
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(34,197,94,0.08)" stroke-width="0.5"/><circle cx="50" cy="50" r="30" fill="none" stroke="rgba(34,197,94,0.05)" stroke-width="0.5"/></svg>') repeat;
    background-size: 200px 200px;
    animation: heroPattern 30s linear infinite;
}
@keyframes heroPattern {
    from { background-position: 0 0; }
    to { background-position: 200px 200px; }
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
}

/* ============================================================
   Stats Counter
   ============================================================ */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   Section Styles
   ============================================================ */
.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.section-subtitle {
    font-size: 1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0.5rem auto 0;
}

/* ============================================================
   Feature Card
   ============================================================ */
.feature-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
.feature-card:hover {
    border-color: #bbf7d0;
    box-shadow: 0 8px 30px rgba(22, 163, 74, 0.1);
}
.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Dashboard Demo
   ============================================================ */
.dashboard-demo {
    background: #0f172a;
    border-radius: 1rem;
    border: 1px solid #1e293b;
    overflow: hidden;
}
.dashboard-topbar {
    padding: 0.75rem 1.25rem;
    background: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dashboard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination-nav { margin-top: 2rem; }
.pagination { display: flex; justify-content: center; gap: 0.25rem; list-style: none; padding: 0; }
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.15s;
}
.pagination-link:hover { border-color: #16a34a; color: #16a34a; }
.pagination-link.active { background: #16a34a; color: white; border-color: #16a34a; }
.pagination-dots { padding: 0 0.5rem; color: #94a3b8; }

/* ============================================================
   Cart Table
   ============================================================ */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: 0.75rem 1rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: #64748b; border-bottom: 2px solid #e2e8f0; }
.cart-table td { padding: 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }

/* ============================================================
   Spec Table (Product Detail)
   ============================================================ */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr:nth-child(even) { background: #f8fafc; }
.spec-table th { text-align: left; padding: 0.75rem 1rem; font-weight: 500; color: #475569; width: 40%; border-bottom: 1px solid #e2e8f0; }
.spec-table td { padding: 0.75rem 1rem; color: #1e293b; border-bottom: 1px solid #e2e8f0; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.3s ease-out; }

@keyframes pulse-glow {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}
.animate-pulse-glow { animation: pulse-glow 3s ease-in-out infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-float { animation: float 4s ease-in-out infinite; }

/* Solar Calculator specific */
.calc-result-bar {
    height: 1rem;
    border-radius: 9999px;
    transition: width 0.8s ease-out;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .hero-section { min-height: 500px; }
    .stat-number { font-size: 2rem; }
    .section-title { font-size: 1.5rem; }
}

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    padding: 1rem 0;
}
.breadcrumb a { color: #16a34a; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-separator { color: #cbd5e1; }

/* ============================================================
   Form Styles
   ============================================================ */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
}
.form-input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.375rem;
}

/* ============================================================
   [x-cloak] ซ่อน element ก่อน Alpine.js โหลด
   ============================================================ */
[x-cloak] { display: none !important; }
