/* --- GERAL --- */
:root {
    --afgs-red: #dc3545;
    --afgs-red-dark: #b02a37;
    --afgs-bg: #0d0d0d;
    --afgs-card: rgba(255,255,255,0.06);
    --afgs-border: rgba(255,255,255,0.12);
}

body {
    background: #0a0a0a;
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(220, 53, 69, 0.12), transparent);
    color: #fff;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- HEADER E LOGO --- */
.header-ecommerce .navbar-custom {
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--afgs-border);
    padding: 0.5rem 0;
}

.brand-ecommerce {
    color: white;
    transition: opacity 0.2s;
}
.brand-ecommerce:hover { color: white; opacity: 0.9; }

.logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text { line-height: 1.2; }
.brand-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-name-light { font-weight: 400; opacity: 0.9; }
.brand-tagline { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.5); font-weight: 400; margin-top: 2px; }

@media (min-width: 768px) {
    .logo-wrap { width: 56px; height: 56px; }
    .brand-name { font-size: 1.5rem; }
    .brand-tagline { font-size: 0.8rem; }
}

/* --- CARDS DE PRODUTO --- */
.col-produto { display: flex; justify-content: center; }

.card-produto {
    background: var(--afgs-card);
    border: 1px solid var(--afgs-border);
    border-radius: 16px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
    overflow: hidden;
}
.card-produto:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
    border-color: rgba(220, 53, 69, 0.3);
}

.card-produto img.card-img-top {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0;
}
.card-img-link { display: block; overflow: hidden; }
.card-img-link img { transition: transform 0.35s ease; }
.card-produto:hover .card-img-link img { transform: scale(1.05); }

.card-produto .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem 1.1rem;
}
.card-title-prod { font-size: 1rem; color: #fff; }
.preco-produto { font-size: 1.2rem; font-weight: 700; color: #22c55e; }

.btn-fav {
    background: rgba(0,0,0,0.5) !important;
    color: #f87171 !important;
    backdrop-filter: blur(6px);
}
.btn-fav:hover { background: rgba(0,0,0,0.7) !important; color: #fff !important; }

.card-encomenda {
    background: linear-gradient(145deg, rgba(255,193,7,0.08) 0%, var(--afgs-card) 100%);
    border: 1px solid rgba(255,193,7,0.25);
}
.card-encomenda:hover { border-color: rgba(255,193,7,0.5); }
.card-encomenda .card-encomenda-img { border-radius: 0; }

/* --- HERO / CARROSSEL --- */
.hero-banner { background: #0a0a0a; }
.carousel-ecommerce .carousel-inner { border-radius: 16px; overflow: hidden; }
.carousel-ecommerce .carousel-indicators button {
    width: 10px; height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.4);
    border: none;
    margin: 0 4px;
}
.carousel-ecommerce .carousel-indicators button.active { background-color: var(--afgs-red); }
.carousel-ecommerce .carousel-control-prev,
.carousel-ecommerce .carousel-control-next {
    width: 48px; height: 48px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    top: 50%; transform: translateY(-50%);
    opacity: 0.8;
}
.carousel-ecommerce .carousel-control-prev { left: 1rem; }
.carousel-ecommerce .carousel-control-next { right: 1rem; }
.carousel-ecommerce .carousel-control-prev:hover,
.carousel-ecommerce .carousel-control-next:hover { opacity: 1; }

.hero-placeholder { background: linear-gradient(180deg, rgba(220,53,69,0.06) 0%, transparent 60%); }
.hero-placeholder .logo-wrap { border: 2px solid var(--afgs-border); }

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 200px;
}
@media (min-width: 640px) {
    .carousel-img {
        max-width: 1280px;
        max-height: 420px;
        margin-left: auto;
        margin-right: auto;
        display: block;
        border-radius: 12px;
    }
}

/* --- BUSCA E SEÇÃO --- */
.search-bar-ecommerce {
    background: var(--afgs-card);
    border: 1px solid var(--afgs-border);
    backdrop-filter: blur(10px);
}
.search-bar-ecommerce .form-control:focus,
.search-bar-ecommerce .form-select:focus {
    border-color: var(--afgs-red);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
    color: #fff;
}
.search-bar-ecommerce .form-control::placeholder { color: rgba(255,255,255,0.4); }

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    position: relative;
    padding-bottom: 0.5rem;
}
.section-title span { position: relative; z-index: 1; }
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, var(--afgs-red), transparent);
    border-radius: 2px;
}

/* --- PAGINAÇÃO --- */
.paginacao-produtos .page-link {
    background: var(--afgs-card);
    border-color: var(--afgs-border);
    color: #fff;
    border-radius: 8px !important;
    padding: 0.5rem 0.75rem;
}
.paginacao-produtos .page-link:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--afgs-red);
    color: #fff;
}
.paginacao-produtos .page-item.active .page-link {
    background: var(--afgs-red);
    border-color: var(--afgs-red);
    color: #fff;
}
.paginacao-produtos .page-item.disabled .page-link {
    background: rgba(255,255,255,0.03);
    border-color: var(--afgs-border);
    color: #666;
    pointer-events: none;
}

/* --- UTILITÁRIOS --- */
.glass-container { background: var(--afgs-card); backdrop-filter: blur(10px); border-radius: 16px; border: 1px solid var(--afgs-border); }
.badge-cat { background-color: var(--afgs-red); font-weight: 500; font-size: 0.8rem; padding: 5px 10px; }

/* PESQUISA */
.search-input {
    background: rgba(255,255,255,0.1); /* Mais claro para ver que é campo */
    border: 1px solid #555;
    color: white !important; /* Texto branco forçado */
}
.search-input::placeholder { color: #ccc; }
.search-input:focus {
    background: rgba(0,0,0,0.8);
    color: white; border-color: #dc3545; box-shadow: none;
}

/* --- CORREÇÃO DO BOOTBOX (IMPORTANTE) --- */
.bootbox .modal-dialog { margin-top: 15vh; }
.bootbox .modal-content {
    background-color: #222 !important; /* Fundo Escuro */
    color: #fff !important; /* Texto Branco */
    border: 1px solid #444;
}
.bootbox .modal-header { border-bottom: 1px solid #444; }
.bootbox .modal-footer { border-top: 1px solid #444; }
.bootbox .btn-close { 
    filter: invert(1); /* Inverte o ícone de fechar para ficar branco */
}
.bootbox .modal-body {
    font-size: 1.1rem;
    text-align: center;
}

/* LOADER */
#loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 99999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.5s ease; }
.spinner { width: 50px; height: 50px; border: 5px solid #333; border-top: 5px solid #dc3545; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 10px; }
.loader-text { color: white; animation: pulse 1.5s infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* OFFLINE BANNER */
#offline-banner { display: none; position: fixed; top: 0; left: 0; width: 100%; background: #dc3545; color: white; text-align: center; padding: 10px; z-index: 10000; font-weight: bold; }

/* FOOTER */
.footer-ecommerce {
    background: #050505;
    border-top: 1px solid var(--afgs-border);
    padding: 3rem 0;
    color: #888;
}
.footer-ecommerce a { color: inherit; text-decoration: none; transition: color 0.2s; }
.footer-ecommerce a:hover { color: var(--afgs-red); }
.footer-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
footer { margin-top: auto; }

/* --- NOVOS ESTILOS (ADICIONADOS PARA O CARRINHO) --- */
.qtd-control {
    display: flex;
    align-items: center;
    background: #333;
    border-radius: 5px;
    padding: 2px;
}
.btn-qtd {
    background: none; border: none; color: white;
    width: 25px; height: 25px;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; cursor: pointer;
}
.btn-qtd:hover { color: #dc3545; }
.qtd-num { padding: 0 8px; font-size: 0.9rem; font-weight: bold; }

/* --- MODAL CARRINHO REDESENHADO --- */
#modalCarrinho .modal-content {
    border-radius: 20px !important;
    overflow: hidden;
}

#modalCarrinho .btn-check:checked + .btn-outline-secondary {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

#modalCarrinho .btn-outline-secondary:hover {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

#modalCarrinho #lista-itens::-webkit-scrollbar {
    width: 6px;
}

#modalCarrinho #lista-itens::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

#modalCarrinho #lista-itens::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

#modalCarrinho #lista-itens::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

#modalCarrinho .btn-group .btn {
    border-radius: 8px !important;
}

#modalCarrinho .btn-group .btn:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#modalCarrinho .btn-group .btn:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

#modalCarrinho .btn-group .btn:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* Animacao suave ao adicionar/remover itens */
#lista-itens > div {
    animation: fadeInItem 0.3s ease-out;
}

@keyframes fadeInItem {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}
