/**
 * Cart Page - ENHANCED CSS with WOW Factor
 * Built for cart-CUSTOM-COUPON.php template
 * Smooth animations, modern gradients, perfect alignment!
 */

/* ============================================
   CORE LAYOUT
   ============================================ */
.custom-cart-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-content {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 2rem;
}

.cart-left-column,
.cart-right-column {
    min-width: 0;
}

.cart-right-column {
    position: sticky;
    top: 2rem;
    align-self: start;
}

/* ============================================
   TABLE STRUCTURE & ALIGNMENT FIXES
   ============================================ */
.shop_table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Specific column widths */
.product-remove { width: 50px; text-align: center; }
.product-thumbnail { width: 120px; text-align: center; }
.product-name { width: auto; text-align: left; }
.product-price { width: 110px; text-align: center; }
.product-quantity { width: 130px; text-align: center; }
.product-subtotal { width: 110px; text-align: center; }

/* Ensure headers align with content */
.shop_table thead th {
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Align headers specifically */
.shop_table th.product-name { text-align: left; }
.shop_table th.product-price,
.shop_table th.product-quantity,
.shop_table th.product-subtotal { text-align: center; }

.shop_table td {
    padding: 1.5rem 1rem;
    vertical-align: middle;
}

/* Center these specific cells to match headers */
.product-price, 
.product-quantity, 
.product-subtotal {
    text-align: center;
}

/* ============================================
   TABLE STYLING - ENHANCED
   ============================================ */
.cart-left-column .shop_table {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.cart-left-column .shop_table:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.shop_table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.shop_table tbody tr:hover {
    background: linear-gradient(90deg, #fafbfc 0%, #f8fafc 100%);
}

.shop_table tbody tr:last-child {
    border-bottom: none;
}

.product-remove a.remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.product-remove a.remove:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.product-name a {
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.product-name a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4a0e0e 0%, #2c2222 100%);
    transition: width 0.3s ease;
}

.product-name a:hover {
    color: #4a0e0e;
}

.product-name a:hover::after {
    width: 100%;
}

.product-price {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    background: linear-gradient(135deg, #4a0e0e 0%, #2c2222 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-quantity input[type="number"] {
    width: 70px;
    height: 42px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
}

.product-quantity input[type="number"]:focus {
    outline: none;
    border-color: #4a0e0e;
    box-shadow: 0 0 0 3px rgba(74, 14, 14, 0.1);
    transform: scale(1.05);
}

.product-subtotal {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

/* ============================================
   PRODUCT THUMBNAIL - ENHANCED
   ============================================ */
.product-thumbnail {
    position: relative;
}

.product-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-thumbnail:hover img {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   CUSTOM COUPON SECTION - ENHANCED!
   ============================================ */
.custom-coupon-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.custom-coupon-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a0e0e 0%, #2c2222 50%, #ec4899 100%);
}

.custom-coupon-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Coupon wrapper - DESKTOP */
.custom-coupon-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.custom-coupon-wrapper label {
    font-weight: 700;
    color: #475569;
    margin: 0;
    font-size: 1rem;
}

.custom-coupon-wrapper input[type="text"] {
    flex: 1;
    min-width: 200px;
    height: 56px;
    padding: 0 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: white;
}

.custom-coupon-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #4a0e0e;
    box-shadow: 0 0 0 4px rgba(74, 14, 14, 0.1);
    transform: translateY(-1px);
}

.custom-coupon-wrapper .coupon-button {
    height: 56px;
    padding: 0 2rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-sizing: border-box;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.custom-coupon-wrapper .coupon-button:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4) !important;
}

.custom-coupon-wrapper .coupon-button:active {
    transform: translateY(0);
}

.custom-coupon-wrapper .coupon-button:focus {
    outline: none !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

/* Update cart button */
.custom-update-cart .update-cart-button {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3) !important;
}

.custom-update-cart .update-cart-button:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 116, 139, 0.4) !important;
}

.custom-update-cart .update-cart-button:active {
    transform: translateY(0);
}

.custom-update-cart .update-cart-button:focus {
    outline: none !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3) !important;
}

/* ============================================
   PAYMENT METHODS - ENHANCED
   ============================================ */
.cart-trust-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.cart-trust-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.cart-trust-section h3 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 1.5rem 0;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-method-icon {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
}

.payment-method-icon svg {
    width: 100%;
    height: 100%;
    padding: 8px;
}

.payment-method-icon:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #e2e8f0;
}

/* ============================================
   MONEY BACK GUARANTEE - ENHANCED
   ============================================ */
.money-back-guarantee {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
    transition: all 0.3s ease;
}

.money-back-guarantee::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.money-back-guarantee:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
}

.guarantee-badge {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    position: relative;
    z-index: 1;
}

.guarantee-badge .percentage {
    font-size: 1.25rem;
    font-weight: 900;
    color: white;
    line-height: 1;
}

.guarantee-badge .text {
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guarantee-text {
    position: relative;
    z-index: 1;
}

.guarantee-text h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #78350f;
    margin: 0 0 0.25rem 0;
}

.guarantee-text p {
    font-size: 0.9375rem;
    color: #92400e;
    margin: 0;
    font-weight: 500;
}

/* ============================================
   CART TOTALS - ENHANCED
   ============================================ */
.cart_totals {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.cart_totals:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.cart_totals h2 {
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, #1e293b 0%, #4a0e0e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 1.5rem 0;
}

.cart_totals .shop_table {
    table-layout: auto;
}

.cart_totals .shop_table tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.cart_totals .shop_table tr:hover {
    background: rgba(74, 14, 14, 0.02);
}

.cart_totals .shop_table tr:last-child {
    border-bottom: none;
}

.cart_totals .shop_table th,
.cart_totals .shop_table td {
    padding: 1.25rem 0;
}

.cart_totals .shop_table th {
    font-weight: 600;
    color: #64748b;
    text-align: left;
    font-size: 1rem;
}

.cart_totals .shop_table td {
    text-align: right;
    font-weight: 700;
    color: #0f172a;
    font-size: 1.125rem;
}

.cart_totals .order-total {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
}

.cart_totals .order-total th {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e40af;
    padding-left: 1rem;
}

.cart_totals .order-total td {
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, #4a0e0e 0%, #2c2222 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-right: 1rem;
}

/* ============================================
   TRUST BADGES - ENHANCED
   ============================================ */
.checkout-trust-badges {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
    transition: all 0.3s ease;
}

.checkout-trust-badges:hover {
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.2);
    transform: translateY(-2px);
}

.checkout-trust-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    transition: all 0.2s ease;
}

.checkout-trust-badge:not(:last-child) {
    border-bottom: 1px solid #bbf7d0;
}

.checkout-trust-badge:hover {
    transform: translateX(4px);
}

.checkout-trust-badge svg {
    color: #16a34a;
    filter: drop-shadow(0 2px 4px rgba(22, 163, 74, 0.2));
}

.checkout-trust-badge span {
    font-size: 1rem;
    font-weight: 700;
    color: #166534;
}

/* ============================================
   CHECKOUT BUTTON - ENHANCED
   ============================================ */
.wc-proceed-to-checkout .checkout-button {
    width: 100%;
    height: 64px;
    background: linear-gradient(135deg, #4a0e0e 0%, #2c2222 100%) !important;
    color: white !important;
    border: none !important;
    outline: none !important;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: block;
    text-align: center;
    line-height: 64px;
    letter-spacing: 1px;
    box-shadow: 0 8px 24px rgba(74, 14, 14, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.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;
}

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

.wc-proceed-to-checkout .checkout-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(74, 14, 14, 0.5) !important;
}

.wc-proceed-to-checkout .checkout-button:active {
    transform: translateY(-1px);
}

.wc-proceed-to-checkout .checkout-button:focus {
    outline: none !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(74, 14, 14, 0.3) !important;
}

/* ============================================
   MOBILE RESPONSIVE - FIXED & ENHANCED
   ============================================ */
@media (max-width: 1024px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
   
    .cart-right-column {
        position: static;
    }
   
    .payment-methods {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .custom-cart-wrapper {
        padding: 1rem 0.5rem;
    }
   
    /* Hide table headers */
    .shop_table thead {
        display: none;
    }
   
    /* Make rows blocks */
    .shop_table,
    .shop_table tbody,
    .shop_table tr {
        display: block;
        width: 100%;
    }
   
    .shop_table td {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }
   
    /* Product cards on mobile - FIXED ALIGNMENT */
    .shop_table tbody tr {
        display: grid;
        grid-template-areas:
            "thumb remove"
            "thumb name"
            "thumb price"
            "thumb qty"
            "thumb subtotal";
        grid-template-columns: 80px 1fr;
        gap: 0.5rem 1rem;
        padding: 1rem;
        margin-bottom: 1rem;
        background: white;
        border-radius: 12px;
    }
   
    .product-thumbnail {
        grid-area: thumb;
        align-self: start;
    }
   
    .product-remove {
        grid-area: remove;
        text-align: right;
    }
   
    .product-name {
        grid-area: name;
        text-align: left;
    }
   
    .product-price {
        grid-area: price;
        text-align: left;
    }
   
    .product-quantity {
        grid-area: qty;
        text-align: left;
    }
   
    .product-subtotal {
        grid-area: subtotal;
        text-align: left;
    }
   
    /* Ensure the mobile thumbnail stays centered */
    .product-thumbnail img {
        width: 80px;
        height: 80px;
    }
   
    .product-price::before {
        content: 'Price: ';
        color: #64748b;
        font-weight: 600;
    }
   
    .product-quantity::before {
        content: 'Qty: ';
        color: #64748b;
        font-weight: 600;
    }
   
    .product-subtotal::before {
        content: 'Total: ';
        color: #64748b;
        font-weight: 600;
    }
   
    /* CUSTOM COUPON - MOBILE (FIXED HEIGHT!) */
    .custom-coupon-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
   
    .custom-coupon-wrapper label {
        width: 100%;
        font-size: 1rem;
    }
   
    .custom-coupon-wrapper input[type="text"] {
        height: 56px !important; /* Match button height exactly */
        margin-bottom: 0;
        width: 100%;
        min-width: 100%;
        font-size: 1rem;
    }
   
    .custom-coupon-wrapper .coupon-button {
        height: 56px !important; /* Consistent with input */
        width: 100%;
        margin-bottom: 0;
    }
   
    .custom-update-cart .update-cart-button {
        height: 56px !important; /* Consistent height */
        width: 100%;
    }
   
    /* Payment methods - 2 columns */
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }
   
    /* Money back guarantee */
    .money-back-guarantee {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
   
    .guarantee-text h4 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .product-thumbnail,
    .product-thumbnail img {
        width: 60px;
        height: 60px;
    }
   
    .shop_table tbody tr {
        grid-template-columns: 60px 1fr;
        padding: 0.875rem;
    }
   
    .custom-coupon-wrapper input[type="text"],
    .custom-coupon-wrapper .coupon-button,
    .custom-update-cart .update-cart-button {
        height: 52px !important; /* Slightly smaller on very small screens */
        font-size: 0.9375rem;
    }
   
    .payment-method-icon {
        height: 48px;
    }
}