/* Módulo 4: Layout com barra lateral fixa alinhada à logo, 4 colunas iguais, grade horizontal e mobile */

:root {
    --primary: #2a7a78;
    --xmas-green: #113826;
    --secondary: #d8737f;
    --xmas-red: #9b2226;
    --accent: #d4af37;
    --bg-cream: #fdf8f7;
    --dark: #2c2525;
    --success: #2d6a4f;
    --required: #b5172c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-cream);
    color: var(--dark);
    line-height: 1.45;
    font-size: 14.5px;
    overflow-x: hidden;
}

/* Topo fixo */
.sticky-top-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.urgency-banner {
    background: linear-gradient(90deg, var(--xmas-red), var(--secondary), var(--xmas-red));
    color: white;
    text-align: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.78rem;
    font-weight: bold;
}

header {
    background: linear-gradient(135deg, var(--xmas-green) 0%, var(--primary) 100%);
    color: white;
    padding: 0.45rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.logo-box-clean {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    padding: 2px;
    border: 2px solid var(--secondary);
}

.logo-box-clean img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.btn {
    background: linear-gradient(135deg, var(--secondary), var(--xmas-red));
    color: white;
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    transition: transform 0.15s;
    white-space: nowrap;
}

.btn:hover {
    transform: scale(1.03);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: #fff;
}

.btn-story {
    background-color: rgba(255, 255, 255, 0.12);
    border: 2px solid var(--secondary);
    color: #fff;
}

.btn-natal-link {
    background-color: rgba(212, 175, 55, 0.18);
    border: 2px solid var(--accent);
    color: #fff;
}

.btn-logout {
    background: #6c757d;
    color: white;
}

@media (max-width: 650px) {
    .btn-text {
        display: none;
    }
    .logo-box-clean {
        width: 40px;
        height: 40px;
    }
    .btn {
        padding: 0.45rem 0.65rem;
        font-size: 0.85rem;
        border-radius: 16px;
    }
    header {
        padding: 0.4rem 0.6rem;
    }
}

/* Banner principal */
.hero {
    background: linear-gradient(135deg, rgba(17, 56, 38, 0.92), rgba(42, 122, 120, 0.88), rgba(216, 115, 127, 0.92));
    color: white;
    text-align: center;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--secondary);
}

.hero h2 {
    font-size: 1.4rem;
    margin-bottom: 0.15rem;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.35);
}

.hero h2 span {
    color: var(--accent);
}

.hero p {
    font-size: 0.84rem;
    color: #fdf8f7;
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .hero h2 {
        font-size: 1.65rem;
    }
}

/* Workspace: Barra Lateral Fixa alinhada à logomarca + Conteúdo em 4 Partes Iguais */
.workspace-layout {
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0.9rem 2.5rem 0.9rem;
}

.sidebar-nav {
    flex: 0 0 245px;
    width: 245px;
    position: sticky;
    top: 98px;
    background: #ffffff;
    border-radius: 14px;
    padding: 1rem 0.65rem;
    box-shadow: 0 4px 14px rgba(17, 56, 38, 0.08);
    border-top: 4px solid var(--xmas-green);
    border-bottom: 3px solid var(--secondary);
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--xmas-green);
    padding-bottom: 0.55rem;
    margin-bottom: 0.65rem;
    border-bottom: 2px solid #f2e6e8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-link,
.sidebar-btn {
    width: 100%;
    text-align: left;
    background: #fdf8f7;
    color: var(--dark);
    border: 1px solid #efe0e2;
    border-radius: 9px;
    padding: 0.48rem 0.55rem;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.sidebar-link:hover,
.sidebar-btn:hover {
    background: linear-gradient(135deg, rgba(42, 122, 120, 0.12), rgba(216, 115, 127, 0.14));
    border-color: var(--primary);
    color: var(--xmas-green);
    transform: translateX(2px);
}

.sidebar-divider {
    height: 1px;
    background: #f0e4e6;
    margin: 0.45rem 0;
}

.main-content-area {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

/* Responsividade: barra vira faixa rolável no celular/tablet e grade adapta-se */
@media (max-width: 960px) {
    .workspace-layout {
        flex-direction: column;
        gap: 0.85rem;
        padding: 0 0.6rem 2.2rem 0.6rem;
    }

    .sidebar-nav {
        flex: none;
        width: 100%;
        position: sticky;
        top: 86px;
        z-index: 900;
        padding: 0.5rem 0.65rem;
        border-radius: 10px;
        border-top-width: 3px;
        border-bottom-width: 2px;
    }

    .sidebar-title {
        display: none;
    }

    .sidebar-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.45rem;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .sidebar-link,
    .sidebar-btn {
        width: auto;
        flex-shrink: 0;
        padding: 0.42rem 0.7rem;
        font-size: 0.78rem;
        border-radius: 18px;
        white-space: nowrap;
    }

    .sidebar-divider {
        display: none;
    }
}

.section-title {
    text-align: center;
    color: var(--xmas-green);
    font-size: 1.4rem;
    margin: 1.35rem 0 0.95rem 0;
    scroll-margin-top: 115px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 65px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--xmas-red));
    margin: 0.35rem auto 0;
    border-radius: 2px;
}

/* Grade em 4 partes iguais com espaçamento horizontal ajustado */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 1rem;
    row-gap: 1.25rem;
}

@media (min-width: 620px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 0.95rem;
        row-gap: 1.2rem;
    }
}

@media (min-width: 1120px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 1.15rem;
        row-gap: 1.35rem;
    }
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(42, 122, 120, 0.1);
    border-top: 4px solid var(--secondary);
    border-bottom: 2px solid rgba(42, 122, 120, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-img-wrapper {
    width: 100%;
    height: 185px;
    overflow: hidden;
    border-bottom: 1px solid #f2e6e8;
    background-color: #fffaf9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-img:hover {
    transform: scale(1.06);
}

.product-info {
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.03rem;
    color: var(--primary);
    margin-bottom: 0.15rem;
    font-weight: bold;
    line-height: 1.25;
    min-height: 2.55rem;
    display: flex;
    align-items: flex-start;
}

.product-weight {
    font-size: 0.76rem;
    color: var(--xmas-red);
    font-weight: 600;
    margin-bottom: 0.4rem;
    min-height: 1.05rem;
}

.product-desc {
    font-size: 0.82rem;
    color: #555;
    margin-bottom: 0.8rem;
    flex-grow: 1;
}

.product-controls-row {
    display: flex;
    gap: 0.35rem;
    align-items: stretch;
    margin-bottom: 0.8rem;
    height: 52px;
}

.option-group {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.qty-group {
    flex: 0 0 48px;
    width: 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.product-controls-row label {
    font-size: 0.72rem;
    font-weight: bold;
    color: var(--xmas-green);
    display: block;
    margin-bottom: 2px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-controls-row select {
    width: 100%;
    height: 32px;
    padding: 0 0.3rem;
    border: 1px solid #d5c5c7;
    border-radius: 7px;
    font-size: 0.78rem;
    background: #fff;
    line-height: 30px;
}

.product-controls-row input {
    width: 100%;
    height: 32px;
    padding: 0 0.2rem;
    border: 1px solid #d5c5c7;
    border-radius: 7px;
    font-size: 0.78rem;
    text-align: center;
    background: #fff;
    line-height: 30px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.55rem;
    border-top: 1px dashed #eee;
}

.product-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--xmas-red);
}

.product-footer .btn {
    padding: 0.42rem 0.72rem;
    font-size: 0.8rem;
}

.info-box-natal {
    background: white;
    border-radius: 14px;
    padding: 1.3rem;
    margin-top: 2rem;
    scroll-margin-top: 115px;
    border: 2px solid var(--secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 1.1rem;
    row-gap: 1.2rem;
}

@media (min-width: 768px) {
    .info-box-natal {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1120px) {
    .info-box-natal {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.info-box-natal h4 {
    color: var(--primary);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 4px;
    display: inline-block;
}

.info-box-natal ul {
    list-style: none;
    padding-left: 0;
    font-size: 0.86rem;
    color: #444;
}

.info-box-natal li {
    margin-bottom: 0.35rem;
}

.contact-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed var(--secondary);
}

.contact-link:hover {
    color: var(--xmas-red);
    border-bottom-style: solid;
}

/* Modal Especial Natal dLiz.cias */
.natal-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: center;
}

@media (min-width: 680px) {
    .natal-modal-grid {
        grid-template-columns: 0.92fr 1.08fr;
    }
}

.natal-photo-frame {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background: #fdf8f7;
}

.natal-photo-frame img {
    width: 100%;
    height: 310px;
    object-fit: cover;
    display: block;
}

.natal-badge {
    display: inline-block;
    background: linear-gradient(90deg, var(--xmas-green), var(--xmas-red));
    color: #fff;
    font-size: 0.74rem;
    font-weight: bold;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.55rem;
    letter-spacing: 0.4px;
}

.natal-heading {
    font-size: 1.5rem;
    line-height: 1.15;
    color: var(--xmas-green);
    margin-bottom: 0.85rem;
}

.natal-heading span {
    color: var(--xmas-red);
}

.natal-copy {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1rem;
    text-align: left;
}

.natal-contact {
    background: #fdf5f6;
    border-left: 4px solid var(--secondary);
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.86rem;
    color: var(--xmas-green);
    font-weight: 600;
    margin-bottom: 1rem;
}

#toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--xmas-green), var(--primary));
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    z-index: 3000;
    display: none;
    font-weight: bold;
    font-size: 0.9rem;
    border-left: 4px solid var(--secondary);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1200;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    border-top: 5px solid var(--primary);
}

.modal-content.modal-natal {
    max-width: 780px;
    border-top-color: var(--xmas-green);
    border-bottom: 4px solid var(--xmas-red);
}

.modal-content.modal-admin {
    max-width: 95vw;
    width: 95vw;
    padding: 1.4rem 1.6rem;
}

/* Alinhamento e espaçamento do Login e Painel Admin */
#admin-login-section {
    max-width: 440px;
    margin: 1rem auto;
    padding: 1.35rem 1.5rem;
    background: #fdf8f7;
    border: 1px solid #ead8da;
    border-radius: 12px;
}

#admin-login-section .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.15rem;
}

#admin-login-section .form-group label {
    margin-bottom: 0;
    font-size: 0.92rem;
}

#admin-login-section .btn {
    width: 100%;
    padding: 0.68rem 1rem;
    font-size: 0.9rem;
}

#admin-dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.88rem;
}

.req {
    color: var(--required);
    font-weight: bold;
    margin-left: 3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
}

.whatsapp-group {
    display: flex;
    gap: 0.65rem;
}

.whatsapp-group select {
    width: 48%;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.whatsapp-group input {
    width: 52%;
}

.admin-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.35rem 0 0.95rem 0;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #ece2e4;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.search-filter-input {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 0.85rem;
    width: 270px;
    outline: none;
    background: #fff;
}

.search-filter-input:focus {
    border-color: var(--primary);
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}

.btn-toggle-section {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: bold;
    cursor: pointer;
}

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

.table-responsive {
    width: 100%;
    overflow-x: hidden;
    margin-top: 0.35rem;
    margin-bottom: 1.35rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: #fff;
}

.admin-table.orders-table {
    table-layout: auto;
    width: 100%;
    min-width: 100%;
}

.admin-table th,
.admin-table td {
    border: 1px solid #eee;
    padding: 0.58rem 0.5rem;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.admin-table th.col-pedido,
.admin-table td.col-pedido {
    width: 1%;
    font-weight: bold;
}

.admin-table th.col-data,
.admin-table td.col-data {
    width: 1%;
    font-size: 0.76rem;
}

.admin-table th.col-cliente,
.admin-table td.col-cliente {
    width: auto;
    min-width: 125px;
    font-weight: bold;
}

.admin-table th.col-itens,
.admin-table td.col-itens {
    width: 1%;
    text-align: center;
}

.admin-table th.col-rota,
.admin-table td.col-rota {
    width: 100%;
    white-space: normal !important;
    word-break: break-word;
    font-size: 0.77rem;
    line-height: 1.45;
    color: #444;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.admin-table th.col-total,
.admin-table td.col-total {
    width: 1%;
    font-weight: bold;
}

.admin-table th.col-status,
.admin-table td.col-status {
    width: 1%;
}

.admin-table th.col-acoes,
.admin-table td.col-acoes {
    width: 1%;
    text-align: center;
}

.admin-table th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.25px;
}

.admin-table tbody tr:hover {
    background-color: #f4f7f5;
}

.status-badge {
    display: inline-block;
    padding: 0.22rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    background: #e9ecef;
    color: #495057;
    text-align: center;
}

.status-pendente {
    background: #fff3cd;
    color: #856404;
}

.status-pronto {
    background: #d1ecf1;
    color: #0c5460;
}

.status-enviado {
    background: #d4edda;
    color: #155724;
}

.status-cancelado {
    background: #f8d7da;
    color: #721c24;
}

.action-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.92rem;
    padding: 0.22rem 0.42rem;
    margin: 0 0.14rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.08);
    border-color: var(--primary);
}

.btn-view-items {
    background-color: #f1f5f3;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.25rem 0.65rem;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

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

@media (max-width: 768px) {
    .modal-content.modal-admin {
        max-width: 98vw;
        width: 98vw;
        padding: 0.95rem;
    }

    #admin-login-section {
        padding: 1rem;
        margin: 0.5rem auto;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        font-size: 0.75rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.48rem 0.38rem;
    }

    .admin-table.orders-table .col-rota {
        min-width: 270px;
        font-size: 0.73rem;
    }

    .action-btn {
        font-size: 0.82rem;
        padding: 0.18rem 0.32rem;
        margin: 0 0.08rem;
    }
}

footer {
    background: linear-gradient(135deg, var(--xmas-green) 0%, var(--primary) 100%);
    color: white;
    text-align: center;
    padding: 1.3rem 1rem;
    margin-top: 2rem;
    border-top: 3px solid var(--secondary);
    font-size: 0.85rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    margin: 0 0.35rem;
}

footer a:hover {
    text-decoration: underline;
}

.admin-table th.col-frete,
.admin-table td.col-frete {
    width: 1%;
    white-space: nowrap;
    font-weight: 600;
    color: var(--xmas-green);
}
