/**
 * ESTILOS DO SISTEMA DE CARRINHO
 * 
 * CSS idêntico ao encontrado no arquivo PHP, adaptado para a nova estrutura.
 * Inclui estilos para barra de carrinho e lightbox de revisão.
 */

/* ========================================
   BARRA DE CARRINHO FIXA NO BOTTOM
   ======================================== */

.barra-carrinho-html {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333333;
    padding: 15px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.barra-carrinho-html.show {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.barra-carrinho-html .carrinho-info {
    display: flex;
    gap: 50px;
    align-items: center;
}

.barra-carrinho-html .info-secao {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.barra-carrinho-html .info-secao::after {
    content: '';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

.barra-carrinho-html .info-secao:last-child::after {
    display: none;
}

.barra-carrinho-html .info-titulo {
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
}

.barra-carrinho-html .info-valor {
    color: #00bae7;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.barra-carrinho-html .info-valor.total {
    font-size: 20px;
    font-weight: 700;
    color: #00bae7;
}

.barra-carrinho-html .btn-continuar {
    background: #00bae7;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    min-width: 140px;
}

.barra-carrinho-html .btn-continuar:hover {
    background: #0097ef;
    transform: translateY(-1px);
}

.barra-carrinho-html .btn-continuar:active {
    transform: translateY(0);
}

/* Espaçamento para o corpo quando o carrinho está ativo */
.carrinho-ativo {
    padding-bottom: 80px;
}

/* ========================================
   LIGHTBOX REVISAR PEDIDO
   ======================================== */

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

.review-modal.show {
    display: flex;
}

.review-content {
    background: white;
    border-radius: 8px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.review-header {
    background: #4a4a4a;
    color: white;
    padding: 18px 24px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.review-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.8;
}

.review-close:hover {
    opacity: 1;
}

.review-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.review-body {
    padding: 24px;
}

.event-info {
    background: white;
    padding: 0;
    border-radius: 0;
    margin-bottom: 20px;
    border: none;
}

.event-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 6px;
}

.event-date {
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-date i {
    font-size: 13px;
}

.show-section {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.date-highlight {
    background: #17a2b8;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    min-width: 70px;
    margin-right: 16px;
    line-height: 1.2;
}

.show-info {
    flex: 1;
}

.show-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 15px;
}

.show-time {
    color: #666;
    font-size: 13px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    font-size: 14px;
}

.items-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

.items-table th:nth-child(2),
.items-table th:nth-child(3),
.items-table th:nth-child(4),
.items-table th:nth-child(5) {
    text-align: center;
}

.items-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f3f4;
    color: #333;
    vertical-align: middle;
}

.items-table tr:last-child td {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: #333;
}

.quantity-cell {
    text-align: center;
    font-weight: 600;
}

.price-cell {
    text-align: center;
    font-weight: 600;
    color: #333;
}

.terms-section {
    margin: 24px 0 0 0;
    padding: 0;
    background: none;
    border-radius: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    text-align: left;
}

.terms-section a {
    color: #17a2b8;
    text-decoration: none;
}

.terms-section a:hover {
    text-decoration: underline;
}

.review-footer {
    background: #4a4a4a;
    padding: 18px 24px;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary {
    color: white;
}

.cart-items {
    font-size: 14px;
    color: #17a2b8;
    font-weight: 500;
}

.cart-total {
    font-size: 18px;
    font-weight: 600;
    color: #17a2b8;
    margin-top: 2px;
}

.btn-reserve {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-reserve:hover {
    background: #138496;
    transform: translateY(-1px);
}

.btn-reserve:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   MELHORIAS NOS CONTROLES DE QUANTIDADE
   ======================================== */

.quantity-wrapper .quantity-minus,
.quantity-wrapper .quantity-plus {
    transition: all 0.2s ease;
}

.quantity-wrapper .quantity-minus:hover,
.quantity-wrapper .quantity-plus:hover {
    background-color: #00bae7 !important;
    color: white !important;
    border-color: #00bae7 !important;
    transform: scale(1.05);
}

.quantity-wrapper .quantity-minus:active,
.quantity-wrapper .quantity-plus:active {
    transform: scale(0.95);
}

.quantity-wrapper .quantity-minus:disabled,
.quantity-wrapper .quantity-plus:disabled {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

/* Mobile */
@media (max-width: 768px) {
    .barra-carrinho-html {
        padding: 12px 15px;
    }

    .barra-carrinho-html .carrinho-info {
        gap: 30px;
    }

    .barra-carrinho-html .info-secao::after {
        right: -15px;
        height: 30px;
    }

    .barra-carrinho-html .info-titulo {
        font-size: 12px;
    }

    .barra-carrinho-html .info-valor {
        font-size: 16px;
    }

    .barra-carrinho-html .info-valor.total {
        font-size: 18px;
    }

    .barra-carrinho-html .btn-continuar {
        padding: 10px 25px;
        font-size: 14px;
        min-width: 120px;
    }

    .carrinho-ativo {
        padding-bottom: 70px;
    }

    /* Lightbox responsiva */
    .review-content {
        margin: 10px;
        max-height: 95vh;
    }

    .review-header,
    .review-body,
    .review-footer {
        padding: 15px;
    }

    .items-table {
        font-size: 13px;
    }

    .items-table th,
    .items-table td {
        padding: 8px 6px;
    }

    .review-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

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

    .date-highlight {
        min-width: 50px;
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .barra-carrinho-html .carrinho-info {
        gap: 20px;
    }

    .barra-carrinho-html .info-titulo {
        font-size: 11px;
    }

    .barra-carrinho-html .info-valor {
        font-size: 14px;
    }

    .barra-carrinho-html .info-valor.total {
        font-size: 16px;
    }

    .barra-carrinho-html .btn-continuar {
        padding: 8px 20px;
        font-size: 13px;
        min-width: 100px;
    }
}

/* ========================================
   ANIMAÇÕES E TRANSIÇÕES
   ======================================== */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.barra-carrinho-html.show {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.review-modal.show {
    animation: fadeIn 0.3s ease;
}

.review-modal.show .review-content {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   ESTADOS ESPECIAIS
   ======================================== */

/* Estado de carregamento */
.btn-reserve.loading {
    position: relative;
    color: transparent;
}

.btn-reserve.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Estado de sucesso */
.btn-reserve.success {
    background: #28a745;
}

.btn-reserve.success:hover {
    background: #218838;
}

/* ========================================
   MELHORIAS DE ACESSIBILIDADE
   ======================================== */

.review-close:focus,
.btn-continuar:focus,
.btn-reserve:focus {
    outline: 2px solid #00bae7;
    outline-offset: 2px;
}

.review-modal[aria-hidden="true"] {
    display: none;
}

.review-modal[aria-hidden="false"] {
    display: flex;
}

/* ========================================
   COMPATIBILIDADE COM TEMA EXISTENTE
   ======================================== */

/* Garantir que os estilos do carrinho não sejam sobrescritos */
.barra-carrinho-html,
.barra-carrinho-html *,
.review-modal,
.review-modal * {
    box-sizing: border-box;
}

/* Resetar estilos que podem interferir */
.review-modal p,
.review-modal h1,
.review-modal h2,
.review-modal h3,
.review-modal h4,
.review-modal h5,
.review-modal h6 {
    margin: 0;
    padding: 0;
}

.review-modal table {
    border-spacing: 0;
    border-collapse: collapse;
}

.review-modal button {
    font-family: inherit;
}

/* ========================================
   LIGHTBOX EXATA - BASEADA NAS IMAGENS
   ======================================== */

.review-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.review-content {
    background: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

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

.review-header {
    background: #666666;
    color: #ffffff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.review-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.review-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   BODY
   ======================================== */

.review-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

/* Informações do evento */
.event-info {
    margin-bottom: 25px;
}

.event-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 8px 0;
}

.event-date {
    font-size: 14px;
    color: #666666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-date i {
    color: #00bae7;
    font-size: 14px;
}

/* ========================================
   SEÇÃO DE DATA(S)
   ======================================== */

.date-section {
    margin-bottom: 25px;
}

/* Data única */
.single-date {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.date-box {
    background: #00bae7;
    color: #ffffff;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    min-width: 80px;
    font-weight: 600;
}

.date-box .day {
    font-size: 16px;
    line-height: 1;
}

.date-box .time {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.9;
}

.date-info {
    flex: 1;
}

.date-info .artists {
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
}

/* Múltiplas datas */
.multiple-dates {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.multiple-box {
    background: #00bae7;
    color: #ffffff;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    min-width: 120px;
    font-weight: 600;
}

.multiple-box .label {
    font-size: 12px;
    line-height: 1;
    margin-bottom: 2px;
}

.multiple-box .dates {
    font-size: 14px;
    line-height: 1;
}

.multiple-info {
    flex: 1;
}

.multiple-info .title {
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
}

/* ========================================
   TABELA
   ======================================== */

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

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

.items-table th {
    padding: 12px 10px;
    font-weight: 600;
    color: #333333;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.items-table .col-qtd,
.items-table .col-preco,
.items-table .col-taxa,
.items-table .col-total {
    text-align: center;
}

.items-table .col-item {
    width: 40%;
}

.items-table .col-qtd {
    width: 10%;
}

.items-table .col-preco {
    width: 20%;
}

.items-table .col-taxa {
    width: 15%;
}

.items-table .col-total {
    width: 15%;
}

.items-table td {
    padding: 15px 10px;
    color: #333333;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.items-table tbody tr:last-child td {
    border-bottom: none;
}

.items-table .item-name {
    font-weight: 500;
    color: #333333;
}

.items-table .price-value {
    font-weight: 600;
    color: #333333;
}

/* ========================================
   TERMOS
   ======================================== */

.terms-section {
    font-size: 12px;
    color: #666666;
    text-align: left;
    margin-bottom: 0;
    line-height: 1.4;
}

.terms-section a {
    color: #00bae7;
    text-decoration: none;
}

.terms-section a:hover {
    text-decoration: underline;
}

/* ========================================
   FOOTER
   ======================================== */

.review-footer {
    background: #666666;
    color: #ffffff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-items {
    font-size: 14px;
    color: #00bae7;
    font-weight: 500;
}

.cart-total {
    font-size: 22px;
    color: #00bae7;
    font-weight: 700;
}

.btn-reserve {
    background: #00bae7;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-reserve:hover {
    background: #0099c7;
    transform: translateY(-1px);
}

.btn-reserve:active {
    transform: translateY(0);
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    .review-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .review-header,
    .review-footer {
        padding: 15px 20px;
    }
    
    .review-title {
        font-size: 18px;
    }
    
    .review-body {
        padding: 20px;
    }
    
    .single-date,
    .multiple-dates {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .date-box,
    .multiple-box {
        align-self: flex-start;
    }
    
    .items-table {
        font-size: 12px;
    }
    
    .items-table th,
    .items-table td {
        padding: 8px 6px;
    }
    
    .review-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .btn-reserve {
        width: 100%;
        padding: 15px 20px;
    }
    
    .cart-total {
        font-size: 20px;
    }
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

.review-modal.show {
    display: flex !important;
}

.review-modal.show .review-content {
    animation: slideInScale 0.3s ease;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

