/* Alert message styles */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #fff;
    font-weight: bold;
}

.alert-warning {
    background-color: #f0ad4e;
    border: 1px solid #eea236;
}

.cart-page-title {
    color: var(--primary-color, #1f2937);
    text-align: center;
    margin-bottom: 12px;
}

.empty-cart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    margin: 16px auto 24px;
    padding: 24px 20px;
    max-width: 620px;
    border-radius: 12px;
    background: var(--card-bg, #fff);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.empty-cart-message {
    margin: 0;
    color: var(--text-light, #4b5563);
    font-size: 1.05rem;
    line-height: 1.5;
}

.btn-back-store {
    background: var(--primary-color, #2ecc71);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-back-store,
.btn-back-store:visited,
.btn-back-store:hover,
.btn-back-store:focus,
.btn-back-store:active {
    color: #fff !important;
}

.btn-back-store:hover {
    background: var(--secondary-color, var(--primary-color, #27ae60));
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Carrinho de compras styles */
.cart-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}
.cart-table th, .cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.cart-total {
    text-align: center; /* Center the total on desktop too */
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-sizing: border-box;
    max-width: 400px; /* Limit width for better appearance */
    margin-left: auto;
    margin-right: auto;
}
.quantity-input {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}
.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.product-name {
    font-weight: bold;
    color: var(--text-color);
}

/* ============================================
   RESPONSIVIDADE - CARRINHO
   ============================================ */

/* Tablets */
@media (max-width: 1024px) {
    .cart-table {
        font-size: 0.95rem;
    }

    .product-image {
        width: 70px;
        height: 70px;
    }
}

/* Mobile landscape e portrait */
@media (max-width: 768px) {
    body, html {
        margin: 0;
        padding: 0;
        width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        padding: 12px;
        box-sizing: border-box;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .cart-page-title {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }

    .empty-cart-state {
        padding: 20px 16px;
        margin: 12px auto 20px;
    }

    .product-image {
        width: 70px;
        height: 70px;
        object-fit: cover;
    }

    .cart-table, .cart-table th, .cart-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .cart-table {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 12px;
    }

    .cart-table tr {
        margin-bottom: 0;
        padding: 14px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: none;
    }

    .cart-table th, .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        width: 100%;
        text-align: left;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 8px;
        flex-shrink: 0;
    }

    .cart-total {
        text-align: center;
        margin-top: 16px;
        padding: 14px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .cart-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 16px;
        padding: 12px;
        width: 100%;
        gap: 10px;
    }

    .btn-continue, .btn-primary, .btn-back-store {
        width: 100%;
        max-width: none;
        padding: 14px 20px;
        min-height: 48px;
    }

    .quantity-input {
        width: 50px;
        height: 36px;
        font-size: 1rem;
    }

    .quantity-controls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        margin-top: 8px;
        width: 100%;
    }

    .quantity-btn {
        width: 36px;
        height: 36px;
        min-width: 44px;
        min-height: 44px;
        font-size: 18px;
    }

    .product-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        gap: 8px;
    }

    .product-image {
        margin: 0 auto 4px;
    }

    .product-name {
        font-size: 1rem;
        text-align: center;
    }

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

    .modal-content {
        background: white;
        padding: 18px;
        border-radius: 8px;
        text-align: center;
        width: 100%;
        max-width: none;
    }

    .modal-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 14px;
    }

    .modal-button {
        padding: 12px 16px;
        min-height: 44px;
    }
}

/* Mobile portrait pequeno */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .cart-page-title {
        font-size: 1.25rem;
    }

    .cart-table tr {
        padding: 10px;
    }

    .product-image {
        width: 60px;
        height: 60px;
    }

    .btn-continue, .btn-primary, .btn-back-store {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Modal styles for desktop */
@media (min-width: 769px) {
    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    .modal-content {
        background: white;
        padding: 20px;
        border-radius: 8px;
        text-align: center;
        max-width: 400px;
        width: 90%;
    }

    .modal-buttons {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

    .modal-button {
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        border: none;
    }

    .modal-button-confirm {
        background: #dc3545;
        color: white;
    }

    .modal-button-cancel {
        background: #6c757d;
        color: white;
    }
}

.quantity-controls {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;
    gap: 5px;
    width: 100%; /* Full width for proper centering */
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.quantity-btn:hover {
    background: var(--primary-color-dark);
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    margin-left: auto; /* Center horizontally */
    margin-right: auto; /* Center horizontally */
}

/* Remover setinhas do input number */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Estilos para o botão "continuar comprando" */
.btn-continue {
    background: #2ecc71; /* Verde mais claro */
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #2ecc71 !important; /* Verde mais claro */
    color: white !important;
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
}

.btn-primary:hover {
    background: #27ae60 !important; /* Verde um pouco mais escuro no hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Estilos para o botão "remover item" */
.btn-secondary {
    background: #dc3545; /* Red color for remove button */
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #c82333; /* Darker red on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ============================================================================
   CROSS-SELL STYLES
   ============================================================================ */

.cross-sell-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.cross-sell-section h3 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    color: var(--primary-color, #1f2937);
    font-weight: 700;
}

.cross-sell-subtitle {
    margin: 0 0 1.25rem;
    color: var(--text-light, #6b7280);
    font-size: 0.95rem;
}

.cross-sell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .cross-sell-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .cross-sell-section {
        padding: 1rem;
    }
    
    .cross-sell-section h3 {
        font-size: 1.2rem;
    }
}

.cross-sell-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.cross-sell-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cross-sell-image-link {
    display: block;
    width: 100%;
    padding-top: 100%; /* Aspect ratio 1:1 */
    position: relative;
    background: #f9fafb;
}

.cross-sell-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cross-sell-item:hover .cross-sell-image {
    transform: scale(1.05);
}

.cross-sell-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.cross-sell-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cross-sell-price-promo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cross-sell-price-current {
    font-size: 1.05rem;
    font-weight: 700;
    color: #dc2626;
}

.cross-sell-price-original {
    font-size: 0.8rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.cross-sell-price-regular {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color, #1f2937);
}

.btn-cross-sell-view {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-top: auto;
    background: var(--primary-color);
    color: white !important;
    text-align: center;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-cross-sell-view:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}
