/* JJR โซล่าเซลล์ — Public catalog */
:root {
    /* Brand: solid #4cb54e เป็นหลัก — gradient ใช้แค่ ~10% (hero + CTA สำคัญ) */
    --green: #4cb54e;              /* สีหลัก */
    --green-hover: #3fa341;        /* hover state */
    --green-light: #6ec571;        /* lighter tone */
    --green-dark: #388e3c;         /* darker — สำหรับ text/border */
    --green-darker: #205521;       /* very dark — high contrast */
    --green-bright: #4cb54e;
    --green-soft: #e6f4e6;
    --bg: #f8f9fa;
    --bg-soft: rgba(76, 181, 78, 0.08);
    --text: #1f2937;
    --text-mid: #4b5563;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --border-soft: #f3f4f6;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-btn: 6px;             /* Bootstrap-like — เหลี่ยมขึ้น */
    /* Gradient — สงวนไว้สำหรับ hero placeholder + CTA card สำคัญเท่านั้น */
    --gradient: linear-gradient(135deg, #205521 0%, #4cb54e 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Kanit', -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Header === */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 12px 20px;
    display: flex; align-items: center; gap: 24px;
}
.logo-link {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text);
}
.logo-link img { width: 38px; height: 38px; object-fit: contain; }
.logo-text { font-weight: 600; font-size: 1.05em; line-height: 1.1; }
.logo-text small { display: block; font-size: 0.7em; color: var(--text-light); font-weight: 400; }
.nav-main {
    display: flex; gap: 4px; margin-left: auto;
    align-items: center;
}
.nav-main a {
    color: var(--text-mid); padding: 8px 14px;
    border-radius: var(--radius-btn); font-size: 0.95em;
    transition: all 0.15s;
}
.nav-main a:hover { background: var(--bg-soft); color: var(--green-dark); text-decoration: none; }
.nav-main a.active { background: var(--green-soft); color: var(--green-dark); font-weight: 500; }
.nav-cta {
    background: var(--green);
    color: var(--white) !important;
    padding: 8px 18px !important;
}
.nav-cta:hover { background: var(--green-hover); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(76,181,78,0.3); }

.menu-toggle {
    display: none; background: none; border: none;
    font-size: 1.4em; color: var(--text); cursor: pointer;
    padding: 6px; margin-left: auto;
}

/* === Hero with carousel + side banners === */
/* Layout: [left-banner 10%] [carousel 80%] [right-banner 10%] on desktop */
.hero-wrap {
    max-width: 1280px; margin: 24px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 8fr 1fr;
    gap: 12px;
    align-items: stretch;
}

/* Main carousel — recommended image size: 1920 × 820 px (≈7:3 ratio, taller for image detail) */
.hero-carousel {
    position: relative; overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--green-darker), var(--green));
    aspect-ratio: 7 / 3;
    box-shadow: var(--shadow);
}
.hero-slides {
    display: flex; height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slide {
    flex: 0 0 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.hero-slide img {
    width: 100%; height: 100%; object-fit: cover;
}
.hero-slide-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--green-darker), var(--green-light));
    color: var(--white); padding: 40px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
}
.hero-slide-placeholder h2 {
    font-size: clamp(1.6em, 4vw, 2.8em); font-weight: 700;
    margin-bottom: 10px; text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.hero-slide-placeholder p {
    font-size: clamp(0.95em, 1.6vw, 1.15em); opacity: 0.92;
    margin-bottom: 20px;
}
.hero-slide-placeholder .placeholder-note {
    margin-top: 14px; padding: 6px 14px;
    background: rgba(255,255,255,0.15); border-radius: var(--radius-btn);
    font-size: 0.78em; opacity: 0.75;
}

/* Carousel controls */
.hero-prev, .hero-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.85); color: var(--green-dark);
    width: 42px; height: 42px; border-radius: 50%;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1em; box-shadow: var(--shadow);
    transition: all 0.2s; z-index: 5;
}
.hero-prev { left: 14px; }
.hero-next { right: 14px; }
.hero-prev:hover, .hero-next:hover { background: var(--white); transform: translateY(-50%) scale(1.05); }

.hero-dots {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 5;
}
.hero-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.5); border: none;
    cursor: pointer; transition: all 0.2s; padding: 0;
}
.hero-dot.active { background: var(--white); width: 22px; border-radius: 4px; }

/* Side banners — recommended size: 320 × 820 px (auto-stretches to match carousel height) */
.hero-side {
    border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow);
    background: var(--green-soft);
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: var(--green-dark);
    font-size: 0.85em;
    text-decoration: none;
    min-height: 100%;
}
.hero-side:hover { text-decoration: none; }
.hero-side img { width: 100%; height: 100%; object-fit: cover; }
.hero-side .placeholder-note {
    padding: 12px; font-size: 0.78em; opacity: 0.8; line-height: 1.5;
}

/* === Section === */
section { padding: 60px 20px; }
.section-inner { max-width: 1280px; margin: 0 auto; }
.section-title {
    font-size: clamp(1.5em, 3vw, 2em);
    font-weight: 600; margin-bottom: 8px;
    text-align: center;
}
.section-subtitle {
    text-align: center; color: var(--text-light);
    margin-bottom: 40px; font-size: 1.05em;
}

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px; border-radius: var(--radius-btn);
    font-family: inherit; font-size: 0.96em; font-weight: 500;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--white); color: var(--green-dark);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.18); text-decoration: none; }
.btn-outline {
    background: transparent; color: var(--white);
    border: 2px solid var(--white);
}
.btn-outline:hover { background: var(--white); color: var(--green-dark); text-decoration: none; }
.btn-green {
    background: var(--green);
    color: var(--white);
}
.btn-green:hover { background: var(--green-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(76,181,78,0.35); text-decoration: none; }
.btn-line {
    background: #06C755; color: var(--white);
}
.btn-line:hover { background: #05b04a; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(6,199,85,0.35); }

/* === Categories with images === */
/* Recommended size: 400 × 300 px (4:3 ratio) */
.category-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.category-card {
    background: var(--white); border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s; cursor: pointer;
    text-decoration: none; color: var(--text);
    border: 1px solid var(--border-soft);
    display: flex; flex-direction: column;
}
.category-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--green-light); text-decoration: none;
}
.cat-img {
    aspect-ratio: 4 / 3; background: var(--green-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--green); font-size: 2.6em;
    overflow: hidden; position: relative;
}
.cat-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s;
}
.category-card:hover .cat-img img { transform: scale(1.05); }
.cat-body {
    padding: 14px 16px; text-align: center;
    background: var(--white);
}
.cat-body h3 { font-size: 1em; font-weight: 500; }

/* === Product Grid === */
.product-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.product-card {
    background: var(--white); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: all 0.2s; cursor: pointer;
    text-decoration: none; color: var(--text);
    border: 1px solid var(--border-soft);
    display: flex; flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--green-light); text-decoration: none;
}
.product-img {
    aspect-ratio: 1; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-card:hover .product-img img { transform: scale(1.04); }
.product-img-empty { color: var(--text-light); font-size: 3em; }
.product-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.product-cat {
    display: inline-block; font-size: 0.75em;
    background: var(--green-soft); color: var(--green-dark);
    padding: 2px 10px; border-radius: var(--radius-btn);
    margin-bottom: 8px; align-self: flex-start;
}
.product-name {
    font-size: 1em; font-weight: 500; margin-bottom: 6px;
    line-height: 1.3; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    font-size: 1.15em; font-weight: 600; color: var(--green-dark);
    margin-top: 8px;
}
.product-price small { color: var(--text-light); font-weight: 400; font-size: 0.7em; margin-left: 4px; }

/* === Filter Bar === */
.filter-bar {
    background: var(--white); border-radius: var(--radius);
    padding: 16px; margin-bottom: 24px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-soft);
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.search-box {
    flex: 1; min-width: 240px; position: relative;
}
.search-box input {
    width: 100%; padding: 10px 14px 10px 40px;
    border: 1px solid var(--border); border-radius: var(--radius-btn);
    font-family: inherit; font-size: 0.95em;
    background: var(--bg);
}
.search-box input:focus {
    outline: none; border-color: var(--green-light);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(124,201,82,0.15);
}
.search-box i {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); color: var(--text-light);
}
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    padding: 7px 16px; border-radius: var(--radius-btn);
    border: 1px solid var(--border); background: var(--white);
    font-family: inherit; font-size: 0.88em; color: var(--text-mid);
    cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--green-light); color: var(--green-dark); }
.chip.active {
    background: var(--green); color: var(--white); border-color: var(--green);
}

/* === Product Detail === */
.product-detail {
    display: grid; gap: 32px;
    grid-template-columns: 1fr 1fr;
    background: var(--white); border-radius: var(--radius-lg);
    padding: 32px; box-shadow: var(--shadow);
}
.product-detail-img {
    aspect-ratio: 1; background: var(--bg);
    border-radius: var(--radius); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: contain; }
.product-detail h1 { font-size: 1.6em; margin-bottom: 8px; line-height: 1.3; }
.product-detail .product-cat { font-size: 0.85em; padding: 4px 12px; }
.detail-meta {
    margin: 16px 0; padding: 16px 0;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    display: grid; gap: 8px;
}
.detail-meta-row {
    display: flex; gap: 12px; font-size: 0.94em;
}
.detail-meta-row span:first-child {
    color: var(--text-light); min-width: 80px;
}
.detail-price-big {
    font-size: 2em; font-weight: 600; color: var(--green-dark);
    margin: 12px 0;
}
.detail-desc {
    color: var(--text-mid); margin: 16px 0; white-space: pre-wrap;
}
.detail-cta {
    display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap;
}

/* === Why us — refined cards === */
.why-strip {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 36px 28px; box-shadow: var(--shadow);
    display: grid; gap: 0;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.why-item {
    text-align: center;
    padding: 12px 20px;
    border-right: 1px solid var(--border-soft);
}
.why-item:last-child { border-right: none; }
.why-item-num {
    font-size: 2.2em; font-weight: 700;
    color: var(--green);
    line-height: 1; margin-bottom: 6px;
}
.why-item-label {
    font-size: 0.92em; color: var(--text-mid);
    font-weight: 500;
}

/* === Loading / Empty === */
.loading, .empty {
    text-align: center; padding: 60px 20px;
    color: var(--text-light);
}
.empty i { font-size: 3em; margin-bottom: 12px; opacity: 0.5; }
.spinner {
    width: 40px; height: 40px; margin: 0 auto 12px;
    border: 3px solid var(--border-soft);
    border-top-color: var(--green-light);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Footer === */
footer {
    background: #1a1f2c; color: #d1d5db;
    padding: 48px 20px 20px; margin-top: 60px;
}
.footer-inner {
    max-width: 1280px; margin: 0 auto;
    display: grid; gap: 32px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.footer-col h4 {
    color: var(--white); font-size: 1.05em; margin-bottom: 16px; font-weight: 500;
}
.footer-col p, .footer-col li { font-size: 0.9em; line-height: 1.8; }
.footer-col ul { list-style: none; }
.footer-col a { color: #d1d5db; }
.footer-col a:hover { color: var(--green-light); text-decoration: none; }
.footer-col i { margin-right: 8px; color: var(--green-light); width: 16px; }
.footer-bottom {
    max-width: 1280px; margin: 32px auto 0;
    padding-top: 20px; border-top: 1px solid #374151;
    text-align: center; font-size: 0.85em; color: #9ca3af;
}

/* === Floating contact (mobile) === */
.float-contact {
    position: fixed; bottom: 16px; right: 16px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 99;
}
.float-btn {
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--green); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4em; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    text-decoration: none;
    transition: transform 0.2s;
}
.float-btn:hover { transform: scale(1.1); text-decoration: none; }
.float-btn.line { background: #06C755; }
.float-btn.phone { background: var(--green-dark); }

/* === Breadcrumb === */
.breadcrumb {
    max-width: 1280px; margin: 20px auto 0; padding: 0 20px;
    font-size: 0.9em; color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--green-dark); }

/* === Responsive === */
@media (max-width: 992px) {
    .hero-wrap { grid-template-columns: 1fr; }
    .hero-side { display: none; }
    .hero-carousel { aspect-ratio: 16 / 9; }
}
@media (max-width: 768px) {
    .nav-main { display: none; }
    .menu-toggle { display: block; }
    .nav-main.open {
        display: flex; flex-direction: column;
        position: absolute; top: 100%; right: 12px;
        background: var(--white); border-radius: var(--radius);
        box-shadow: var(--shadow-lg); padding: 8px;
        min-width: 200px; gap: 0;
    }
    .nav-main.open a { padding: 12px 16px; border-radius: var(--radius-btn); }
    section { padding: 40px 16px; }
    .product-detail { grid-template-columns: 1fr; padding: 20px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card .product-body { padding: 10px 12px; }
    .product-name { font-size: 0.92em; }
    .product-price { font-size: 1.05em; }
    .why-item { border-right: none; border-bottom: 1px solid var(--border-soft); padding: 16px; }
    .why-item:last-child { border-bottom: none; }
    .hero-prev, .hero-next { width: 36px; height: 36px; }
}
