:root {
    --primary: #0b1a3a;
    --accent: #25d366;
    --bg: #f8fafc;
    --text: #1e293b;
    --orange: #f59e0b;
    --orange-dark: #d97706;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input, a, img { transition: 0.25s ease; }

header {
    background: var(--primary);
    padding: 15px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2000;
    gap: 20px;
}

.logo img { height: 45px; }
.logo img:hover { transform: scale(1.05); }

.search-bar {
    flex: 1;
    max-width: 450px;
    display: flex;
    background: white;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    outline: none;
    font-size: 14px;
}

.search-bar button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar button:hover { background: #162a56; }

.main-nav { display: flex; gap: 20px; align-items: center; }
.main-nav a { color: white; text-decoration: none; font-size: 14px; font-weight: 600; }
.main-nav a:hover { color: var(--orange); }

.header-tools { display: flex; align-items: center; gap: 20px; }
.menu-toggle { color: white; font-size: 22px; display: none; cursor: pointer; }
.cart-trigger { color: white; font-size: 24px; cursor: pointer; position: relative; }

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--orange);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: bold;
    color: white;
}

.btn-orange, .btn-highlight {
    background: var(--orange) !important;
    color: white !important;
    padding: 16px 40px !important;
    border-radius: 999px !important;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto !important;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    border: none;
    cursor: pointer;
}

.btn-orange:hover, .btn-highlight:hover {
    background: var(--orange-dark) !important;
    transform: translateY(-2px);
}

.btn-det, .btn-add {
    flex: 1;
    padding: 12px 10px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    white-space: nowrap;
    min-height: 46px;
}

.btn-det {
    background: #eef2f7;
    color: var(--primary);
}

.btn-det:hover { background: #e2e8f0; }

.btn-add {
    background: var(--primary);
    color: white;
}

.btn-add:hover {
    background: #162a56;
    transform: translateY(-1px);
}

.btn-add:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    transform: none;
}

.swiper { width: 100%; padding-bottom: 46px !important; }
.factory-img { width: 100%; height: 350px; object-fit: cover; border-radius: var(--radius-md); }
.factory-swiper-wrap { overflow: hidden; }

.swiper-button-next, .swiper-button-prev {
    color: var(--primary) !important;
    transform: scale(0.72);
    opacity: 0.75;
    background: rgba(255, 255, 255, 0.9);
    width: 46px !important;
    height: 46px !important;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.swiper-button-next:hover, .swiper-button-prev:hover { opacity: 1; }

.swiper-pagination { bottom: 0 !important; }
.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cbd5e1 !important;
    opacity: 1 !important;
}
.swiper-pagination-bullet-active { background: var(--orange) !important; }

.container { padding: 40px 8%; min-height: 50vh; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 30px rgba(0,0,0,0.1);
}

.card.disabled {
    opacity: 0.5;
    filter: grayscale(1);
    pointer-events: none;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    cursor: pointer;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
}

.card h4, .card h3 {
    font-size: 15px;
    margin: 10px 0;
    min-height: 45px;
    overflow: hidden;
    color: var(--primary);
    font-weight: 600;
}

.sku {
    font-size: 11px;
    color: #94a3b8;
    margin: 4px 0 6px;
    display: block;
    text-align: center;
    letter-spacing: 0.3px;
}

.price-tag {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    margin: 10px 0 15px;
    display: block;
    min-height: 24px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: auto;
    align-items: center;
}

.btn-group .btn-det,
.btn-group .btn-add,
.btn-group .qty-inline-control {
    flex: 1;
}

.qty-inline-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    min-height: 46px;
    text-transform: none;
    border-radius: 999px;
    background: var(--primary);
    color: white;
}

.qty-inline-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    color: white;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-inline-btn:hover {
    background: rgba(255,255,255,0.26);
    transform: scale(1.05);
}

.qty-inline-value {
    min-width: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.clients-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 40px;
    max-width: 900px;
    margin: auto;
    align-items: center;
}

.clients-container img {
    width: 100%;
    filter: grayscale(100%);
    opacity: 0.7;
}

.clients-container img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 8% 0;
}

.filter-btn {
    border: 1px solid #dbe4f0;
    background: white;
    color: var(--primary);
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15,23,42,0.05);
}

.filter-btn:hover {
    border-color: var(--orange);
    color: var(--orange-dark);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 10px 20px rgba(11,26,58,0.2);
}

.sidebar {
    position: fixed !important;
    right: -450px;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh !important;
    background: white;
    z-index: 9999 !important;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
}

.sidebar.active { right: 0 !important; }

.sidebar-header {
    background: var(--primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-clear-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.cart-clear-btn:hover {
    background: var(--orange);
    transform: rotate(-8deg);
}

.sidebar-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.client-form {
    background: #f8fafc;
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-form label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.client-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    outline: none;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.qty-ctrl {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
}

.qty-btn:hover {
    border-color: var(--orange);
    color: var(--orange-dark);
}

.cart-total-container {
    padding: 15px 0;
    border-top: 2px solid var(--primary);
    margin-top: 15px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    color: var(--primary);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.btn-order {
    width: 100%;
    padding: 15px;
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-order:hover { background: var(--orange-dark); }

#revendedor {
    margin-bottom: 0 !important;
    padding-bottom: 80px !important;
}

.main-footer {
    background: var(--primary);
    color: white;
    padding: 60px 8% 30px;
    margin-top: 0 !important;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-logo { height: 40px; margin-bottom: 20px; }

.footer-section h4 {
    margin-bottom: 20px;
    color: var(--orange);
    font-size: 14px;
    text-transform: uppercase;
}

.footer-section p {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.social-links { display: flex; gap: 15px; }

.social-links a {
    color: white;
    font-size: 22px;
}

.social-links a:hover {
    color: var(--orange);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: #94a3b8;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.main-view {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #eee;
}

.thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.thumb-img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    border: 1px solid #ddd;
    cursor: pointer;
    border-radius: 10px;
}

.thumb-img:hover { border-color: var(--primary); }

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25d366;
    color: white !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

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

.mobile-cart-fab {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#cart-count-fab {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--orange);
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 999px;
}

@media (max-width: 992px) {
    header { padding: 15px 5%; }
    .search-bar { max-width: 180px; }

    .main-nav {
        position: absolute;
        top: 100%;
        left: -100%;
        width: 100%;
        background: var(--primary);
        flex-direction: column;
        padding: 20px;
        text-align: center;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }

    .main-nav.active { left: 0; }

    .main-nav a {
        padding: 15px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        width: 100%;
    }

    .menu-toggle { display: block; }
}

@media (max-width: 768px) {
    .mobile-cart-fab { display: flex; }
    .header-tools .cart-trigger { display: none; }
    .modal-content { grid-template-columns: 1fr; }
    .sidebar { width: 100%; right: -100% !important; }
    .sidebar.active { right: 0 !important; }
    .filters { padding-top: 18px; }
    .factory-img { height: 250px; }

    .btn-group {
        flex-direction: column;
    }

    .btn-det,
    .btn-add,
    .qty-inline-control {
        width: 100%;
    }
}