/* ==========================================================================
   WooCommerce Cart Styling
   Extracted from woocommerce/cart/cart.php & woocommerce/cart/cart-totals.php
   ========================================================================== */

/* Modern DLM Cart Styling - Scoped to cart content only */
.woocommerce-cart .dlm-cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    z-index: 1;
}

/* Cart Header - Only within cart container */
.woocommerce-cart .dlm-cart-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
    width: 100%;
}

.woocommerce-cart .dlm-cart-title {
    font-size: 2.5rem;
    color: #102a43;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.woocommerce-cart .dlm-cart-title i {
    margin-right: 1rem;
    color: #102a43;
}

.woocommerce-cart .dlm-cart-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
    text-align: center;
}

/* Empty Cart - Only within cart container */
.woocommerce-cart .dlm-empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 0 auto;
}

.dlm-empty-cart-icon {
    font-size: 4rem;
    color: #102a43;
    margin-bottom: 2rem;
    opacity: 0.7;
}

.dlm-empty-cart h2 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.dlm-empty-cart p {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Cart Items */
.dlm-cart-items {
    margin-bottom: 2rem;
}

.dlm-cart-item {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid #102a43;
}

.dlm-cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.dlm-cart-item-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    margin-right: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.dlm-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dlm-cart-item-details {
    flex: 1;
}

.dlm-cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.dlm-cart-item-name {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.4;
}

.dlm-cart-item-name a {
    color: #102a43;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dlm-cart-item-name a:hover {
    color: #0b1e33;
}

.dlm-remove-btn {
    background: #dc3545;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.dlm-remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
    color: white;
}

.dlm-cart-item-meta {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.dlm-cart-item-pricing {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
}

.dlm-cart-item-price,
.dlm-cart-item-quantity,
.dlm-cart-item-total {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dlm-price-label,
.dlm-quantity-label,
.dlm-total-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dlm-price-value,
.dlm-total-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #102a43;
}

.dlm-quantity-controls input {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    transition: border-color 0.3s ease;
}

.dlm-quantity-controls input:focus {
    border-color: #102a43;
    outline: none;
}

.dlm-quantity-fixed {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #e9ecef;
    border-radius: 6px;
    font-weight: 600;
    color: #495057;
}

/* Cart Actions */
.dlm-cart-actions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.dlm-coupon-section h3 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.dlm-coupon-section h3 i {
    margin-right: 0.5rem;
    color: #102a43;
}

.dlm-coupon-form {
    display: flex;
    gap: 0.5rem;
}

.dlm-coupon-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.dlm-coupon-input:focus {
    border-color: #102a43;
    outline: none;
}

.dlm-cart-update {
    text-align: right;
}

/* Buttons */
.dlm-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
    justify-content: center;
}

.dlm-btn-primary {
    background: linear-gradient(135deg, #102a43 0%, #0b1e33 100%);
    color: white;
    border-color: #102a43;
}

.dlm-btn-primary:hover {
    background: linear-gradient(135deg, #0b1e33 0%, #070f1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(158, 50, 53, 0.3);
    color: white;
}

.dlm-btn-secondary {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.dlm-btn-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    color: white;
}

.dlm-btn-outline {
    background: transparent;
    color: #102a43;
    border-color: #102a43;
}

.dlm-btn-outline:hover {
    background: #102a43;
    color: white;
    transform: translateY(-2px);
}

.dlm-btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.dlm-btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    color: white;
}

/* Cart Summary */
.dlm-cart-summary {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Loading Animation */
.dlm-cart-item {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success Messages */
.woocommerce-cart .woocommerce-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: none;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    color: #155724;
    font-weight: 500;
}

.woocommerce-cart .woocommerce-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: none;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    color: #721c24;
    font-weight: 500;
}

/* ==========================================================================
   Cart Totals Styling (from cart-totals.php)
   ========================================================================== */

/* Modern Cart Totals Styling - Scoped to cart only */
.woocommerce-cart .dlm-cart-totals {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    max-width: 100%;
    position: relative;
}

.woocommerce-cart .dlm-totals-header {
    background: linear-gradient(135deg, #102a43 0%, #0b1e33 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    width: 100%;
}

.dlm-totals-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: white !important;
}

.dlm-totals-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
    color: white !important;
}

.dlm-totals-content {
    padding: 2rem;
}

.dlm-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.dlm-totals-row:last-child {
    border-bottom: none;
}

.dlm-totals-row:hover {
    background: #f8f9fa;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 8px;
}

.dlm-totals-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: #495057;
}

.dlm-totals-label i {
    width: 16px;
    text-align: center;
    color: #102a43;
}

.dlm-totals-value {
    font-weight: 600;
    color: #212529;
    font-size: 1.1rem;
}

/* Coupon Row */
.dlm-coupon-row {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #28a745;
}

.dlm-coupon-row .dlm-totals-label {
    color: #155724;
}

.dlm-discount-value {
    color: #28a745 !important;
    font-weight: 700;
}

.dlm-remove-coupon {
    color: #dc3545;
    text-decoration: none;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.dlm-remove-coupon:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* Total Row */
.dlm-total-row {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    margin: 1rem 0;
    border: 2px solid #102a43;
}

.dlm-total-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #102a43;
}

.dlm-total-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #102a43;
}

/* Checkout Section */
.dlm-checkout-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    text-align: center;
}

.dlm-checkout-actions {
    margin-bottom: 2rem;
}

.dlm-checkout-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    border: none;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.dlm-checkout-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    color: white;
}

.dlm-checkout-btn i {
    font-size: 1.2rem;
}

.dlm-checkout-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.dlm-checkout-text small {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

.dlm-security-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dlm-security-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.dlm-security-item i {
    font-size: 1.5rem;
    color: #28a745;
}

.dlm-continue-shopping {
    border-top: 1px solid #dee2e6;
    padding-top: 1.5rem;
}

.dlm-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #102a43;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.dlm-continue-btn:hover {
    background: #102a43;
    color: white;
    transform: translateX(-3px);
}

/* Hide default WooCommerce elements */
.cart_totals:not(.dlm-cart-totals) {
    display: none !important;
}

.cart_totals:not(.dlm-cart-totals) h2,
.cart_totals:not(.dlm-cart-totals) .shop_table,
.cart_totals:not(.dlm-cart-totals) .wc-proceed-to-checkout {
    display: none !important;
}

/* Force our custom totals to show */
.dlm-cart-totals {
    display: block !important;
}

/* ==========================================================================
   Cart Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .dlm-cart-container {
        padding: 1rem;
    }

    .dlm-cart-title {
        font-size: 2rem;
    }

    .dlm-cart-item {
        flex-direction: column;
        text-align: center;
    }

    .dlm-cart-item-image {
        width: 100px;
        height: 100px;
        margin: 0 auto 1rem auto;
    }

    .dlm-cart-item-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .dlm-cart-item-pricing {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .dlm-cart-actions {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .dlm-cart-update,
    .dlm-cart-clear {
        text-align: center;
    }

    .dlm-coupon-form {
        flex-direction: column;
    }

    .dlm-cart-update {
        text-align: center;
    }

    .dlm-totals-header {
        padding: 1.5rem;
    }

    .dlm-totals-title {
        font-size: 1.3rem;
    }

    .dlm-totals-content {
        padding: 1.5rem;
    }

    .dlm-checkout-section {
        padding: 1.5rem;
    }

    .dlm-security-badges {
        flex-direction: column;
        gap: 1rem;
    }

    .dlm-checkout-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .dlm-cart-title {
        font-size: 1.8rem;
    }

    .dlm-cart-item {
        padding: 1rem;
    }

    .dlm-cart-actions {
        padding: 1.5rem;
    }

    .dlm-totals-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .dlm-totals-value {
        align-self: flex-end;
    }

    .dlm-total-row {
        text-align: center;
    }

    .dlm-total-row .dlm-totals-row {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Cart Totals Animation */
.dlm-cart-totals {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
