/* ========================================
   Shopping Cart Page Styles
   ======================================== */

/* Cart Layout - Full Width Two Column */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 60px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Cart Main - Product Table */
.cart-main {
    min-width: 0;
}

/* Cart Table */
.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.woocommerce-cart-form__contents thead th {
    text-align: left;
    padding: 20px;
    font-weight: 500;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #e5e5e5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woocommerce-cart-form__contents tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.woocommerce-cart-form__contents tbody td {
    padding: 30px 20px;
    vertical-align: middle;
}

/* Product Column */
.product-thumbnail {
    width: 120px;
    padding-right: 0;
}

.product-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.product-name a {
    color: #1a1a1a;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s;
}

.product-name a:hover {
    color: #B85C38;
}

.product-price {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

/* Quantity Column */
.product-quantity {
    text-align: center;
    width: 140px;
}

.quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.quantity .qty {
    width: 50px;
    height: 42px;
    text-align: center;
    border: none;
    font-size: 15px;
    font-weight: 500;
    -moz-appearance: textfield;
}

.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity .qty-btn {
    width: 36px;
    height: 42px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
}

.quantity .qty-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

/* Subtotal Column */
.product-subtotal {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    width: 120px;
    text-align: right;
}

/* Remove Button */
.product-remove {
    width: 50px;
    text-align: right;
}

.product-remove a {
    color: #999;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.product-remove a:hover {
    color: #e74c3c;
    background: #ffebee;
}

/* Cart Actions */
.cart-actions-row td {
    padding: 40px 0;
    border-bottom: none;
}

.cart-actions-wrapper,
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.coupon,
.coupon-section {
    display: flex;
    gap: 12px;
    align-items: center;
}

.coupon input,
.coupon-section .coupon-input {
    padding: 14px 20px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    min-width: 220px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.coupon input:focus,
.coupon-section .coupon-input:focus {
    outline: none;
    border-color: #b5651d;
}

.coupon .button,
.update-cart-button,
.coupon-section .btn-coupon,
.cart-actions .btn-update-cart {
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coupon .button,
.coupon-section .btn-coupon {
    background: #B85C38;
    color: #fff;
}

.coupon .button:hover,
.coupon-section .btn-coupon:hover {
    background: #9a4a2a;
}

.update-cart-button,
.cart-actions .btn-update-cart {
    background: #d4a88c;
    color: #fff;
}

.update-cart-button:hover,
.cart-actions .btn-update-cart:hover {
    background: #c49a7e;
}

/* Cart Summary Column - Totals */
.cart-summary-col {
    position: sticky;
    top: 30px;
}

.cart_totals,
.cart-totals-box {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 35px;
    border-radius: 12px;
}

.cart_totals h2,
.cart-totals-box h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 30px;
}

/* totals-row style for cart.html compatibility */
.cart-totals-box .totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-totals-box .totals-row span:first-child {
    font-weight: 500;
    color: #666;
}

.cart-totals-box .totals-row .amount {
    font-weight: 500;
    color: #1a1a1a;
}

.cart-totals-box .totals-row.total-row {
    border-top: 1px solid #e5e5e5;
    border-bottom: none;
    font-size: 18px;
    font-weight: 600;
}

.cart-totals-box .totals-row.total-row span {
    font-weight: 600;
}

.cart_totals table {
    width: 100%;
    margin-bottom: 30px;
    border-collapse: collapse;
}

.cart_totals th,
.cart_totals td {
    padding: 18px 0;
    font-size: 15px;
}

.cart_totals th {
    font-weight: 400;
    color: #666;
    text-align: left;
}

.cart_totals td {
    text-align: right;
    font-weight: 500;
    color: #1a1a1a;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-size: 18px;
    font-weight: 600;
    border-top: 1px solid #e5e5e5;
    padding-top: 20px;
}

/* Free Shipping Progress */
.free-shipping-notice,
.free-shipping-section {
    margin: 25px 0;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.free-shipping-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.free-shipping-bar,
.progress-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.free-shipping-progress,
.progress-fill {
    height: 100%;
    background: #B85C38;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout {
    margin-top: 25px;
}

.wc-proceed-to-checkout a,
.btn-checkout-page {
    display: block;
    width: 100%;
    padding: 18px;
    background: #B85C38;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.wc-proceed-to-checkout a:hover,
.btn-checkout-page:hover {
    background: #9a4a2a;
}

/* Cart table header column aliases for cart.html compatibility */
.woocommerce-cart-form__contents .col-product,
.woocommerce-cart-form__contents .product-name {
    text-align: left;
}

.woocommerce-cart-form__contents .col-quantity,
.woocommerce-cart-form__contents .product-quantity {
    text-align: center;
    width: 140px;
}

.woocommerce-cart-form__contents .col-subtotal,
.woocommerce-cart-form__contents .product-subtotal {
    text-align: right;
    width: 120px;
}

.woocommerce-cart-form__contents .col-action,
.woocommerce-cart-form__contents .product-remove {
    width: 50px;
    text-align: right;
}

/* Responsive */
@media (max-width: 1200px) {
    .cart-layout {
        grid-template-columns: 1fr 350px;
        gap: 40px;
        padding: 40px 30px;
    }
}

@media (max-width: 991px) {
    .cart-layout {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
    
    .cart-summary-col {
        position: static;
    }
    
    .woocommerce-cart-form__contents {
        display: block;
    }
    
    .woocommerce-cart-form__contents thead {
        display: none;
    }
    
    .woocommerce-cart-form__contents tbody,
    .woocommerce-cart-form__contents tr {
        display: block;
    }
    
    .woocommerce-cart-form__contents tr {
        padding: 20px 0;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }
    
    .woocommerce-cart-form__contents td {
        display: block;
        padding: 8px 0;
        border: none;
    }
    
    .product-thumbnail {
        width: auto;
    }
    
    .product-thumbnail img {
        width: 80px;
        height: 80px;
    }
    
    .product-remove {
        position: absolute;
        top: 20px;
        right: 0;
        width: auto;
    }
    
    .product-quantity {
        width: auto;
        text-align: left;
    }
    
    .product-subtotal {
        width: auto;
        text-align: left;
    }
    
    .cart-actions-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .coupon {
        flex-direction: column;
        width: 100%;
    }
    
    .coupon input {
        width: 100%;
    }
    
    .cart_totals {
        max-width: 100%;
    }
}

/* ========================================
   Mini Cart Sidebar Styles
   ======================================== */

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 460px;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
}

.cart-sidebar.active {
    transform: translateX(0);
}

/* Cart Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cart-close {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
    font-family: inherit;
}

.cart-close:hover {
    color: #333;
}

.cart-close i {
    font-size: 16px;
}

/* Cart Body */
.cart-body,
.cart-sidebar > .widget_shopping_cart_content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.cart-body .widget_shopping_cart_content,
.cart-sidebar > .widget_shopping_cart_content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: min-content;
}

/* Cart Footer */
.cart-footer {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    margin-top: auto;
}

/* Mini Cart Footer - WooCommerce Default Structure */
.cart-sidebar .cart-footer,
.widget_shopping_cart_content .woocommerce-mini-cart__total,
.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    display: block !important;
}

/* Mini Cart Subtotal */
.widget_shopping_cart_content .woocommerce-mini-cart__total,
.cart-footer .cart-subtotal {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart__total strong,
.cart-footer .cart-subtotal span:first-child {
    font-weight: 500 !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart__total .amount,
.cart-footer .subtotal-amount {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #b5651d !important;
}

/* Mini Cart Buttons */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a {
    display: block !important;
    width: 100% !important;
    padding: 14px !important;
    text-align: center !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

/* View Cart Button */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons a:first-child {
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a:first-child:hover {
    background: #ebebeb !important;
}

/* Checkout Button */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons a.checkout {
    background: #B85C38 !important;
    color: #fff !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a.checkout:hover {
    background: #9a4a2a !important;
}

/* Mini Cart Custom Footer Buttons */
.cart-footer .cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-footer .btn-view-cart,
.cart-footer .btn-checkout {
    display: block;
    width: 100%;
    padding: 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cart-footer .btn-view-cart {
    background: #f5f5f5;
    color: #1a1a1a;
}

.cart-footer .btn-view-cart:hover {
    background: #ebebeb;
}

.cart-footer .btn-checkout {
    background: #B85C38;
    color: #fff;
}

.cart-footer .btn-checkout:hover {
    background: #9a4a2a;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cart Item */
.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 50px 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.5;
    margin: 0;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.cart-item-price {
    font-size: 13px;
    color: #B85C38;
    font-weight: 600;
    margin-top: 6px;
}

.cart-item-price .qty {
    color: #666;
    font-weight: 400;
}

/* Cart Item Remove Button */
.cart-item-remove {
    position: absolute;
    top: 20px;
    right: 16px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    color: #888;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.cart-item-remove:hover {
    background: #e0e0e0;
    color: #666;
}

/* Mini Cart Items - WooCommerce Default Structure */
.widget_shopping_cart_content .woocommerce-mini-cart-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 16px !important;
    padding: 20px 50px 20px 20px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    position: relative !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item > a:not(.remove) {
    display: flex !important;
    align-items: flex-start !important;
    gap: 16px !important;
    flex: 1 !important;
    text-decoration: none !important;
    color: inherit !important;
    min-width: 0 !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item img {
    width: 70px !important;
    height: 70px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

/* Mini Cart Product Info Block */
.widget_shopping_cart_content .woocommerce-mini-cart-item > a:not(.remove) > span {
    flex: 1 !important;
    min-width: 0 !important;
    display: block !important;
}

/* Mini Cart Product Name */
.widget_shopping_cart_content .woocommerce-mini-cart-item > a:not(.remove) {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    line-height: 1.5 !important;
}

/* Mini Cart Quantity and Price */
.widget_shopping_cart_content .woocommerce-mini-cart-item .quantity {
    display: block !important;
    margin-top: 6px !important;
    font-size: 13px !important;
    color: #666 !important;
    font-weight: 400 !important;
    border: none !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item .quantity .woocommerce-Price-amount {
    color: #B85C38 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

/* Mini Cart Remove Button */
.widget_shopping_cart_content .woocommerce-mini-cart-item .remove {
    position: absolute !important;
    top: 20px !important;
    right: 16px !important;
    width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f0f0f0 !important;
    border-radius: 4px !important;
    color: #888 !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item .remove:hover {
    background: #e0e0e0 !important;
    color: #666 !important;
}

/* Empty Cart */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.cart-empty i {
    font-size: 60px;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.cart-empty p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.btn-continue {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-continue:hover {
    background: #333;
}

/* Cart Count Badge */
.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background: #B85C38;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50%;
    margin-left: 6px;
    padding: 0 6px;
}

/* Prevent body scroll when cart is open */
body.cart-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
    }
    
    .cart-header,
    .cart-body,
    .cart-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
