/**
 * Rave Essentials Cart Styles
 *
 * Consolidated styles for the shopping cart page.
 * Uses CSS custom properties from variables.css for consistency.
 */

/* ================================
   Cart Page Layout
   ================================ */
.cart-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'Montserrat', sans-serif;
}

.cart-page .content-card {
    background-color: rgba(40, 0, 40, 0.7);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 15px var(--rave-glow-subtle);
    font-family: 'Montserrat', sans-serif;
}

/* ================================
   Table Styles
   ================================ */
.cart-page .table-dark {
    background-color: rgba(20, 0, 30, 0.7);
    color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cart-page .table-dark thead {
    background-color: #333;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cart-page .table-dark th {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    padding: 8px 4px;
    border-color: rgba(255, 255, 255, 0.1);
    text-shadow: none;
}

.cart-page .table-dark td {
    padding: 8px 4px;
    text-align: center;
    vertical-align: middle;
    border-color: rgba(255, 255, 255, 0.1);
    font-weight: normal;
    text-shadow: none;
}

.cart-page .table-dark tr:hover {
    background-color: rgba(50, 10, 50, 0.4);
}

/* Mobile responsive table */
.cart-page .mobile-responsive-table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    background-color: rgba(20, 0, 30, 0.7);
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cart-page .mobile-responsive-table th,
.cart-page .mobile-responsive-table td {
    padding: 6px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    vertical-align: middle;
    word-wrap: break-word;
}

.cart-page .mobile-responsive-table th {
    background-color: #333;
    font-weight: 600;
    white-space: nowrap;
}

.cart-page .quantity-column,
.cart-page .price-column {
    width: 20%;
    min-width: 60px;
}

/* ================================
   Quantity Controls
   ================================ */
.cart-page .quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.cart-page .quantity-input {
    width: 30px;
    text-align: center;
    background-color: rgba(20, 0, 30, 0.7);
    border: 1px solid rgba(255, 0, 255, 0.3);
    color: #fff;
    font-size: 0.9rem;
    padding: 2px;
    margin: 0;
    border-radius: var(--radius-sm);
}

.cart-page .quantity-input:focus {
    outline: none;
    box-shadow: 0 0 5px var(--rave-glow-medium);
}

/* Cart action buttons */
.cart-page .cart-btn {
    font-weight: bold;
    border: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
    padding: 2px 6px;
}

.cart-page .cart-btn:hover {
    transform: translateY(-1px);
}

.cart-page .btn-minus {
    background-color: #ffc107;
    color: #000;
    font-size: 1rem;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.5);
}

.cart-page .btn-minus:hover {
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
}

.cart-page .btn-plus {
    background-color: #28a745;
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.5);
}

.cart-page .btn-plus:hover {
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.7);
}

/* ================================
   Price Summary
   ================================ */
.cart-page .price-summary {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(20, 0, 40, 0.5);
    border-radius: 10px;
}

.cart-page .price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 0, 255, 0.2);
    color: #fff;
    font-size: 1rem;
}

.cart-page .price-label {
    font-size: 1.1rem;
    color: #fff !important;
    font-weight: 500;
    display: inline-block;
    visibility: visible;
    opacity: 1;
}

.cart-page .price-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.cart-page .grand-total {
    border-top: 2px solid var(--rave-glow-medium);
    border-bottom: none;
    margin-top: 10px;
    padding-top: 15px;
    font-weight: bold;
    font-size: 1.2rem;
}

.cart-page .free-shipping-hint {
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.15), rgba(0, 200, 255, 0.15));
    border: 1px solid rgba(0, 255, 170, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    margin: 10px 0;
    color: #00ffaa;
    font-size: 0.95rem;
    text-align: center;
}

.cart-page .free-shipping-hint .icon {
    margin-right: 8px;
}

.cart-page .grand-total .price-label,
.cart-page .grand-total .price-value {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ================================
   Discount Form & Messages
   ================================ */
.discount-form {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.discount-input {
    flex-grow: 1;
    background-color: rgba(20, 0, 30, 0.7);
    border: 1px solid rgba(255, 0, 255, 0.3);
    color: #fff;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: var(--radius-md);
}

.discount-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.discount-input:focus {
    background-color: rgba(40, 10, 60, 0.6);
    border-color: var(--rave-glow-medium);
    box-shadow: 0 0 0 0.2rem rgba(255, 0, 255, 0.15);
    color: #fff;
    outline: none;
}

.discount-form .btn-rave {
    border-radius: var(--radius-md);
    min-width: 100px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px 15px;
}

.applied-code {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.code-text {
    color: #00ffaa;
    font-weight: 600;
}

.discount-message {
    padding: 10px 15px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    position: relative;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.discount-message.error {
    color: #fff;
    background-color: rgba(255, 30, 86, 0.2);
    border: 1px solid rgba(255, 30, 86, 0.5);
    box-shadow: 0 0 10px rgba(255, 30, 86, 0.3);
}

.discount-message.success {
    color: #fff;
    background-color: rgba(0, 255, 170, 0.2);
    border: 1px solid rgba(0, 255, 170, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

/* ================================
   Alert Animations
   ================================ */
.custom-alert {
    animation: fadeIn 0.3s ease-in-out;
}

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

.custom-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.7;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transition: all var(--transition-fast);
}

.custom-close:hover {
    opacity: 1;
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* ================================
   Cart Button Overrides
   ================================ */
.cart-page .btn-outline-light {
    border: 2px solid var(--rave-glow-medium);
    color: var(--rave-primary);
    font-weight: bold;
    transition: all var(--transition-normal);
}

.cart-page .btn-outline-light:hover {
    background-color: rgba(255, 0, 255, 0.2);
    border-color: var(--rave-primary);
    color: white;
}

.cart-page .btn-outline-danger {
    border-color: rgba(255, 100, 100, 0.5);
    color: #ff6b6b;
}

.cart-page .btn-outline-danger:hover {
    background-color: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.8);
    color: #ff8080;
}

.cart-page .d-grid {
    margin-bottom: 50px;
}

/* ================================
   Responsive Styles
   ================================ */
@media (max-width: 768px) {
    .cart-page {
        padding: 0 10px;
        max-width: 100%;
    }

    .cart-page .content-card {
        padding: 20px 15px;
        width: 100%;
        border-radius: 10px;
    }

    .cart-page .quantity-controls {
        gap: 1px;
    }

    .cart-page .table-responsive {
        width: 100%;
    }

    .cart-page .price-summary {
        width: 100%;
    }

    .discount-message {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .discount-form .discount-input {
        padding: 8px 12px;
    }

    .discount-form .btn-rave {
        padding: 8px 15px;
    }

    .cart-page .d-grid {
        width: 100%;
    }

    .cart-page .mobile-responsive-table {
        font-size: 0.85rem;
    }

    .cart-page .mobile-responsive-table th,
    .cart-page .mobile-responsive-table td {
        padding: 5px;
    }

    .cart-page .quantity-column,
    .cart-page .price-column {
        width: 20%;
        min-width: 50px;
    }

    .cart-page .mobile-responsive-table td {
        word-break: break-word;
    }
}

/* ================================
   Discount Eligibility Indicators
   ================================ */
.discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00ffaa, #00c8ff);
    color: #000;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.discount-badge-sm {
    display: inline-block;
    background: linear-gradient(135deg, #00ffaa, #00c8ff);
    color: #000;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    white-space: nowrap;
    text-transform: uppercase;
}

/* ================================
   Consolidated Discount Section
   ================================ */
.discount-applied-section {
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
}

.discount-applied-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.discount-applied-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.discount-code-label {
    color: #00c853;
    font-weight: 600;
    font-size: 0.95rem;
}

.discount-code-label .icon {
    color: #00c853;
}

.discount-savings {
    color: #00c853;
    font-weight: 700;
    font-size: 1rem;
}

.btn-remove-discount {
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.5);
    color: #ff6b6b;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-discount:hover {
    background: rgba(255, 100, 100, 0.1);
    border-color: #ff6b6b;
}

.discount-restriction-note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Price summary savings indicators - professional green */
.cart-page .price-value.savings-text,
.savings-text {
    color: #22c55e;
    font-weight: 600;
}

/* Extra small screens (e.g., Samsung Galaxy S8+, 360px) */
@media (max-width: 430px) {
    .cart-page {
        padding: 0 5px;
        max-width: 100%;
    }

    .cart-page .content-card {
        padding: 15px 10px;
        width: 100%;
        border-radius: 10px;
    }

    .cart-page .content-card h1 {
        font-size: 1.5rem;
    }

    .cart-page .mobile-responsive-table {
        font-size: 0.8rem;
        width: 100%;
    }

    .cart-page .mobile-responsive-table th,
    .cart-page .mobile-responsive-table td {
        padding: 3px;
    }

    .cart-page .quantity-column,
    .cart-page .price-column {
        width: 20%;
        min-width: 45px;
    }

    .cart-page .price-summary {
        padding: 15px 10px;
        width: 100%;
        margin-top: 15px;
    }

    .cart-page .price-row {
        padding: 8px 0;
        font-size: 0.9rem;
    }

    .cart-page .price-label {
        font-size: 0.9rem;
    }

    .cart-page .price-value {
        font-size: 0.9rem;
    }

    .cart-page .grand-total {
        font-size: 1.1rem;
        padding-top: 10px;
    }

    .cart-page .grand-total .price-label,
    .cart-page .grand-total .price-value {
        font-size: 1.1rem;
    }

    .cart-page .quantity-controls {
        gap: 0;
    }

    .cart-page .quantity-input {
        width: 25px;
        font-size: 0.8rem;
    }

    .cart-page .cart-btn {
        padding: 1px 4px;
        font-size: 0.8rem;
    }

    .discount-form {
        flex-direction: column;
        gap: 5px;
    }

    .discount-form .btn-rave {
        width: 100%;
        min-width: auto;
    }
}
