/* =========================================
   1. VARIÁVEIS E RESET GLOBAL — Conexiência
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Largura máxima alinhada ao .container / grid de produtos */
    --layout-max-width: 1200px;

    /* PALETA — visual moderno e limpo */
    --blue-navy: #0f172a;
    --blue-primary: #2563eb;
    --blue-hover: #1d4ed8;
    --blue-light: #eff6ff;
    --red-alert: #ef4444;
    --green-success: #10b981;
    --bg-body: #f1f5f9;
    --white: #ffffff;
    --gray-border: #e2e8f0;
    --text-gray: #64748b;
    --text-dark: #0f172a;

    /* Bordas mais suaves (visual moderno) */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Marca Conexiência */
.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--blue-navy);
    color: var(--white);
    border-radius: 50%;
    margin-right: 0.5rem;
    letter-spacing: -0.02em;
}
.logo-mark-inline {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.site-title { letter-spacing: -0.02em; }
.brand-link { transition: opacity 0.2s, transform 0.2s; text-decoration: none !important; }
.brand-link:hover { opacity: 0.9; }
.footer-tagline { font-size: 0.75rem; opacity: 0.9; }
.header-brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-right: 10px;
}

/* Botão painel Admin — único padrão visual (como no index) */
.btn-admin-panel {
    border-radius: 6px;
    text-decoration: none !important;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* Container Centralizado */
.container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* =========================================
   2. HEADER E NAVEGAÇÃO
   ========================================= */
.top-bar {
    background-color: var(--blue-navy);
    color: var(--white);
    font-size: 0.75rem;
    text-align: center;
    padding: 8px 0;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    backdrop-filter: saturate(180%) blur(8px);
}

/* Hero da home: faixa full-width; vitrine limitada ao mesmo grid da loja */
.hero-banner {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #e8eef5;
    border-bottom: 1px solid var(--gray-border);
}

.banner-container {
    max-width: var(--layout-max-width);
    width: 100%;
    margin: 20px auto;
    padding: 0 20px;
}

.hero-banner-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Não usar object-fit: cover aqui — o banner pode ter texto nas bordas */
}

@media (max-width: 768px) {
    .banner-container {
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .hero-banner-img {
        width: 100%;
        height: auto;
        border-radius: 0;
    }
}

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

/* Tablet: manter pesquisa e botões (Pedidos, Carrinho) na mesma linha */
@media (min-width: 768px) {
    .header-actions-row {
        flex-wrap: nowrap;
    }
    .header-nav-col {
        min-width: 0; /* permite flex shrink se necessário */
    }
}

/* Logo */
.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 45px;
    height: 45px;
    background: var(--blue-navy);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
}

.titles h1 {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--blue-navy);
}

/* Busca e Categorias */
.search-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.filter-trigger {
    background: var(--blue-navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: 0 20px;
    height: 45px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

#search-input {
    flex: 1;
    height: 45px;
    border: 2px solid var(--blue-navy);
    padding: 0 16px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#search-input:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}
.form-control:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#search-btn {
    background: var(--blue-primary);
    color: var(--white);
    border: none;
    height: 45px;
    width: 50px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s;
}

#search-btn:hover {
    background: var(--blue-hover);
}

/* Menu Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-top: 3px solid var(--blue-navy);
    width: 250px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 5px 0;
}

.dropdown-menu.show {
    display: block;
    animation: slideDown 0.2s ease;
}

/* Mobile: dropdown de categorias com scroll para não ficar atrás do footer */
@media (max-width: 767.98px) {
    .main-header .dropdown-menu {
        max-height: min(70vh, 400px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scrollbar-width: thin;
        -ms-overflow-style: none;
    }
    .main-header .dropdown-menu::-webkit-scrollbar {
        width: 6px;
    }
    .main-header .dropdown-menu::-webkit-scrollbar-track {
        background: var(--gray-border);
        border-radius: 3px;
    }
    .main-header .dropdown-menu::-webkit-scrollbar-thumb {
        background: var(--blue-navy);
        border-radius: 3px;
    }
}

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--blue-navy);
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:hover {
    background: var(--blue-light);
    color: var(--blue-primary);
    padding-left: 25px;
}

.dropdown-item.active {
    background: var(--blue-light);
    font-weight: bold;
}

/* Ações do Usuário */
.nav-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-header-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--blue-navy);
}

.cart-icon-container {
    position: relative;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--blue-navy);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--red-alert);
    color: var(--white);
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   3. PRODUTOS (CARDS)
   ========================================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    padding-bottom: 50px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
    box-shadow: var(--shadow-card);
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: var(--shadow-lg);
}

.offer-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--red-alert);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
}

.product-image {
    width: 100%;
    height: 200px;
    background: #f1f5f9;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-book-cover {
    width: 72%;
    max-width: 180px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

.product-book-cover-large {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
}

.product-carousel-wrap {
    max-width: 340px;
}

.product-carousel-main-wrap {
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 3 / 4;
    position: relative;
    background: #f1f5f9;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.product-carousel-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s ease;
}

.product-carousel-nav:hover {
    background: rgba(15, 23, 42, 0.8);
}

.product-carousel-nav--prev {
    left: 8px;
}

.product-carousel-nav--next {
    right: 8px;
}

.product-carousel-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
    padding: 0 4px;
}

.product-carousel-thumb {
    width: 56px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
    cursor: pointer;
    opacity: 0.75;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.product-carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-carousel-thumb:hover {
    opacity: 1;
}

.product-carousel-thumb.active {
    border-color: #2563eb;
    opacity: 1;
}

.order-downloads-list .order-download-row:last-child {
    margin-bottom: 0;
}

/* Página de produto: cartão com borda a partir de tablet */
@media (min-width: 992px) {
    .product-purchase-card {
        border: 1px solid var(--gray-border) !important;
    }
}

/* Página de produto — mobile / tablet: mídia centralizada; texto à esquerda para leitura */
@media (max-width: 1023.98px) {
    .product-page-cover-wrap {
        text-align: center;
    }

    .product-page-body-text {
        text-align: left;
        width: 100%;
        max-width: 100%;
        padding-top: 0.25rem;
    }

    .product-page-title {
        font-size: 1.35rem;
        line-height: 1.3;
        letter-spacing: -0.02em;
        margin-bottom: 0.45rem;
        text-align: left;
    }

    .product-page-category {
        font-size: 0.875rem;
        line-height: 1.45;
        text-align: left;
    }

    .product-page-divider {
        margin-left: 0;
        margin-right: 0;
    }

    .product-page-desc-heading {
        font-size: 1.05rem;
        line-height: 1.35;
        margin-bottom: 0.65rem !important;
        text-align: left;
    }

    .product-page-description {
        font-size: 1rem;
        line-height: 1.65;
        letter-spacing: 0.01em;
        text-align: left;
        word-wrap: break-word;
        overflow-wrap: anywhere;
        hyphens: auto;
        -webkit-hyphens: auto;
        color: #475569;
    }

    .product-page-col-aside .product-refund-notice,
    .product-page-policy {
        text-align: left;
    }

    .product-page-col-aside .product-page-policy-label {
        display: block;
        margin-bottom: 0.35rem;
    }
}

/* Página de produto — desktop largo (≥1024px): coluna mídia ~63%, aside compacto, carrossel em destaque */
@media (min-width: 1024px) {
    .product-page-grid.row {
        flex-wrap: nowrap;
        align-items: flex-start;
        --bs-gutter-x: 1.75rem;
    }

    .product-page-grid.row > .product-page-col-main.col-12 {
        flex: 0 0 63%;
        max-width: 63%;
        width: 63%;
    }

    .product-page-grid.row > .product-page-col-aside.col-12 {
        flex: 0 0 37%;
        max-width: 37%;
        width: 37%;
    }

    .product-page-col-aside {
        position: sticky;
        top: 5.75rem;
        align-self: flex-start;
    }

    .product-page-cover-wrap {
        width: 100%;
    }

    .product-page-col-main .product-carousel-wrap {
        max-width: none;
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 1.25rem !important;
    }

    .product-page-col-main .product-carousel-main-wrap {
        max-width: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        aspect-ratio: 3 / 4;
        min-height: 0;
    }

    .product-page-col-main .product-carousel-thumbs {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 10px 12px;
        justify-content: stretch;
        margin-top: 14px;
        padding: 0;
        width: 100%;
    }

    .product-page-col-main .product-carousel-thumb {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 3 / 4;
    }

    .product-page-body-text {
        width: 100%;
        text-align: left;
    }

    .product-page-title {
        font-size: 1.65rem;
        line-height: 1.25;
        margin-bottom: 0.35rem;
    }

    .product-page-category {
        font-size: 0.9rem;
    }

    .product-page-divider {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .product-page-desc-heading {
        font-size: 1.05rem;
        margin-bottom: 0.5rem !important;
    }

    .product-page-description {
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .product-page-col-aside .product-purchase-card {
        padding: 1rem 1.2rem !important;
        border-radius: 12px !important;
    }

    .product-page-col-aside .product-page-price {
        font-size: 1.35rem !important;
        margin-bottom: 0.65rem !important;
        line-height: 1.2;
    }

    .product-page-col-aside .product-page-add-cart {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        font-size: 0.95rem;
    }

    .product-page-col-aside .product-page-policy {
        margin-top: 0.75rem !important;
        padding: 0.65rem 0.85rem !important;
        font-size: 0.78rem !important;
        line-height: 1.35;
        border-radius: 10px;
    }

    .product-page-col-aside .product-page-policy-label {
        display: block;
        margin-bottom: 0.2rem;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
}

.product-refund-notice {
    font-size: 0.95rem;
}

.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.card-body h3 {
    font-size: 1rem;
    color: var(--blue-navy);
    margin: 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}

.card-body h3:hover {
    color: var(--blue-primary);
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 15px;
}

.price-old {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.85rem;
}

.price-new {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--blue-navy);
}

/* Botões Universais — visual moderno */
.btn-buy,
.btn-primary {
    background: var(--blue-primary);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.btn-buy { width: 100%; text-transform: uppercase; letter-spacing: 0.5px; }

.btn-buy:hover,
.btn-primary:hover {
    background: var(--blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-buy:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: 100%;
    padding: 15px;
}

/* =========================================
   4. MODAIS (GERAL)
   ========================================= */
.modal-overlay,
.cart-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    z-index: 2000;
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

/* Modal Carrinho (Slide) */
.cart-modal-overlay {
    justify-content: flex-end;
}

.cart-modal {
    background: var(--white);
    width: 100%;
    max-width: 420px;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

/* Modal Produto / Sugestão (Pop-up) */
.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 900px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: zoomIn 0.3s ease;
    border: 1px solid var(--gray-border);
}

/* Grid do Modal de Detalhes */
.modal-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

.modal-image-container {
    background: #f1f5f9;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-tag {
    background: var(--blue-light);
    color: var(--blue-primary);
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 700;
    align-self: flex-start;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.modal-info h2 {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 15px;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--white);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
}

.close-modal-btn:hover {
    color: var(--red-alert);
    border-color: var(--red-alert);
}

/* =========================================
   5. FORMULÁRIOS E AUTH (LOGIN/CADASTRO)
   ========================================= */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.auth-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #f8fafc;
}

.form-group input:focus {
    border-color: var(--blue-primary);
    background: var(--white);
}

/* =========================================
   6. ADMIN (Tabelas e Listas)
   ========================================= */
.admin-wrapper {
    max-width: 900px;
    margin: 30px auto;
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.product-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.edit-btn {
    background: var(--blue-light);
    color: var(--blue-primary);
}

.edit-btn:hover {
    background: var(--blue-navy);
    color: var(--white);
}

.delete-btn {
    background: #fee2e2;
    color: var(--red-alert);
}

.delete-btn:hover {
    background: var(--red-alert);
    color: var(--white);
}

/* Checkbox Grid (Categorias) */
.category-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: #f8fafc;
    padding: 15px;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* =========================================
   7. FOOTER E MOBILE (ATUALIZADO)
   ========================================= */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-border);
    font-size: 0.92rem;
}

.top-legal-desktop {
    border-bottom: 1px solid var(--gray-border);
    background: #f8fafc;
}

.footer-title {
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.footer-list {
    margin: 0;
    padding: 0;
}

.footer-list li + li {
    margin-top: 0.4rem;
}

.footer-link {
    color: var(--text-gray);
    text-decoration: none;
}

.footer-link:hover {
    color: var(--blue-primary);
}

.footer-pay-icon {
    font-size: 0.82rem;
    color: var(--text-gray);
    border: 1px solid var(--gray-border);
    border-radius: 999px;
    padding: 6px 10px;
    background: #f8fafc;
}

.footer-bottom {
    border-top: 1px solid var(--gray-border);
}

/* O Bootstrap cuida do posicionamento (fixed-bottom), 
   aqui cuidamos apenas da beleza dos ícones */
.nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    /* Letra pequena */
    color: #64748b;
    /* Cinza inativo */
    text-decoration: none !important;
    transition: color 0.2s;
}

.nav-item-mobile:hover {
    color: var(--blue-navy);
}

.nav-item-mobile.active {
    color: var(--blue-primary);
    font-weight: 700;
}

/* Input group da busca — cantos arredondados no dropdown */
.input-group .btn.dropdown-toggle {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Modal de Sugestão (Centralizado) */
#suggestion-modal .modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    /* Largura máxima */
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: zoomIn 0.3s ease;
    text-align: center;
}

/* ========================================= */
/* AJUSTES MOBILE: CATEGORIAS E MODAL        */
/* ========================================= */

/* Scroll horizontal de categorias no mobile — suave, barra escondida */
.categories-scroll-mobile {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.categories-scroll-mobile::-webkit-scrollbar {
    display: none;
}
.categories-scroll-item {
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Header mobile: esconde chips horizontais; CATEGORIAS compacto; placeholder invisível */
@media (max-width: 768px) {
    #categories-scroll-mobile.categories-scroll-mobile,
    .categories-scroll-mobile {
        display: none !important;
    }

    .main-header .container {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .main-header .header-actions-row {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        row-gap: 0;
    }

    .main-header .header-mobile-line1 {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .main-header .header-brand-mobile .header-brand-logo {
        display: block;
        max-width: 150px;
        width: auto;
        height: auto;
        max-height: 44px;
        object-fit: contain;
        margin-right: 0;
    }

    .main-header .header-main-col {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 15px;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        min-width: 0;
    }

    .main-header .header-search-slot {
        width: 100%;
        min-width: 0;
    }

    .main-header .header-nav-col {
        display: none !important;
    }

    .main-header .header-user-nav-mobile {
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        gap: 0.25rem;
    }

    .main-header .header-auth-btn-login {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--blue-primary);
        color: #fff !important;
        padding: 6px 16px;
        border-radius: 999px;
        border: none;
        font-size: 0.875rem;
        font-weight: 700;
        text-decoration: none !important;
        line-height: 1.2;
        box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
    }

    .main-header .header-auth-btn-logout {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--red-alert);
        color: #fff !important;
        padding: 6px 16px;
        border-radius: 999px;
        border: none;
        font-size: 0.875rem;
        font-weight: 700;
        line-height: 1.2;
        box-shadow: 0 1px 3px rgba(239, 68, 68, 0.35);
    }

    .main-header .input-group > .btn.dropdown-toggle.btn-dark {
        padding: 0.3rem 0.45rem !important;
        font-size: 0.72rem !important;
        font-weight: 700;
        height: 36px !important;
        min-height: 36px !important;
        line-height: 1.15;
        align-items: center;
    }

    .main-header .input-group > .btn.dropdown-toggle.btn-dark .fa-bars {
        font-size: 0.7rem;
        margin-right: 0.2rem !important;
    }

    #search-input::placeholder {
        color: transparent;
    }

    #search-input::-webkit-input-placeholder {
        color: transparent;
    }

    #search-input::-moz-placeholder {
        color: transparent;
        opacity: 1;
    }
}

/* Badges de categoria nos cards (clicáveis, tamanho/alinhamento padronizados) */
.product-category-badge {
    display: inline-block;
    font-size: 0.75rem !important;
    text-align: center;
    transition: background-color 0.2s, color 0.2s;
}
.product-category-badge:hover {
    background-color: var(--blue-light) !important;
    color: var(--blue-primary) !important;
}

/* ========================================= */
/* FIX ESTRUTURAL DO MODAL CUSTOMIZADO (MOBILE) */
/* ========================================= */
@media (max-width: 768px) {
    /* 1. Muta o container pai para flex column */
    .modal-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important; /* Espaçamento entre a foto e o texto */
    }

    /* 2. Força os nós filhos a ocuparem 100% do viewport interno */
    .modal-image-container,
    .modal-info {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0 !important;
    }

    /* 3. Ajusta o contêiner da imagem para não explodir a altura da tela */
    .modal-image-container {
        min-height: 250px !important;
        height: auto !important;
        background: transparent !important;
    }

    /* 4. Trava as dimensões do node da imagem para aspect-ratio correto */
    #pm-img {
        width: 100% !important;
        max-height: 250px !important;
        object-fit: contain !important; /* Impede a distorção do *box model* */
    }

    /* 5. Ajustes de tipografia e botões para UX Mobile */
    .modal-info {
        display: flex;
        flex-direction: column;
        align-items: center; /* Centraliza o conteúdo textual */
        text-align: center;
    }

    #pm-desc {
        text-align: justify;
        margin: 15px;
    }

    /* Ajuste fino do botão de fechar */
    .close-modal-btn {
        top: 10px !important;
        right: 15px !important;
        z-index: 1050 !important;
    }
}

/* Animação de entrada suave */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Garante espaço no final da página para o menu não tapar o conteúdo */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    .main-footer {
        padding-bottom: 90px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
/* Força a barra de pesquisa inteira a ter a mesma altura */
#search-input, 
#search-btn {
    height: 45px; /* Você pode aumentar ou diminuir esse valor para deixar a barra mais gordinha ou fina */
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ajusta as bordas para não ficarem duplicadas ou quebradas no meio */
#search-btn {
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
}

@media (max-width: 768px) {
    #search-input,
    #search-btn {
        height: 36px !important;
    }
}

/* =========================================
   Cookies Consent (LGPD) — banner fixo
   ========================================= */
.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px) saturate(160%);
    padding: 14px 16px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.cookie-consent-banner--hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.cookie-consent-banner .cc-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.cookie-consent-banner .cc-title {
    font-weight: 900;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.cookie-consent-banner .cc-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.35;
}

.cookie-consent-banner .cc-mini-links {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cookie-consent-banner .cc-link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.cookie-consent-banner .cc-sep {
    opacity: 0.35;
}

.cookie-consent-banner .cc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cookie-consent-banner .cc-btn {
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 900;
    font-size: 0.86rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.cookie-consent-banner .cc-btn-accept {
    background: #2563eb;
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.cookie-consent-banner .cc-btn-accept:hover {
    background: #1d4ed8;
}

.cookie-consent-banner .cc-btn-understand {
    background: transparent;
    color: #fff;
}

.cookie-consent-banner .cc-btn-understand:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.cookie-consent-visible {
    padding-bottom: 110px !important;
}

@media (max-width: 767.98px) {
    .cookie-consent-banner .cc-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-consent-banner .cc-actions {
        width: 100%;
        justify-content: flex-start;
    }

    body.cookie-consent-visible {
        padding-bottom: 160px !important;
    }
}

/* Modal: downloads por item do pedido (Meus Pedidos) */
.order-downloads-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-y: auto;
}

.order-downloads-modal-dialog {
    background: var(--white, #fff);
    width: 100%;
    max-width: 520px;
    max-height: min(85vh, 640px);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-border, #e5e7eb);
}

.order-downloads-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--gray-border, #e5e7eb);
    flex-shrink: 0;
}

.order-downloads-modal-body {
    padding: 16px 18px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    background: #f8fafc;
}

/* ==========================================
   Descrição do produto (WYSIWYG/Quill → HTML)
   ========================================== */
.product-page-description p {
    margin: 0 0 0.85em 0;
}
.product-page-description p:last-child {
    margin-bottom: 0;
}
.product-page-description strong,
.product-page-description b {
    color: var(--text-dark, #0f172a);
    font-weight: 700;
}
.product-page-description em,
.product-page-description i {
    font-style: italic;
}
.product-page-description u {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.product-page-description ul,
.product-page-description ol {
    margin: 0 0 0.85em 0;
    padding-left: 1.35rem;
}
.product-page-description ul { list-style: disc outside; }
.product-page-description ol { list-style: decimal outside; }
.product-page-description ul li,
.product-page-description ol li {
    margin-bottom: 0.25rem;
    line-height: 1.55;
}
/* Fallback p/ descrições legadas (antes do transform Quill→semântico):
   marca <li data-list="bullet"> como bullet e <li data-list="ordered"> como número. */
.product-page-description ol li[data-list="bullet"] { list-style-type: disc; }
.product-page-description ol li[data-list="ordered"] { list-style-type: decimal; }
/* Indentação do Quill (até 8 níveis, escalando 1.5em por nível) */
.product-page-description .ql-indent-1 { padding-left: 1.5em; }
.product-page-description .ql-indent-2 { padding-left: 3em; }
.product-page-description .ql-indent-3 { padding-left: 4.5em; }
.product-page-description .ql-indent-4 { padding-left: 6em; }
.product-page-description .ql-indent-5 { padding-left: 7.5em; }
.product-page-description .ql-indent-6 { padding-left: 9em; }
.product-page-description .ql-indent-7 { padding-left: 10.5em; }
.product-page-description .ql-indent-8 { padding-left: 12em; }
/* Tamanhos de fonte do Quill */
.product-page-description .ql-size-small { font-size: 0.85em; }
.product-page-description .ql-size-large { font-size: 1.25em; }
.product-page-description .ql-size-huge  { font-size: 1.6em; }
.product-page-description a {
    color: var(--blue-primary, #2563eb);
    text-decoration: underline;
    word-break: break-word;
}
.product-page-description a:hover {
    color: var(--blue-hover, #1d4ed8);
}
.product-page-description h1,
.product-page-description h2,
.product-page-description h3,
.product-page-description h4,
.product-page-description h5,
.product-page-description h6 {
    color: var(--text-dark, #0f172a);
    font-weight: 700;
    margin: 0.6em 0 0.35em 0;
    line-height: 1.3;
}
.product-page-description h1 { font-size: 1.4rem; }
.product-page-description h2 { font-size: 1.25rem; }
.product-page-description h3 { font-size: 1.1rem; }
.product-page-description h4,
.product-page-description h5,
.product-page-description h6 { font-size: 1rem; }
.product-page-description blockquote {
    margin: 0 0 0.85em 0;
    padding: 0.5rem 0.9rem;
    border-left: 3px solid var(--gray-border, #e2e8f0);
    background: #f8fafc;
    color: #475569;
    border-radius: 6px;
}
/* Classes de alinhamento que o Quill aplica aos blocos */
.product-page-description .ql-align-center { text-align: center; }
.product-page-description .ql-align-right  { text-align: right; }
.product-page-description .ql-align-justify { text-align: justify; }

/* ==========================================
   Admin: Preview do arquivo digital do produto
   (estado vazio / PDF com 1ª página / Word / genérico)
   ========================================== */
.product-file-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    min-width: 0;
}
.product-file-preview .pfp-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
}
.product-file-preview .pfp-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.product-file-preview .pfp-empty-title {
    font-weight: 700;
    color: #1e293b;
}
.product-file-preview .pfp-empty-hint {
    font-size: 0.82rem;
    color: #64748b;
}
.product-file-preview .pfp-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-width: 0;
}
.product-file-preview .pfp-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.product-file-preview .pfp-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
}
.product-file-preview .pfp-type {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.product-file-preview .pfp-status {
    font-size: 0.7rem;
    font-weight: 700;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 999px;
    padding: 2px 8px;
    text-transform: none;
    letter-spacing: 0;
}
.product-file-preview .pfp-name {
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-file-preview .pfp-meta {
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.product-file-preview .pfp-meta-divider {
    color: #cbd5e1;
}
.product-file-preview .pfp-pdf {
    display: flex;
    flex-direction: row;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.product-file-preview .pfp-pdf .pfp-card {
    flex: 1 1 220px;
    min-width: 0;
}
.product-file-preview .pfp-canvas-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 180px;
    max-width: 100%;
    aspect-ratio: 3 / 4;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.product-file-preview .pfp-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.product-file-preview .pfp-canvas-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.85);
    color: #475569;
    font-size: 0.78rem;
    text-align: center;
    padding: 8px;
}

@media (max-width: 575.98px) {
    .product-file-preview .pfp-pdf {
        flex-direction: column;
        align-items: stretch;
    }
    .product-file-preview .pfp-canvas-wrap {
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
    }
}
