:root {
    --primary: #1e3a5f;
    --primary-dark: #152a45;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --gray-bg: #f4f6f9;
    --text-muted: #6b7280;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
    color: #1f2937;
    line-height: 1.6;
}

/* Header */
.site-header .navbar {
    background: var(--primary);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.brand-icon {
    background: var(--accent);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.25rem;
    font-size: 0.85em;
}

.nav-link { font-weight: 500; font-size: 0.95rem; }
.nav-link.active { color: var(--accent) !important; }

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.bg-accent { background: var(--accent) !important; }

/* Hero */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #2d4a6f 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="%231e3a5f" width="100" height="100"/><circle fill="%23ffffff08" cx="80" cy="20" r="40"/><circle fill="%23ffffff05" cx="20" cy="80" r="30"/></svg>');
    background-size: cover;
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
}

.min-vh-75 { min-height: 75vh; }

.hero-title {
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-subtitle { max-width: 600px; }

/* Advantages */
.advantage-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--gray-bg);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.advantage-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.advantage-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.advantage-card h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

/* Sections */
.section-title {
    font-weight: 700;
    color: var(--primary);
}

.section-gray { background: var(--gray-bg); }

.page-header {
    background: var(--primary);
    color: #fff;
    padding: 3rem 0 2rem;
}

.page-header h1 { font-weight: 700; margin: 0; }

.breadcrumb-light .breadcrumb-item a { color: rgba(255,255,255,0.7); }
.breadcrumb-light .breadcrumb-item.active { color: #fff; }

/* Categories */
.category-card {
    display: block;
    text-align: center;
    padding: 2rem 1rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    color: var(--primary);
}

.category-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.category-icon { font-size: 2.5rem; margin-bottom: 0.75rem; color: var(--accent); }
.category-card h5 { font-size: 0.95rem; font-weight: 600; color: #1f2937; }

/* Products */
.product-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.product-img-wrap {
    display: block;
    height: 200px;
    overflow: hidden;
    background: var(--gray-bg);
}

.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-img-wrap img { transform: scale(1.05); }

.product-sku { font-family: monospace; }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Factory section */
.factory-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.factory-feature {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.factory-feature i { color: var(--accent); margin-right: 0.5rem; }

.factory-visual { position: relative; }

.cert-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cert-badge {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.video-placeholder {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    color: rgba(255,255,255,0.8);
    border: 2px dashed rgba(255,255,255,0.2);
}

.video-placeholder i { font-size: 4rem; display: block; margin-bottom: 1rem; }

.client-logo-placeholder {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Banner carousel */
.banner-img { max-height: 400px; object-fit: cover; }

/* Filter sidebar */
.filter-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.filter-list li { margin-bottom: 0.5rem; }
.filter-list a {
    color: #4b5563;
    text-decoration: none;
    display: block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
}
.filter-list a:hover, .filter-list a.active {
    background: var(--primary);
    color: #fff;
}

/* Product detail */
.main-product-img { max-height: 450px; width: 100%; object-fit: contain; background: var(--gray-bg); }
.thumb-img { cursor: pointer; border: 2px solid transparent; }
.thumb-img:hover { border-color: var(--accent); }

.spec-table th { width: 35%; background: var(--gray-bg); }

.placeholder-img-lg {
    height: 400px;
    background: var(--gray-bg);
}

/* About */
.about-img-placeholder {
    height: 300px;
    background: var(--gray-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.about-img-placeholder i { font-size: 4rem; margin-bottom: 1rem; }

.team-card { text-align: center; }
.team-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
    color: var(--text-muted);
}

/* Contact */
.contact-info-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.contact-info-list i {
    color: var(--accent);
    margin-right: 0.75rem;
    width: 20px;
}

.map-container { min-height: 400px; background: var(--gray-bg); }

/* Footer */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 2rem;
}

.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

.footer-icp-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}
.footer-icp-link:hover {
    color: rgba(255,255,255,0.75);
}

/* Chat widget */
.kbm-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
}

.chat-launcher {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #2d4a6f);
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 4px 24px rgba(30, 58, 95, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.chat-launcher:hover {
    transform: scale(1.06);
    color: #fff;
}

.chat-launcher.is-active {
    background: #374151;
}

.chat-launcher .launcher-icon-close { display: none; }
.chat-launcher.is-active .launcher-icon-open { display: none; }
.chat-launcher.is-active .launcher-icon-close { display: block; font-size: 1.25rem; }

.whatsapp-launcher {
    background: #25d366;
    box-shadow: 0 4px 20px rgba(37,211,102,0.5);
    font-size: 2rem;
}

.chat-panel {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.chat-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-panel-header {
    background: linear-gradient(135deg, var(--primary), #2d4a6f);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-panel-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.chat-panel-header strong {
    display: block;
    font-size: 0.95rem;
}

.chat-status {
    font-size: 0.75rem;
    opacity: 0.85;
}

.chat-status .bi-circle-fill {
    color: #4ade80;
    font-size: 0.5rem;
    margin-right: 0.25rem;
}

.chat-panel-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-panel-body {
    padding: 1rem 1.25rem 1.25rem;
    max-height: 420px;
    overflow-y: auto;
}

.chat-bubble-agent {
    background: var(--gray-bg);
    color: #374151;
    padding: 0.75rem 1rem;
    border-radius: 12px 12px 12px 4px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.chat-form .form-control {
    border-radius: 8px;
    font-size: 0.875rem;
}

.chat-whatsapp-fallback {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-panel-success {
    padding: 2rem 1.5rem;
    text-align: center;
}

.chat-panel-success i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.chat-panel-success p {
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 1rem;
}

.chat-thread {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-bubble-user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    padding: 0.65rem 0.9rem;
    border-radius: 12px 12px 4px 12px;
    font-size: 0.875rem;
    max-width: 88%;
    line-height: 1.5;
}

.chat-bubble-agent-human {
    align-self: flex-start;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 0.65rem 0.9rem;
    border-radius: 12px 12px 12px 4px;
    font-size: 0.875rem;
    max-width: 92%;
    line-height: 1.5;
}

.chat-composer {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
}

.chat-composer-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.chat-composer-row textarea {
    flex: 1;
    resize: none;
    border-radius: 8px;
    font-size: 0.875rem;
    min-height: 42px;
}

.chat-composer-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-composer-actions .btn {
    flex: 1;
    font-size: 0.8rem;
}

.chat-ai-badge {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* Legacy WhatsApp float (fallback) */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(37,211,102,0.5);
    z-index: 9999;
    transition: transform 0.2s;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-section { min-height: 400px; }
    .chat-panel { width: calc(100vw - 32px); right: -8px; }
    .kbm-chat-widget { bottom: 16px; right: 16px; }
}
