/**
 * Cart & Checkout Stylesheet
 * Version: 1.0.0
 * Description: Unified CSS for Cart, Checkout, and Order pages
 * Author: Reb7awy Team
 */

/* ============================================
   VARIABLES (matching main theme)
   ============================================ */
:root {
    --reb7awy-primary: #667eea;
    --reb7awy-secondary: #764ba2;
    --reb7awy-accent: #f093fb;
    --reb7awy-bg-dark: #0f172a;
    --reb7awy-bg-card: #1e293b;
    --reb7awy-bg-hover: #334155;
    --reb7awy-text-primary: #f1f5f9;
    --reb7awy-text-secondary: #cbd5e1;
    --reb7awy-text-muted: #94a3b8;
    --reb7awy-border: rgba(255, 255, 255, 0.1);
    --reb7awy-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --reb7awy-glow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* ============================================
   CART PAGE
   ============================================ */

.woocommerce-cart {
    background: var(--reb7awy-bg-dark);
}

/* Cart Table */
.woocommerce-cart-form {
    background: var(--reb7awy-bg-card);
    border-radius: 30px;
    padding: 40px;
    border: 1px solid var(--reb7awy-border);
    margin-bottom: 30px;
}

.woocommerce-cart-form .shop_table {
    background: transparent;
    border: none;
    color: var(--reb7awy-text-primary);
}

.woocommerce-cart-form .shop_table thead {
    background: var(--reb7awy-bg-dark);
    border-radius: 15px;
}

.woocommerce-cart-form .shop_table th {
    color: var(--reb7awy-text-primary);
    font-weight: 600;
    padding: 20px;
    border: none;
    text-align: right;
}

.woocommerce-cart-form .shop_table td {
    color: var(--reb7awy-text-secondary);
    padding: 25px 20px;
    border-top: 1px solid var(--reb7awy-border);
    vertical-align: middle;
}

/* Product Thumbnail */
.woocommerce-cart-form .product-thumbnail img {
    border-radius: 15px;
    border: 2px solid var(--reb7awy-border);
    max-width: 80px;
}

/* Product Name */
.woocommerce-cart-form .product-name a {
    color: var(--reb7awy-text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.woocommerce-cart-form .product-name a:hover {
    color: var(--reb7awy-primary);
}

/* Product Price */
.woocommerce-cart-form .product-price,
.woocommerce-cart-form .product-subtotal {
    color: var(--reb7awy-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Quantity Input */
.woocommerce-cart-form .quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.woocommerce-cart-form .quantity input[type="number"] {
    background: var(--reb7awy-bg-dark);
    border: 1px solid var(--reb7awy-border);
    color: var(--reb7awy-text-primary);
    border-radius: 10px;
    padding: 10px 15px;
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.woocommerce-cart-form .quantity input[type="number"]:focus {
    border-color: var(--reb7awy-primary);
    outline: none;
}

/* Remove Button */
.woocommerce-cart-form .product-remove a {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444 !important;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.woocommerce-cart-form .product-remove a:hover {
    background: #ef4444;
    color: white !important;
    transform: rotate(90deg);
}

/* Update Cart Button */
.woocommerce-cart-form button[name="update_cart"] {
    background: linear-gradient(135deg, var(--reb7awy-primary), var(--reb7awy-secondary));
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.woocommerce-cart-form button[name="update_cart"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Coupon Section */
.coupon {
    background: var(--reb7awy-bg-dark);
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.coupon input[type="text"] {
    background: var(--reb7awy-bg-card);
    border: 1px solid var(--reb7awy-border);
    color: var(--reb7awy-text-primary);
    border-radius: 15px;
    padding: 12px 20px;
    flex: 1;
}

.coupon input[type="text"]:focus {
    border-color: var(--reb7awy-primary);
    outline: none;
}

.coupon button {
    background: var(--reb7awy-bg-hover);
    color: var(--reb7awy-primary);
    border: 2px solid var(--reb7awy-primary);
    padding: 12px 30px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coupon button:hover {
    background: var(--reb7awy-primary);
    color: white;
}

/* Cart Totals */
.cart-collaterals {
    margin-top: 30px;
}

.cart_totals {
    background: var(--reb7awy-bg-card);
    border-radius: 30px;
    padding: 40px;
    border: 1px solid var(--reb7awy-border);
    box-shadow: var(--reb7awy-shadow);
}

.cart_totals h2 {
    color: var(--reb7awy-text-primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.cart_totals table {
    width: 100%;
    border: none;
}

.cart_totals th,
.cart_totals td {
    padding: 15px 0;
    border-top: 1px solid var(--reb7awy-border);
    color: var(--reb7awy-text-secondary);
}

.cart_totals th {
    text-align: right;
    font-weight: 500;
}

.cart_totals td {
    text-align: left;
    font-weight: 600;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    color: var(--reb7awy-primary);
    font-size: 1.3rem;
    padding-top: 20px;
    border-top: 2px solid var(--reb7awy-border);
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout a {
    display: block;
    background: linear-gradient(135deg, var(--reb7awy-primary), var(--reb7awy-secondary));
    color: white !important;
    text-align: center;
    padding: 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 25px;
    transition: all 0.3s ease;
}

.wc-proceed-to-checkout a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */

.woocommerce-checkout {
    background: var(--reb7awy-bg-dark);
}

/* Billing Form */
.woocommerce-billing-fields,
.woocommerce-shipping-fields,
.woocommerce-additional-fields {
    background: var(--reb7awy-bg-card);
    border-radius: 30px;
    padding: 40px;
    border: 1px solid var(--reb7awy-border);
    margin-bottom: 30px;
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3 {
    color: var(--reb7awy-text-primary);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

/* Form Fields */
.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    background: var(--reb7awy-bg-dark);
    border: 1px solid var(--reb7awy-border);
    color: var(--reb7awy-text-primary);
    border-radius: 12px;
    padding: 15px;
    width: 100%;
}

.woocommerce-checkout .form-row input:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
    border-color: var(--reb7awy-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.woocommerce-checkout .form-row label {
    color: var(--reb7awy-text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.woocommerce-checkout .form-row .required {
    color: #ef4444;
}

/* Order Review */
#order_review {
    background: var(--reb7awy-bg-card);
    border-radius: 30px;
    padding: 40px;
    border: 1px solid var(--reb7awy-border);
    position: sticky;
    top: 100px;
}

#order_review h3 {
    color: var(--reb7awy-text-primary);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

#order_review table {
    width: 100%;
    border: none;
}

#order_review th,
#order_review td {
    padding: 15px 0;
    border-top: 1px solid var(--reb7awy-border);
    color: var(--reb7awy-text-secondary);
}

#order_review th {
    text-align: right;
    font-weight: 500;
}

#order_review td {
    text-align: left;
}

#order_review .product-name {
    color: var(--reb7awy-text-primary);
    font-weight: 500;
}

#order_review .product-total {
    color: var(--reb7awy-primary);
    font-weight: 600;
}

#order_review .order-total th,
#order_review .order-total td {
    color: var(--reb7awy-primary);
    font-size: 1.3rem;
    padding-top: 20px;
    border-top: 2px solid var(--reb7awy-border);
    font-weight: 700;
}

/* Payment Methods */
.woocommerce-checkout-payment {
    background: var(--reb7awy-bg-dark);
    border-radius: 20px;
    padding: 25px;
    margin-top: 25px;
}

.wc_payment_methods {
    list-style: none;
    padding: 0;
}

.wc_payment_method {
    background: var(--reb7awy-bg-card);
    border: 1px solid var(--reb7awy-border);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.wc_payment_method:hover {
    border-color: var(--reb7awy-primary);
    box-shadow: var(--reb7awy-glow);
}

.wc_payment_method input[type="radio"] {
    margin-left: 15px;
}

.wc_payment_method label {
    color: var(--reb7awy-text-primary);
    font-weight: 600;
    cursor: pointer;
}

.payment_box {
    background: var(--reb7awy-bg-dark);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    color: var(--reb7awy-text-secondary);
}

/* Place Order Button */
#place_order {
    width: 100%;
    background: linear-gradient(135deg, var(--reb7awy-primary), var(--reb7awy-secondary));
    color: white;
    border: none;
    padding: 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
}

#place_order:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5);
}

/* ============================================
   ORDER RECEIVED (Thank You Page)
   ============================================ */

.woocommerce-order-received {
    background: var(--reb7awy-bg-dark);
}

.woocommerce-order {
    background: var(--reb7awy-bg-card);
    border-radius: 30px;
    padding: 50px;
    border: 1px solid var(--reb7awy-border);
}

.woocommerce-notice--success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.woocommerce-notice--success::before {
    content: "✓";
    display: inline-block;
    margin-left: 15px;
    font-size: 1.5rem;
}

/* Order Details */
.woocommerce-order-details {
    background: var(--reb7awy-bg-dark);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
}

.woocommerce-order-details h2 {
    color: var(--reb7awy-text-primary);
    margin-bottom: 20px;
}

.woocommerce-order-details table {
    width: 100%;
    border: none;
}

.woocommerce-order-details th,
.woocommerce-order-details td {
    padding: 15px;
    border-top: 1px solid var(--reb7awy-border);
    color: var(--reb7awy-text-secondary);
}

.woocommerce-order-details th {
    text-align: right;
    font-weight: 600;
    color: var(--reb7awy-text-primary);
}

/* Customer Details */
.woocommerce-customer-details {
    background: var(--reb7awy-bg-dark);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
}

.woocommerce-customer-details h2 {
    color: var(--reb7awy-text-primary);
    margin-bottom: 20px;
}

.woocommerce-customer-details address {
    color: var(--reb7awy-text-secondary);
    line-height: 1.8;
    font-style: normal;
}

/* ============================================
   MESSAGES & ALERTS
   ============================================ */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-radius: 15px;
    padding: 20px 25px;
    margin-bottom: 20px;
    border: none;
}

.woocommerce-message {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-right: 4px solid #10b981;
}

.woocommerce-info {
    background: rgba(102, 126, 234, 0.1);
    color: var(--reb7awy-primary);
    border-right: 4px solid var(--reb7awy-primary);
}

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

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {

    .woocommerce-cart-form,
    .cart_totals,
    .woocommerce-billing-fields,
    #order_review,
    .woocommerce-order {
        padding: 25px 20px;
        border-radius: 20px;
    }

    #order_review {
        position: static;
    }

    .woocommerce-cart-form .shop_table {
        font-size: 0.9rem;
    }

    .woocommerce-cart-form .product-thumbnail img {
        max-width: 60px;
    }
}

@media (max-width: 576px) {
    .coupon {
        flex-direction: column;
    }

    .coupon input[type="text"],
    .coupon button {
        width: 100%;
    }
}

/* ============================================
   HIDE REGULAR PRICE - CART
   ============================================ */
.woocommerce-cart .product-price del,
.woocommerce-cart .product-price .price-regular,
.woocommerce-cart .product-subtotal del,
.woocommerce-cart .product-subtotal .price-regular,
.woocommerce-cart .wcs-price-regular {
    display: none !important;
}