/* ============================================
   VARIÁVEIS E RESET
   ============================================ */

:root {
    --primary: #f39c12;
    --primary-dark: #d68910;
    --secondary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --border: #bdc3c7;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ============================================
   MODAIS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.modal-active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MODAL LEAD */
.modal-lead {
    max-width: 450px;
}

.modal-header {
    padding: 40px 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--light);
}

.modal-header h2 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 700;
}

.modal-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.lead-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.volume-message {
    background: #fff3cd;
    border-left: 4px solid var(--primary);
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 20px;
    display: none;
}

.form-footer {
    font-size: 12px;
    color: #95a5a6;
    text-align: center;
    margin-top: 15px;
}

/* MODAL PROMOÇÃO */
.modal-promo {
    max-width: 500px;
    text-align: center;
    padding: 50px 30px;
}

.promo-badge-large {
    font-size: 80px;
    color: var(--primary);
    margin-bottom: 20px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.modal-promo h2 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.modal-promo p {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.6;
}

.promo-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.promo-details div {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
}

.promo-details div:last-child {
    margin-bottom: 0;
}

.promo-details i {
    color: var(--primary);
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
}

/* MODAL CONVERSÕES */
.modal-conversions {
    max-width: 700px;
}

.modal-conversions h2 {
    padding: 30px 30px 20px;
    border-bottom: 1px solid var(--light);
    font-size: 22px;
}

.conversions-table-wrapper {
    padding: 20px 30px;
    max-height: 400px;
    overflow-y: auto;
}

.conversions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.conversions-table thead {
    background: #f8f9fa;
}

.conversions-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--light);
}

.conversions-table td {
    padding: 12px;
    border-bottom: 1px solid var(--light);
}

.conversions-table tbody tr:hover {
    background: #f8f9fa;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #95a5a6;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: #0a192f; /* Azul escuro combinando com a logo */
    color: white;
    padding: 10px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid #c5a059; /* Dourado da logo */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    height: 60px; /* Altura fixa para o cabeçalho */
}

.logo-img {
    height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.promo-badge {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.cart-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-container {
    margin-bottom: 40px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.search-wrapper i {
    position: absolute;
    left: 15px;
    color: #95a5a6;
    font-size: 18px;
}

.search-wrapper input {
    flex: 1;
    padding: 15px 15px 15px 45px;
    border: none;
    font-size: 15px;
    outline: none;
}

.filter-count {
    padding: 0 20px;
    color: #95a5a6;
    font-size: 13px;
    white-space: nowrap;
}

/* FEATURES */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 10px;
}

.feature span {
    display: block;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

/* CATALOG */
.catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px; /* Aumentado de 180px para 200px */
    background: #ffffff; /* Mudado de gradiente cinza para branco puro */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%; /* Aumentado de 90% para 100% */
    max-height: 100%; /* Aumentado de 90% para 100% */
    object-fit: contain;
    padding: 5px; /* Pequeno respiro para não encostar nas bordas */
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.product-content {
    padding: 15px;
}

.product-name {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 5px;
}

.product-code {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.product-price {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 3px;
}

.product-price-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.quantity-control button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--dark);
    font-weight: 700;
    transition: var(--transition);
}

.quantity-control button:hover {
    color: var(--primary);
}

.quantity-value {
    font-weight: 600;
    color: var(--dark);
}

.btn-add {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
    margin-bottom: 8px;
}

.btn-add:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.btn-conversions {
    width: 100%;
    padding: 8px;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: var(--transition);
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 80px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: #95a5a6;
}

/* ============================================
   CART SIDEBAR
   ============================================ */

.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100%; /* Mudado de 100vh para 100% para melhor compatibilidade mobile */
    background: white;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--secondary) 0%, #34495e 100%);
    color: white;
}

.cart-header h3 {
    font-size: 18px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.empty-cart i {
    font-size: 60px;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.empty-cart p {
    font-weight: 600;
    margin-bottom: 5px;
}

.empty-cart small {
    font-size: 12px;
}

.cart-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-info {
    flex: 1;
}

.cart-item-code {
    font-weight: 700;
    color: var(--dark);
    font-size: 14px;
}

.cart-item-qty {
    font-size: 12px;
    color: #95a5a6;
}

.cart-item-controls {
    display: flex;
    gap: 8px;
}

.cart-item-controls button {
    background: white;
    border: 1px solid var(--light);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.cart-item-controls button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cart-summary {
    padding: 12px 20px; /* Reduzido de 20px vertical para 12px */
    border-top: 1px solid var(--light);
    background: #f8f9fa;
    flex-shrink: 0; /* Impede que o resumo encolha */
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px; /* Reduzido de 12px para 6px */
    font-size: 14px;
}

.summary-row strong {
    color: var(--dark);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 2px solid var(--light);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.cart-footer {
    padding: 15px;
    border-top: 1px solid var(--light);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    flex-shrink: 0; /* Garante que o rodapé não encolha */
    padding-bottom: env(safe-area-inset-bottom, 15px); /* Suporte para áreas seguras em dispositivos modernos */
}

.payment-methods {
    margin-bottom: 10px; /* Reduzido para economizar espaço vertical */
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 8px; /* Reduzido de 10px para 8px */
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 5px; /* Reduzido de 8px para 5px */
    transition: var(--transition);
}

.payment-option:hover {
    background: #ecf0f1;
}

.payment-option input {
    margin-right: 10px;
    cursor: pointer;
}

.payment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.payment-hint {
    font-size: 12px;
    color: #95a5a6;
    margin-bottom: 15px;
    font-style: italic;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-lg {
    padding: 10px 15px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

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

.btn-success:hover {
    background: #229954;
    transform: scale(1.02);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    width: auto;
    align-self: center;
    min-width: 120px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* ============================================
   NOTIFICAÇÕES
   ============================================ */

.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 500;
    max-width: 350px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-volume {
    border-left: 4px solid var(--primary);
}

.notification-content {
    display: flex;
    gap: 15px;
}

.notification-content i {
    font-size: 24px;
    color: var(--primary);
}

.notification-content h4 {
    margin: 0 0 5px 0;
    color: var(--dark);
    font-size: 15px;
}

.notification-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 13px;
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.notification-close:hover {
    color: var(--danger);
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .catalog {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
        height: 100%; /* Garante altura total em dispositivos móveis */
    }

    .features {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding: 10px 5px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .features::-webkit-scrollbar {
        display: none;
    }

    .feature {
        flex: 0 0 160px;
    }

    .modal-content {
        width: 95%;
    }

    .header-container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-wrapper {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .catalog {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 20px 15px;
    }

    .notification {
        bottom: 15px;
        right: 15px;
        left: 15px;
        max-width: none;
    }

    .modal-header h2 {
        font-size: 22px;
    }

    .modal-promo h2 {
        font-size: 24px;
    }
}

/* ESTILOS DE PREÇO PROMOCIONAL */
.preco-antigo {
  color: #999; /* cinza */
  text-decoration: line-through; /* risco */
  font-size: 0.9em;
  margin-bottom: 2px;
}

.preco-novo {
  color: #000; /* preto */
  font-weight: bold;
  font-size: 1.2em;
}

/* ADESIVO DE DESCONTO PIX */
.pix-discount-badge {
    background-color: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
    animation: pulse 2s infinite;
}

.price-container {
    margin: 10px 0;
    min-height: 50px;
}

/* MODAL QUANTIDADE PERSONALIZADA */
.modal-quantity {
    max-width: 400px;
}

.quantity-input-wrapper {
    padding: 30px;
    text-align: center;
}

.quantity-input-wrapper label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--dark);
}

.custom-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.custom-qty-control button {
    background: var(--light);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.custom-qty-control button:hover {
    background: var(--border);
}

.custom-qty-control input {
    width: 100px;
    text-align: center;
    padding: 10px;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid var(--primary);
    border-radius: 8px;
}

.qty-hint {
    font-size: 12px;
    color: #666;
}

.modal-actions {
    padding: 0 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
