/* =========================================
   Shopping Cart Styles
   ========================================= */

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Cart Table */
.cart-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.cart-table th {
    background-color: #f9f9f9;
    color: var(--color-secondary);
    font-weight: 700;
    padding: 15px 20px;
    text-transform: uppercase;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.cart-table td {
    padding: 25px 20px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

/* Product Item */
.product-item {
    display: flex;
    gap: 20px;
    align-items: center;
}

.product-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.product-info .category {
    font-size: 11px;
    color: var(--color-primary);
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

.product-info .title {
    font-size: 16px;
    margin-bottom: 5px;
}

.product-info .title a {
    color: var(--color-secondary);
}

.product-info .title a:hover {
    color: var(--color-primary);
}

.product-info .desc {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.product-info .meta {
    font-size: 12px;
    color: var(--color-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-swatch {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Quantity Control */
.qty-control {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    height: 40px;
}

.qty-btn {
    width: 35px;
    background: #fafafa;
    border: none;
    cursor: pointer;
    color: var(--color-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.qty-btn:hover {
    background: #eee;
}

.qty-input {
    width: 40px;
    border: none;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--color-secondary);
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Unit Price & Subtotal */
.unit-price {
    font-family: var(--font-en);
    font-size: 14px;
    color: var(--color-text);
}

.subtotal {
    font-family: var(--font-en);
    font-size: 16px;
    color: var(--color-secondary);
}

.font-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.update-btn {
    background-color: var(--color-accent-green);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.update-btn:hover {
    background-color: #43A047;
    transform: translateY(-2px);
}

.remove-btn {
    background-color: #F44336;
    box-shadow: 0 4px 10px rgba(244, 67, 54, 0.3);
}

.remove-btn:hover {
    background-color: #D32F2F;
    transform: rotate(90deg);
}

/* Sidebar Widgets */
.cart-widget {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
}

.cart-widget .widget-title {
    margin-top: 0;
}

/* Coupon Widget */
.coupon-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.coupon-form input {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-jp);
}

.coupon-form input:focus {
    border-color: var(--color-primary);
    outline: none;
}

#coupon-message {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
}

.text-success {
    color: var(--color-accent-green);
}

.text-error {
    color: #F44336;
}

/* Total Widget */
.cart-totals-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.cart-totals-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-light-gray);
    font-size: 14px;
    color: var(--color-text-light);
    font-family: var(--font-en);
    font-weight: 600;
}

.cart-totals-list li span:last-child {
    color: var(--color-secondary);
    font-weight: 700;
}

.text-red {
    color: #F44336 !important;
}

.cart-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-top: 2px solid var(--color-light-gray);
    font-weight: 700;
    font-family: var(--font-en);
}

.cart-grand-total span:first-child {
    color: var(--color-secondary);
    font-size: 16px;
}

.cart-grand-total span:last-child {
    color: var(--color-primary);
    font-size: 28px;
}

.btn--checkout {
    font-size: 16px;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(0, 188, 212, 0.4);
}

.btn--checkout:hover {
    transform: translateY(-3px);
}

/* Empty Cart State */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cart-empty i {
    font-size: 80px;
    color: var(--color-border);
    margin-bottom: 25px;
}

.cart-empty h2 {
    margin-bottom: 15px;
    color: var(--color-secondary);
}

.cart-empty p {
    color: var(--color-text-light);
    margin-bottom: 25px;
}

.cart-empty .btn {
    min-width: 200px;
}

/* Responsive */
@media (max-width: 991px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-sidebar {
        margin-top: 20px;
    }
}

@media (max-width: 767px) {
    .cart-table thead {
        display: none;
        /* Hide header on mobile */
    }

    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .cart-table tr {
        margin-bottom: 20px;
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius);
        padding: 15px;
        position: relative;
    }

    .cart-table td {
        padding: 10px 0;
        text-align: left;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cart-table td::before {
        content: attr(class);
        /* Fallback */
        font-weight: 700;
        font-size: 12px;
        color: var(--color-text-light);
        text-transform: uppercase;
        display: block;
        /* Show label */
    }

    /* Specific Mobile Labels via CSS content if needed, or structured differently */
    .cart-table td.unit-price::before {
        content: "Unit Price:";
    }

    .cart-table td.subtotal::before {
        content: "Subtotal:";
    }

    .product-details-cell {
        border-bottom: 1px solid var(--color-light-gray) !important;
        margin-bottom: 10px;
        padding-bottom: 15px !important;
    }

    .product-details-cell::before {
        display: none !important;
    }

    .product-item {
        width: 100%;
    }

    .qty-control {
        margin-left: auto;
    }

    .product-action {
        justify-content: flex-end;
    }
}

/* Chic Blue Button Updates (Refactored) */
#redeem-btn,
.btn--checkout {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
    border-color: #2c3e50 !important;
    box-shadow: 0 2px 5px rgba(44, 62, 80, 0.3) !important;
    transition: all 0.3s ease;
}

#redeem-btn:hover,
.btn--checkout:hover {
    background-color: #34495e !important;
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.4) !important;
    transform: translateY(-2px);
}