/* ========================================
   WOOCOMMERCE CART PAGE STYLES
   ======================================== */

/* Cart Page Body Class */
body.woocommerce-cart {
    background-color: #ffffff;
}

body.woocommerce-cart .site-content {
    background-color: #ffffff;
}

/* Cart Wrapper */
.ac-cart-wrapper {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 40px 0 80px;
}

.ac-cart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* View Total Button - Mobile Only */
.ac-view-total-btn {
    display: none;
    width: 100%;
    padding: 18px 30px;
    background-color: transparent;
    color: #000;
    text-align: center;
    font-family: "Delight", sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    border: 2px solid #000;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.ac-view-total-btn:hover {
    background-color: #000;
    color: #fff;
}

@media (max-width: 1024px) {
    .ac-view-total-btn {
        display: block;
    }
}

/* Cart Layout - Two Column */
.ac-cart-layout {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 60px;
    align-items: start;
}

/* Cart Items Column */
.ac-cart-items-column {
    background: transparent;
}

.ac-cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual Cart Item */
.ac-cart-item {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    padding: 40px 0;
    border-bottom: 1px solid #999;
    background: transparent;
}

.ac-cart-item:first-child {
    padding-top: 0;
}

.ac-cart-item:last-child {
    border-bottom: none;
}

/* Cart Item Image */
.ac-cart-item-image {
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    background: #fff;
}

.ac-cart-item-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.ac-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Cart Item Details */
.ac-cart-item-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
}

.ac-cart-item-info {
    flex: 1;
}

/* Product Name */
.ac-cart-item-name {
    font-family: "Delight", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.ac-cart-item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ac-cart-item-name a:hover {
    color: #c45a3b;
}

/* Product Condition */
.ac-cart-item-condition {
    font-size: 16px;
    color: #666;
    margin: 0 0 15px 0;
    font-weight: 400;
}

/* Product Price */
.ac-cart-item-price {
    margin-bottom: 20px;
}

.ac-price-current {
    font-family: "Delight", sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #000;
}

.ac-price-current .woocommerce-Price-currencySymbol {
    font-size: inherit;
}

.ac-price-original {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
    margin-left: 15px;
    font-weight: 400;
}

/* Product Color */
.ac-cart-item-color {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.ac-color-label {
    font-size: 14px;
    font-weight: 700;
    color: #000;
}

.ac-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 0;
    border: 1px solid #e0e0e0;
    display: inline-block;
}

/* Cart Item Actions */
.ac-cart-item-actions {
    display: flex;
    align-items: flex-end;
    gap: 30px;
    margin-top: auto;
}

/* Quantity Wrapper */
.ac-quantity-wrapper {
    display: flex;
    align-items: center;
}

.ac-quantity-wrapper .quantity {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    background: #fff;
}

.ac-quantity-wrapper .quantity .qty {
    width: 60px;
    height: 50px;
    text-align: center;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: #000;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

/* Custom Quantity Buttons */
.ac-qty-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #000;
    transition: background-color 0.3s ease;
}

.ac-qty-btn:hover {
    background-color: #f0f0f0;
}

.ac-qty-btn.ac-qty-minus {
    border-right: 1px solid #e0e0e0;
}

.ac-qty-btn.ac-qty-plus {
    border-left: 1px solid #e0e0e0;
}

.ac-remove-link {
    font-size: 15px;
    color: #999;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.ac-remove-link:hover {
    color: #c45a3b;
}

/* Cart Sidebar */
.ac-cart-total-sidebar {
    position: sticky;
    top: 120px;
}

.ac-cart-totals-wrapper {
    background: #FBEAE2;
    padding: 30px;
}

/* Totals Title */
.ac-totals-title {
    font-family: "Delight", sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: #000;
    margin: 0 0 30px 0;
    line-height: 1.2;
}

/* Totals Rows */
.ac-totals-rows {
    margin-bottom: 30px;
}

.ac-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.ac-totals-label {
    font-size: 14px;
    font-weight: 700;
    color: #000;
}

.ac-totals-value {
    font-size: 14px;
    font-weight: 400;
    color: #000;
    text-align: right;
}

.ac-totals-value .woocommerce-Price-amount {
    font-weight: 400;
}

/* Free Shipping */
.ac-free-shipping {
    color: #000;
    font-weight: 400;
}

/* Order Total */
.ac-totals-total {
    border-top: 1px solid #e0e0e0;
    margin-top: 15px;
    padding-top: 20px;
}

.ac-totals-total .ac-totals-label {
    font-family: "Delight", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.ac-totals-total .ac-totals-value {
    font-family: "Delight", sans-serif;
    font-size: 28px;
    font-weight: 700;
}

.ac-totals-total .ac-totals-value .woocommerce-Price-amount {
    font-weight: 700;
}

/* Checkout Button */
.ac-checkout-button-wrapper {
    margin-bottom: 25px;
}

.ac-checkout-button {
    display: block;
    width: 100%;
    padding: 18px 30px;
    background-color: #c45a3b;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-family: "Delight", sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ac-checkout-button:hover {
    background-color: #a04830;
    color: #fff;
}

/* Payment Icons */
.ac-payment-icons {
    margin-bottom: 25px;
}

.ac-payment-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    width: 100%;
}

.ac-payment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    flex: 1;
}

.ac-payment-icon svg {
    width: 100%;
    height: 40px;
}

.ac-payment-findometic svg, .ac-payment-amex svg {
    padding: 4px;
}

.ac-findomestic-text {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    font-style: italic;
}

.ac-payment-bank {
    text-align: center;
    padding: 7.5px;
    background: #fff;
    cursor: default;
}

.ac-bank-transfer {
    font-size: 13px;
    font-weight: 900;
    color: #000;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Coupon Section */
.ac-coupon-section {
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.ac-coupon-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    transition: opacity 0.3s ease;
}

.ac-coupon-toggle:hover {
    opacity: 0.7;
}

.ac-coupon-label {
    font-family: "Delight", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.ac-coupon-icon {
    font-size: 24px;
    font-weight: 300;
    color: #000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

.ac-coupon-toggle.active .ac-coupon-icon {
    transform: rotate(45deg);
}

.ac-coupon-form {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 0;
}

.ac-coupon-form.active {
    max-height: 200px;
    opacity: 1;
    padding-top: 20px;
}

.ac-coupon-form-inner {
    display: flex;
    gap: 0;
    align-items: stretch;
    background: #fff;
    border: 2px solid #c35226;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.ac-coupon-form-inner:focus-within {
    border-color: #c35226;
}

.ac-coupon-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: #000;
    background: transparent;
    outline: none;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ac-coupon-input::placeholder {
    color: #999;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.ac-coupon-input:focus {
    outline: none;
}

.ac-coupon-submit {
    padding: 16px 24px;
    background: #c35226;
    border: none;
    border-left: 2px solid #c35226;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 60px;
    position: relative;
}

.ac-coupon-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #c35226;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.ac-coupon-submit:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.ac-coupon-submit svg {
    color: #fff;
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.ac-coupon-submit:hover svg {
    transform: translateX(3px);
}

.ac-coupon-submit:active {
    transform: scale(0.98);
}

/* Trust Badges */
.ac-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.ac-trust-badge {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid #c45a3b;
    border-radius: 8px;
    background: #fbeae2;
    color: #c45a3b;
    font-size: 12px;
    font-weight: 900;
}

/* Cart Actions (Hidden but functional) */
.ac-cart-actions {
    display: none;
}

/* Custom Quantity Control */
.ac-quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #000;
    background: #fff;
    height: 50px;
}

.ac-quantity-control .qty {
    width: 60px;
    height: 48px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: #000;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
    outline: none;
    padding: 0;
    margin: 0;
}

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

.ac-quantity-control .qty:focus {
    outline: none;
}

.ac-quantity-control .ac-qty-btn {
    width: 50px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    color: #000;
    transition: background-color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.ac-quantity-control .ac-qty-btn:hover {
    background-color: #ffffff;
}

/* ========================================
   WOOCOMMERCE CART RESPONSIVE STYLES
   ======================================== */

@media (max-width: 1200px) {
    .ac-cart-layout {
        grid-template-columns: 1fr 380px;
        gap: 40px;
    }
    
    .ac-cart-item {
        grid-template-columns: 280px 1fr;
    }
    
    .ac-cart-item-image {
        max-width: 280px;
    }
}

@media (max-width: 1024px) {
    .ac-cart-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .ac-cart-total-sidebar {
        position: static;
    }
    
    /* Full width sidebar on mobile - breaking out of container */
    @media (max-width: 768px) {
        .ac-cart-total-sidebar {
            width: 100vw;
            max-width: 100vw;
            margin-left: calc(-50vw + 50%);
            margin-right: calc(-50vw + 50%);
            background: #FBEAE2;
            padding-bottom: 60px;
        }
    }
    
    .ac-cart-item {
        grid-template-columns: 250px 1fr;
        gap: 25px;
    }
    
    .ac-cart-item-image {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .ac-cart-wrapper {
        padding: 20px 0 0;
    }
    
    .ac-cart-container {
        padding: 0 20px;
    }

    .ac-cart-page .e-con.e-flex {
        padding-bottom: 0px;
    }
    
    /* Mobile Cart Item Layout - Image Left, Details Right */
    .ac-cart-item {
        display: flex;
        gap: 15px;
        padding: 30px 0;
    }
    
    .ac-cart-item-image {
        flex: 1;
        width: 50%;
        max-width: 50%;
        aspect-ratio: 1 / 1;
        background: #ffffff;
    }
    
    .ac-cart-item-details {
        flex: 1;
        width: 50%;
        max-width: 50%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .ac-cart-item-name {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    .ac-cart-item-condition {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .ac-price-current {
        font-size: 22px;
    }
    
    .ac-price-original {
        font-size: 14px;
        margin-left: 10px;
    }
    
    .ac-cart-item-price {
        margin-bottom: 12px;
    }
    
    .ac-cart-item-color {
        margin-bottom: 0;
    }
    
    .ac-color-label {
        font-size: 13px;
    }
    
    .ac-color-swatch {
        width: 20px;
        height: 20px;
    }
    
    /* Mobile Quantity Controls - Horizontal Layout with Remove Link */
    .ac-cart-item-actions {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 10px;
        margin-top: auto;
        padding-top: 15px;
    }
    
    .ac-quantity-wrapper {
        width: auto;
        flex-shrink: 0;
    }
    
    .ac-quantity-control {
        height: 36px;
        border: 1px solid #000;
    }
    
    .ac-quantity-control .ac-qty-btn {
        width: 36px;
        height: 34px;
        font-size: 18px;
    }
    
    .ac-remove-item {
        width: auto;
        text-align: right;
    }
    
    .ac-remove-link {
        font-size: 13px;
    }

    .ac-trust-badges {
        padding: 0 30px;
    }
    
    .ac-cart-totals-wrapper {
        padding: 30px;
    }
    
    .ac-totals-title {
        font-size: 32px;
    }
    
    .ac-totals-total .ac-totals-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    
    .ac-cart-item-name {
        font-size: 18px;
    }
    
    .ac-price-current {
        font-size: 22px;
    }
    
    .ac-quantity-control {
        height: 44px;
    }
    
    .ac-quantity-control .ac-qty-btn {
        width: 20px;
        height: 42px;
        font-size: 18px;
    }
    
    .ac-totals-title {
        font-size: 28px;
    }
    
    .ac-checkout-button {
        padding: 15px 25px;
        font-size: 14px;
    }
    
    .ac-trust-badges {
        justify-content: center;
    }
    
    .ac-trust-badge {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* ========================================
   WOOCOMMERCE QUANTITY INPUT OVERRIDE
   ======================================== */

/* Override default WooCommerce quantity styles */
.woocommerce .ac-quantity-wrapper .quantity {
    display: flex !important;
    align-items: center;
    border: 1px solid #e0e0e0;
    background: #fff;
}

.woocommerce .ac-quantity-wrapper .quantity input.qty {
    width: 60px !important;
    height: 50px !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #000 !important;
    background: transparent !important;
}

/* Cart Loading State */
.ac-cart-wrapper.updating {
    position: relative;
    pointer-events: none;
}

.ac-cart-wrapper.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 100;
}

.ac-cart-wrapper.updating::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e0e0e0;
    border-top-color: #c45a3b;
    border-radius: 50%;
    animation: ac-cart-spin 0.8s linear infinite;
    z-index: 101;
}

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

/* Hide default WooCommerce cart totals */
body.woocommerce-cart .cart-collaterals,
body.woocommerce-cart .cart_totals,
body.woocommerce-cart .cross-sells {
    display: none !important;
}

/* Hide default sidebar on cart page */
body.woocommerce-cart #secondary,
body.woocommerce-cart .widget-area {
    display: none !important;
}

/* Full width cart page */
body.woocommerce-cart .site-main,
body.woocommerce-cart .content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}

body.woocommerce-cart .site-content .content-area {
    width: 100% !important;
}

/* Remove default WooCommerce cart table styles */
body.woocommerce-cart .woocommerce-cart-form table.shop_table {
    display: none !important;
}

/* Style WooCommerce notices */
body.woocommerce-cart .woocommerce-error,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-message {
    max-width: 1400px;
    margin: 20px auto;
    padding: 15px 40px;
    border-radius: 0;
}

body.woocommerce-cart .woocommerce-message {
    background-color: #f0f9f0;
    border-left: 4px solid #4caf50;
}

body.woocommerce-cart .woocommerce-error {
    background-color: #fef0f0;
    border-left: 4px solid #f44336;
}

body.woocommerce-cart .woocommerce-info {
    background-color: #f0f4f9;
    border-left: 4px solid #2196f3;
}

/* Empty Cart Styles */
.woocommerce-cart .cart-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
}

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

.woocommerce-cart .return-to-shop .button {
    display: inline-block;
    padding: 15px 40px;
    background-color: #c45a3b;
    color: #fff;
    text-decoration: none;
    font-family: "Delight", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.woocommerce-cart .return-to-shop .button:hover {
    background-color: #a04830;
    color: #fff;
}

/* Cart Footer Message */
.ac-cart-footer-message {
    text-align: center;
    margin-top: 80px;
    margin-bottom: 40px;
}

.ac-cart-footer-message h2 {
    font-family: "Delight", sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
    margin: 0;
}

/* Mobile Footer Message - Between Items and Sidebar */
.ac-cart-footer-message-mobile {
    display: none;
    margin-top: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    /* Show mobile footer message between items and sidebar */
    .ac-cart-footer-message-mobile {
        display: block;
    }
    
    .ac-cart-footer-message-mobile h2 {
        font-size: 28px;
    }
    
    /* Hide original footer message on mobile */
    .ac-cart-footer-message:not(.ac-cart-footer-message-mobile) {
        display: none;
    }
}
