/* =====================================================
   JNM Wholesale - Frontend Styles
   Theme: Light Blue + Red (matching logo)
   ===================================================== */

:root {
    --primary: #2196F3;        /* Light blue from logo */
    --primary-dark: #1976D2;
    --primary-light: #E3F2FD;
    --accent: #E53935;         /* Red from logo */
    --accent-dark: #C62828;
    --accent-light: #FFEBEE;
    --dark: #263238;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gradient-primary: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    --gradient-hero: linear-gradient(135deg, rgba(33,150,243,0.95) 0%, rgba(21,101,192,0.95) 100%);
}

* { box-sizing: border-box; }

body {
    font-family: 'Prompt', 'Segoe UI', Tahoma, sans-serif;
    color: var(--dark);
    background: #fff;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent); }

.btn { font-weight: 500; border-radius: 8px; padding: 0.5rem 1.2rem; }
.btn-lg { padding: 0.7rem 1.6rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: var(--accent); border-color: var(--accent); }
.btn-danger:hover, .btn-danger:focus { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-success { background: #06C755; border-color: #06C755; }
.btn-success:hover { background: #05a347; border-color: #05a347; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* Top Bar */
.top-bar {
    background: var(--primary-dark);
    color: white;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}
.top-bar a { color: white; text-decoration: none; }
.top-bar a:hover { color: #ffd; }

/* Navbar */
.navbar { padding: 0.6rem 0; border-bottom: 3px solid var(--primary); }
.navbar-brand { display: flex; align-items: center; }
.brand-text { line-height: 1.1; }
.brand-name { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.brand-subtitle { font-size: 0.75rem; color: var(--primary); font-weight: 500; }
.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--dark);
    padding: 0.5rem 1rem !important;
    position: relative;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--primary);
}
.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}
.btn-contact-nav { color: white; font-weight: 500; }

/* New Homepage Banner */
.main-banner {
    background-color: var(--gray-200);
    position: relative;
    border-bottom: 5px solid var(--primary);
    line-height: 0; /* Remove potential gap below image */
}
.main-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* New Hero Intro Section (Below Banner) */
.hero-intro {
    background: white;
    padding: 4rem 0;
    position: relative;
}
.hero-intro h1 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 2.8rem;
}
.hero-intro .lead {
    color: var(--gray-600);
    max-width: 800px;
    margin: 0 auto 2.5rem;
}
.hero-intro .hero-badge {
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
    border: 1px solid rgba(229, 57, 53, 0.2);
}

.hero-banner { display: none; } /* Hide old one */

/* Sections */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 3px;
    background: var(--accent);
    border-radius: 3px;
}
.section-title.text-start { text-align: left; }
.section-title.text-start::after { left: 0; transform: none; }

/* Feature Box */
.feature-box {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    height: 100%;
    transition: 0.3s;
    border: 2px solid transparent;
}
.feature-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(33,150,243,0.15);
}
.feature-icon {
    width: 70px; height: 70px;
    margin: 0 auto 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* Category Card */
.category-card {
    display: block;
    background: white;
    padding: 2rem 1rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--gray-200);
    transition: 0.3s;
    color: var(--dark);
    height: 100%;
}
.category-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-3px);
}
.category-card:hover .category-icon {
    background: var(--accent);
    color: white;
}
.category-icon {
    width: 80px; height: 80px;
    margin: 0 auto 1rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    transition: 0.3s;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.product-img-wrap {
    display: block;
    position: relative;
    aspect-ratio: 1;
    background: var(--gray-100);
    overflow: hidden;
}
.product-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: 0.3s;
}
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.no-image, .no-image-large {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-200);
    font-size: 3rem;
    background: var(--gray-100);
}
.no-image-large { font-size: 6rem; aspect-ratio: 1; }
.product-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.product-title { margin: 0.3rem 0; font-size: 1rem; font-weight: 500; flex: 1; }
.product-title a { color: var(--dark); }
.product-title a:hover { color: var(--primary); }
.product-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}
.badge-featured {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 2;
}

/* Page Header */
.page-header {
    background: var(--gradient-primary);
    color: white;
    padding: 3rem 0;
    text-align: center;
}
.page-header h1 { font-weight: 700; margin-bottom: 0.5rem; }
.breadcrumb-light .breadcrumb-item { color: rgba(255,255,255,0.8); }
.breadcrumb-light .breadcrumb-item a { color: white; text-decoration: none; }
.breadcrumb-light .breadcrumb-item.active { color: white; font-weight: 500; }
.breadcrumb-light .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.6); }
.breadcrumb { justify-content: center; margin-bottom: 0; background: transparent; }

/* Vision Mission Cards */
.vm-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    height: 100%;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.vm-card:nth-child(2), .vm-card.alt { border-left-color: var(--accent); }
.col-md-6:nth-child(2) .vm-card { border-left-color: var(--accent); }
.vm-icon {
    width: 60px; height: 60px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.col-md-6:nth-child(2) .vm-icon { background: var(--accent-light); color: var(--accent); }

/* Strength */
.strength-item { padding: 1.5rem; }
.strength-num {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* Catalog Sidebar */
.catalog-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
}
/* Custom scrollbar สำหรับ sidebar */
.catalog-sidebar::-webkit-scrollbar { width: 5px; }
.catalog-sidebar::-webkit-scrollbar-track { background: transparent; }
.catalog-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.catalog-sidebar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.catalog-sidebar { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.category-list { margin-bottom: 0; }
.category-list > li { margin-bottom: 0.3rem; }

/* ลิงก์เดี่ยว — ปุ่ม "ทั้งหมด" และรายการแบรนด์ */
.category-list > li > a {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    color: var(--dark);
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.category-list > li > a:hover {
    background: var(--gray-100);
    color: var(--primary);
}
.category-list > li > a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(33,150,243,0.28);
}

/* แถวหมวดหมู่หลัก (รองรับดรอปดาวน์หมวดย่อย) */
.cat-item { border-radius: 10px; }
.cat-row {
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}
.cat-row:hover { background: var(--gray-100); }
.cat-row.active {
    background: var(--primary);
    box-shadow: 0 6px 14px rgba(33,150,243,0.28);
}
.cat-link {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.6rem 0.35rem 0.6rem 0.75rem;
    color: var(--dark);
    border-radius: 10px 0 0 10px;
    transition: color 0.18s ease;
}
.cat-link > .bi { flex: 0 0 auto; font-size: 1.05rem; }
.cat-row:hover .cat-link { color: var(--primary); }
.cat-row.active .cat-link { color: #fff; font-weight: 600; }

/* ชื่อหมวดหมู่/แบรนด์ — ตัดข้อความถ้ายาวเกิน */
.cat-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ปุ่มลูกศรเปิด/ปิดดรอปดาวน์ */
.cat-toggle {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin: auto 0.35rem auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
}
.cat-toggle:hover { color: var(--primary); background: rgba(33,150,243,0.12); }
.cat-row.active .cat-toggle { color: rgba(255,255,255,0.9); }
.cat-row.active .cat-toggle:hover { background: rgba(255,255,255,0.22); color: #fff; }
.cat-toggle .bi {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}
.cat-item.open .cat-toggle .bi { transform: rotate(90deg); }

/* ป้ายตัวเลขจำนวนสินค้า */
.cat-count {
    flex: 0 0 auto;
    margin-left: 0.45rem;
    min-width: 1.8rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    color: var(--gray-600);
    background: var(--gray-200);
    border-radius: 999px;
    transition: background 0.18s ease, color 0.18s ease;
}
.category-list > li > a:hover .cat-count,
.cat-row:hover .cat-count {
    background: #fff;
    color: var(--primary);
}
.category-list > li > a.active .cat-count,
.cat-row.active .cat-count {
    background: #fff;
    color: var(--primary);
}
.cat-count-sub {
    font-size: 0.68rem;
    min-width: 1.65rem;
    background: var(--gray-100);
}

/* รายการหมวดหมู่ย่อย + อนิเมชันดรอปดาวน์ */
.sub-category-list {
    position: relative;
    margin: 0.15rem 0 0.35rem 0.95rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--gray-200);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.32s ease, opacity 0.28s ease;
}
.cat-item.open .sub-category-list { opacity: 1; }
.sub-category-list > li { margin-bottom: 0.12rem; }
.sub-category-list li a {
    display: flex;
    align-items: center;
    padding: 0.42rem 0.55rem;
    color: var(--gray-600);
    font-size: 0.86rem;
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease;
}
.sub-category-list li a:hover {
    background: var(--gray-100);
    color: var(--primary);
}
.sub-category-list li a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}
.sub-category-list li a:hover .cat-count,
.sub-category-list li a.active .cat-count {
    background: var(--primary);
    color: #fff;
}
.sub-category-list .sub-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sub-category-list .dash-marker { display: none; }

/* ตัวเลขจำนวนสินค้าบนการ์ดแบรนด์ */
.brand-card-count {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--gray-600);
}

/* Brand Cards */
.brand-card {
    display: block;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
    color: var(--dark);
}
.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    color: var(--primary);
}
.brand-logo-wrap {
    background: var(--gray-100);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.brand-logo-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.brand-logo-wrap .no-image {
    width: 100%;
    height: 100%;
    background: transparent;
    color: var(--gray-400);
    aspect-ratio: auto;
}

/* Product Detail */
.product-detail-img {
    background: var(--gray-100);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}
.product-detail-desc {
    color: var(--gray-600);
    line-height: 1.8;
}

/* Contact Channels */
.contact-channel-card {
    display: block;
    background: white;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--gray-200);
    text-decoration: none;
    color: var(--dark);
    height: 100%;
    transition: 0.3s;
}
.contact-channel-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    color: var(--dark);
}
.cc-icon {
    width: 60px; height: 60px;
    margin: 0 auto 0.8rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 1.6rem;
}
.cc-call { background: var(--primary); }
.cc-line { background: #06C755; }
.cc-fb { background: #1877F2; }
.cc-email { background: var(--accent); }

.contact-form-wrap, .contact-info-wrap {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 100%;
}
.form-control, .form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(33,150,243,0.15);
}

.contact-list li {
    display: flex; gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.contact-list li:last-child { border: 0; }
.contact-list i {
    width: 40px; height: 40px;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

.map-wrap iframe { border-radius: 12px; width: 100%; }

/* CTA */
.cta-section {
    background: var(--gradient-primary);
    padding: 4rem 0;
    color: white;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0 1.5rem;
}
.footer-links li, .footer-contact li {
    padding: 0.3rem 0;
    color: rgba(255,255,255,0.75);
}
.footer-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: 0.2s;
}
.footer-links a:hover { color: var(--accent); padding-left: 5px; }
.btn-social {
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
}
.btn-fb { background: #1877F2; }
.btn-fb:hover { background: #0c63d4; color: white; }
.btn-line { background: #06C755; }
.btn-line:hover { background: #05a347; color: white; }

/* Floating Contact */
.floating-contact {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    flex-direction: column;
    gap: 10px;
}
.float-btn {
    width: 55px; height: 55px;
    border-radius: 50%;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: 0.3s;
}
.float-btn:hover { transform: scale(1.1); color: white; }
.float-call { background: var(--primary); }
.float-line { background: #06C755; }
.float-fb { background: #1877F2; }

/* About image */
.about-image-wrap img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Catalog Online Button */
.btn-catalog-online {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #FF9800 0%, #F44336 100%);
    color: white !important;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(244, 67, 54, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    animation: pulse-gold 2s infinite;
}

.btn-catalog-online:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(244, 67, 54, 0.4);
    color: white !important;
}

.btn-catalog-online i {
    font-size: 1.8rem;
}

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-banner { padding: 3rem 0; }
    .hero-banner h1 { font-size: 1.6rem; }
    .section-title { font-size: 1.5rem; }
    .floating-contact { bottom: 15px; right: 15px; }
    .float-btn { width: 50px; height: 50px; font-size: 1.2rem; }
    .navbar-brand img { height: 45px !important; }
    .brand-name { font-size: 1.1rem; }
    .brand-subtitle { font-size: 0.7rem; }
    .product-detail-price { font-size: 1.5rem; }
    .btn-catalog-online { padding: 1rem 1.5rem; font-size: 1rem; width: 100%; justify-content: center; }
}
