/**
 * WooCommerce Cart Page Styles
 * RS Aquatics Theme
 */

/* ==========================================================================
   Base Cart Structure
   ========================================================================== */

.woocommerce {
    width: 100%;
}

.woocommerce-cart-form {
    width: 100%;
}

/* Clear floats */
.woocommerce::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Desktop Layout (768px and above)
   ========================================================================== */

@media (min-width: 768px) {
    .woocommerce-cart-form {
        float: left;
        width: 65%;
        padding-right: 30px;
    }

    .cart-collaterals {
        float: right;
        width: 35%;
        position: sticky;
        top: 0px;
    }
}

/* ==========================================================================
   Cart Table Styling
   ========================================================================== */

.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

/* Table Header */
.woocommerce-cart-form__contents thead {
    background: rgba(0, 229, 255, 0.05);
}

.woocommerce-cart-form__contents thead th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #00e5ff;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0, 229, 255, 0.2);
}

.woocommerce-cart-form__contents thead th.product-thumbnail,
.woocommerce-cart-form__contents thead th.product-remove {
    width: 0;
    padding: 0;
}
.woocommerce-cart-form__contents thead th.product-remove{
    display: none;
}
/* ==========================================================================
   Product Row Styling (Desktop)
   ========================================================================== */

.cart_item {
    transition: all 0.3s ease;
}

.cart_item:hover {
    background: rgba(0, 229, 255, 0.03);
}

.cart_item > td {
    padding: 20px 12px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
}

/* Product Thumbnail */
.cart_item .product-thumbnail {
    width: 80px;
}

.cart_item .product-thumbnail img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

/* Product Name */
.cart_item .product-name {
    width: 35%;
}

.cart_item .product-name a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.cart_item .product-name a:hover {
    color: #00e5ff;
}

/* Product Price */
.cart_item .product-price {
    color: #9ca3af;
    font-size: 14px;
}

/* Product Subtotal */
.cart_item .product-subtotal {
    color: #00e5ff;
    font-weight: 600;
    font-size: 16px;
}

/* Remove the default × remove link */
.cart_item .product-remove {
    display: none;
}

/* ==========================================================================
   Quantity Selector
   ========================================================================== */

.product-quantity {
    width: 140px;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(17, 17, 24, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 8px;
    padding: 4px;
}

.quantity-wrapper input.qty {
    width: 40px;
    height: 32px;
    text-align: center;
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    -moz-appearance: textfield;
}

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

.quantity-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

/* Default state - Minus and Plus buttons */
.qty-minus,
.qty-plus {
    background: rgba(0, 229, 255, 0.1);
    color: #00e5ff;
}

.qty-minus:hover,
.qty-plus:hover {
    background: rgba(0, 229, 255, 0.25);
    transform: scale(1.1);
}

/* Delete state - Red trash icon */
.qty-minus.is-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.qty-minus.is-delete:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

/* ==========================================================================
   Cart Actions (Coupon + Update Cart)
   ========================================================================== */

.actions {
    padding: 24px 0 !important;
    border-top: 2px solid rgba(0, 229, 255, 0.2);
}

/* Coupon Section */
.coupon {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #1a1a24 !important;
    border: 1px solid #2d2d3d !important;
    border-radius: 0.75rem !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.coupon label {
    display: none;
}

.coupon input.input-text {
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 12px 16px;
    background: rgba(17, 17, 24, 0.5);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.coupon input.input-text:focus {
    outline: none;
    border-color: #00e5ff;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.coupon input.input-text::placeholder {
    color: #6b7280;
}

.coupon button.button {
    width: auto !important;
    padding: 12px 24px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 8px;
    color: #00e5ff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-top: unset !important;
}

.coupon button.button:hover {
    background: rgba(0, 229, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
}

/* Update Cart Button */
button[name="update_cart"] {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 8px;
    color: #00e5ff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button[name="update_cart"]:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.1);
    transform: translateY(-2px);
}

button[name="update_cart"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Cart Totals Sidebar
   ========================================================================== */

.cart_totals {
    background: rgba(17, 17, 24, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.cart_totals h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.cart_totals .shop_table {
    width: 100%;
    margin-bottom: 24px;
}

.cart_totals .shop_table tr {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart_totals .shop_table th {
    font-weight: 500;
    color: #9ca3af;
}

.cart_totals .shop_table td {
    font-weight: 600;
    color: #fff;
}

.cart_totals .order-total {
    border-bottom: none;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid rgba(0, 229, 255, 0.2);
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-size: 18px;
    font-weight: 700;
    color: #00e5ff;
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout {
    margin-top: 20px;
}

.wc-proceed-to-checkout .checkout-button {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #00e5ff 0%, #00b8d4 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a0f;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wc-proceed-to-checkout .checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
}

.wc-proceed-to-checkout .checkout-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.wc-proceed-to-checkout .checkout-button:hover::before {
    left: 100%;
}

/* ==========================================================================
   Mobile Layout (below 768px)
   ========================================================================== */

@media (max-width: 767px) {
    /* Stack layout */
    .woocommerce-cart-form,
    .cart-collaterals {
        float: none;
        width: 100%;
        padding-right: 0;
    }

    .cart-collaterals {
        position: static;
        margin-top: 30px;
    }

    /* Transform table to cards */
    .shop_table,
    .shop_table tbody,
    .shop_table tr,
    .shop_table td,
    .shop_table th {
        display: block;
        width: 100%;
    }

    /* Hide table headers */
    .shop_table thead {
        display: none;
    }

    /* Product card styling */
    .cart_item {
        display: grid !important;
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto auto;
        gap: 8px 12px;
        padding: 16px;
        margin-bottom: 16px;
        background: rgba(17, 17, 24, 0.5);
        border: 1px solid rgba(0, 229, 255, 0.1);
        border-radius: 12px;
        position: relative;
    }

    .cart_item > td {
        padding: 0;
        border: none;
    }

    /* Image on left */
    .cart_item .product-thumbnail {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: auto;
    }

    .cart_item .product-thumbnail img {
        width: 80px;
        height: 80px;
        border-radius: 8px;
    }

    /* Name on right */
    .cart_item .product-name {
        grid-column: 2;
        grid-row: 1;
        width: auto;
    }

    /* Price below name */
    .cart_item .product-price {
        grid-column: 2;
        grid-row: 2;
        width: auto;
        color: #00e5ff;
        font-weight: 600;
        font-size: 16px;
    }

    /* Quantity and subtotal row */
    .cart_item .product-quantity {
        grid-column: 1 / span 2;
        grid-row: 3;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid rgba(0, 229, 255, 0.1);
    }

    .cart_item .product-subtotal {
        display: none; /* Hide subtotal, show only in quantity row */
    }

    /* Show subtotal label in mobile */
    .cart_item .product-quantity::before {
        content: 'Subtotal: ';
        color: #6b7280;
        font-size: 14px;
    }

    .cart_item .product-quantity::after {
        content: attr(data-subtotal);
        color: #00e5ff;
        font-weight: 600;
        font-size: 16px;
    }

    /* Mobile quantity selector */
    .quantity-wrapper {
        order: -1;
    }

    /* Actions section */
    .actions {
        padding: 16px 0 !important;
    }

    /* Coupon inline on mobile */
    .coupon {
        flex-direction: row;
    }

    .coupon button.button {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Extra Small Mobile (below 412px)
   ========================================================================== */

@media (max-width: 411px) {
    .cart_item {
        grid-template-columns: 60px 1fr;
        gap: 6px 10px;
        padding: 12px;
    }

    .cart_item .product-thumbnail img {
        width: 60px;
        height: 60px;
    }

    .cart_item .product-name a {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .cart_item .product-price {
        font-size: 14px;
    }

    .quantity-wrapper {
        transform: scale(0.9);
        transform-origin: left center;
    }

    .cart_totals {
        padding: 16px;
    }

    .cart_totals h2 {
        font-size: 18px;
    }

    .wc-proceed-to-checkout .checkout-button {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Empty Cart Styling
   ========================================================================== */

.woocommerce-cart .cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 18px;
}

.woocommerce-cart .cart-empty::before {
    content: '\f07a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    display: block;
    font-size: 64px;
    color: rgba(0, 229, 255, 0.2);
    margin-bottom: 24px;
}

.woocommerce-cart .return-to-shop {
    text-align: center;
    margin-top: 24px;
}

.woocommerce-cart .return-to-shop .button {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #00e5ff 0%, #00b8d4 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a0f;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.woocommerce-cart .return-to-shop .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
}

/* ==========================================================================
   Messages & Notifications
   ========================================================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    border-left: 4px solid;
}

.woocommerce-message {
    background: rgba(0, 229, 255, 0.1);
    border-color: #00e5ff;
    color: #00e5ff;
}

.woocommerce-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

.woocommerce-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.woocommerce-cart-form.processing {
    opacity: 0.6;
    pointer-events: none;
}

.woocommerce-cart-form.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(0, 229, 255, 0.2);
    border-top-color: #00e5ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Cross-sells / Product Carousel
   ========================================================================== */

.cross-sells,
.cart-collaterals + section,
.cart-related-products {
    clear: both;
    /* margin-top: 60px; */
    padding-top: 40px;
    border-top: 1px solid rgba(0, 229, 255, 0.1);
}

.cross-sells h2,
.cart-related-products h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}
