@import url('https://fonts.googleapis.com/css2?family=Epilogue:wght@400;600;700&family=Manrope:wght@400;500;700&display=swap');

:root {
    --bg-color: #131313;
    --text-color: #ffffff;
    --primary-gold: #f2ca50;
    --secondary-gold: #d4af37;
    --accent-gold: #b8860b;
    --card-bg: rgba(255, 255, 255, 0.05);
    --footer-bg: #1a1a1a;
    --font-heading: 'Epilogue', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .heading {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(19, 19, 19, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
}

nav ul {
    display: flex;
    gap: 30px;
}

nav ul li a:hover {
    color: var(--primary-gold);
}

.nav-icons {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
}

.nav-icons i:hover {
    color: var(--primary-gold);
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 150px 0 100px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 70vh;
}

.hero-home {
    background: linear-gradient(rgba(19, 19, 19, 0.75), rgba(19, 19, 19, 0.75)), url('assets/images/hero_home.png');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    text-align: center;
}

.hero-contato {
    background: linear-gradient(rgba(19, 19, 19, 0.75), rgba(19, 19, 19, 0.75)), url('assets/images/hero_contato.png');
    background-size: cover;
    background-position: center;
}

.hero-produtos {
    background: linear-gradient(rgba(19, 19, 19, 0.75), rgba(19, 19, 19, 0.75)), url('assets/images/hero_produtos.png');
    background-size: cover;
    background-position: center;
}

.hero-servicos {
    background: linear-gradient(rgba(19, 19, 19, 0.75), rgba(19, 19, 19, 0.75)), url('assets/images/hero_servicos.png');
    background-size: cover;
    background-position: center;
}

.hero-sobre {
    background: linear-gradient(rgba(19, 19, 19, 0.75), rgba(19, 19, 19, 0.75)), url('assets/images/hero_sobre.png');
    background-size: cover;
    background-position: center;
}


.hero-home .container {
    justify-content: center;
}

.hero-home .hero-content {
    max-width: 1200px;
}

.hero-home h1 {
    font-size: 3.2rem;
    line-height: 1.2;
}

.hero-content {
    flex: 1;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--primary-gold);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-image img {
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.btn-gold {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(45deg, var(--secondary-gold), var(--primary-gold));
    color: #000;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
}

.btn-gold:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(242, 202, 80, 0.3);
}

/* Wavy Transition */
.wave-container {
    position: relative;
    height: 100px;
    background: var(--bg-color);
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%23f2ca50" fill-opacity="1" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-repeat: no-repeat;
}

/* Sections */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-title .underline {
    width: 80px;
    height: 4px;
    background: var(--primary-gold);
    margin: 0 auto;
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0; /* Changed to 0 for better image fitting */
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(242, 202, 80, 0.1);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-gold);
    background: rgba(242, 202, 80, 0.05);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 0;
}

.card-content {
    padding: 20px;
}

.card h3 {
    margin-bottom: 10px;
    color: var(--primary-gold);
    font-size: 1.1rem;
    text-transform: none; /* Keep name case as in DB */
}

.card .stock-badge {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 600;
}

.card .price {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

.no-products, .error-msg {
    text-align: center;
    grid-column: 1 / -1;
    padding: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px dashed var(--primary-gold);
}

.delivery-notice {
    background: rgba(242, 202, 80, 0.1);
    border-left: 4px solid var(--primary-gold);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.delivery-notice i {
    font-size: 1.5rem;
    color: var(--primary-gold);
}

.delivery-notice p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    padding: 80px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h4 {
    margin-bottom: 25px;
    color: var(--primary-gold);
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a:hover {
    padding-left: 5px;
    color: var(--primary-gold);
}

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

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--primary-gold);
    color: #000;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8rem;
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-home {
        padding-top: 150px;
    }
    
    nav {
        display: none; /* Add mobile menu later */
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal-content {
    background-color: #111;
    margin: 50px auto;
    padding: 40px;
    border: 1px solid var(--primary-gold);
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 40px rgba(242, 202, 80, 0.2);
}

.close-modal {
    color: #fff;
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-gold);
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    color: var(--primary-gold);
    margin-bottom: 10px;
    font-size: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #bbb;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-gold);
    outline: none;
    background: #222;
}

/* File Drop Area */
.file-drop-area {
    position: relative;
    display: flex;
    align-items: center;
    padding: 25px;
    border: 2px dashed #333;
    border-radius: 12px;
    background: #1a1a1a;
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    justify-content: center;
}

.file-drop-area:hover {
    border-color: var(--primary-gold);
    background: #222;
}

.fake-btn {
    flex-shrink: 0;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 8px 15px;
    margin-right: 15px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
}

.file-msg {
    font-size: 0.85rem;
    color: #888;
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
    opacity: 0;
}

.quote-summary {
    background: rgba(242, 202, 80, 0.05);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(242, 202, 80, 0.2);
    text-align: center;
}

.quote-summary p {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-gold);
}

.quote-summary small {
    color: #666;
    display: block;
    margin-top: 5px;
}

/* ═══════════════════════════════════════
   CART SYSTEM
═══════════════════════════════════════ */

/* Badge no ícone do carrinho */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary-gold);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Overlay escuro */
#cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#cart-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* Drawer lateral */
#cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 95vw;
    height: 100vh;
    background: #111;
    border-left: 1px solid rgba(242, 202, 80, 0.2);
    z-index: 3100;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

#cart-drawer.open {
    right: 0;
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cart-drawer-header h3 {
    color: var(--primary-gold);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
}
.cart-close-btn:hover { color: var(--primary-gold); }

/* Lista de itens */
.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-items-list::-webkit-scrollbar { width: 4px; }
.cart-items-list::-webkit-scrollbar-track { background: #1a1a1a; }
.cart-items-list::-webkit-scrollbar-thumb { background: var(--primary-gold); border-radius: 2px; }

.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555;
    padding: 40px;
    text-align: center;
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #333;
}

.cart-empty p { font-size: 1rem; color: #666; margin-bottom: 5px; }
.cart-empty small { font-size: 0.8rem; }

/* Card de item */
.cart-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.cart-item:hover { border-color: rgba(242, 202, 80, 0.3); }

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cart-item-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-gold);
    font-weight: 700;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.cart-item-price {
    font-size: 0.8rem;
    color: #888;
}

.cart-item-subtotal {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-gold);
    text-align: right;
}

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

.qty-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: var(--primary-gold); color: #000; }

.qty-val {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.remove-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 4px 6px;
}

.remove-btn:hover { color: #e74c3c; }

/* Footer do carrinho */
.cart-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 700;
    font-size: 1rem;
}

.cart-total-row span:last-child {
    color: var(--primary-gold);
    font-size: 1.1rem;
}

.cart-total-row small {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
}

.btn-checkout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
}

.btn-clear-cart {
    background: none;
    border: none;
    color: #555;
    font-size: 0.75rem;
    text-align: center;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-clear-cart:hover { color: #e74c3c; }

/* Toast de feedback */
#cart-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
}

#cart-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Checkout box */
.checkout-box {
    background: #111;
    border: 1px solid rgba(242, 202, 80, 0.3);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 0 60px rgba(242, 202, 80, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.checkout-summary {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.checkout-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #ccc;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.checkout-summary-item:last-child { border-bottom: none; }

/* Botão "Adicionar ao Carrinho" nos cards */
.btn-add-cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: transparent;
    border: 1.5px solid var(--primary-gold);
    color: var(--primary-gold);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-body);
}

.btn-add-cart:hover {
    background: var(--primary-gold);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(242, 202, 80, 0.25);
}

@media (max-width: 480px) {
    #cart-drawer { width: 100vw; }
    .checkout-box { padding: 25px 20px; }
}

/* Toast de erro (limite de estoque) */
#cart-toast.toast-error {
    background: #2a1010;
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Badge "Máx" no controle de quantidade */
.stock-limit-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
}
