/* ==========================================================
   YalaNext Cart Page — Custom Template Styles
   ========================================================== */

/* ------- Layout ------- */
.yxl-cart {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.yxl-cart-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}
.yxl-cart-items {
    flex: 1;
    min-width: 0;
}
.yxl-cart-summary {
    flex: 0 0 340px;
    position: sticky;
    top: 100px;
}

/* ------- Cart Item ------- */
.yxl-cart-item {
    display: flex;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.yxl-cart-item:first-child {
    padding-top: 0;
}

/* Image */
.yxl-cart-item-img {
    flex-shrink: 0;
    width: 100px;
}
.yxl-cart-item-img a {
    display: block;
}
.yxl-cart-item-img img {
    width: 100px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Details */
.yxl-cart-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.yxl-cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.yxl-cart-item-info {
    flex: 1;
}
.yxl-cart-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    line-height: 1.4;
}
.yxl-cart-item-name:hover {
    opacity: 0.6;
}

/* Price */
.yxl-cart-item-price {
    font-size: 14px;
    color: #000;
    margin-bottom: 4px;
}
.yxl-cart-item-price del {
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}
.yxl-cart-item-price ins {
    text-decoration: none;
    font-weight: 600;
    color: #000;
}
.yxl-cart-item-price .amount {
    color: #000;
}

/* Savings badge */
.yxl-cart-savings {
    display: inline-block;
    font-size: 12px;
    color: #16a34a;
    font-weight: 500;
    margin-top: 2px;
}

/* Variation data (size, color etc) — compact inline display */
.yxl-cart-item-info dl.variation {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 6px 0 0;
}
.yxl-cart-item-info dl.variation dt {
    font-size: 12px;
    color: #888;
    font-weight: 400;
    margin: 0 3px 0 0;
    text-transform: capitalize;
}
.yxl-cart-item-info dl.variation dd {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    margin: 0 12px 0 0;
}
.yxl-cart-item-info dl.variation dd p {
    margin: 0;
    display: inline;
}

/* Remove button */
.yxl-cart-item-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    color: #999;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 18px;
    line-height: 1;
}
.yxl-cart-item-remove:hover {
    background: #000;
    color: #fff;
}

/* Bottom row: quantity + subtotal */
.yxl-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

/* Quantity controls — custom HTML, no theme icon font */
.yxl-qty {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}
.yxl-qty-input {
    width: 44px !important;
    max-width: 44px !important;
    text-align: center !important;
    border: none !important;
    border-left: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #000 !important;
    background: transparent !important;
    -moz-appearance: textfield !important;
    padding: 0 !important;
    height: 36px !important;
    outline: none !important;
    margin: 0 !important;
}
.yxl-qty-input::-webkit-outer-spin-button,
.yxl-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
.yxl-qty-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #000 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    font-size: 18px !important;
    font-family: Arial, sans-serif !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}
.yxl-qty-btn:hover {
    background: #f5f5f4 !important;
}

/* Subtotal */
.yxl-cart-item-subtotal {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}
.yxl-cart-item-subtotal del {
    color: #999;
    font-weight: 400;
    font-size: 13px;
    margin-right: 6px;
}
.yxl-cart-item-subtotal ins {
    text-decoration: none;
    color: #000;
}
.yxl-cart-item-subtotal .amount {
    color: #000;
}

/* Continue shopping link */
.yxl-cart-continue {
    display: inline-block;
    margin-top: 24px;
    font-size: 13px;
    color: #000;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}
.yxl-cart-continue:hover {
    opacity: 0.6;
    color: #000;
}

/* ------- Order Summary ------- */
.yxl-cart-summary-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 28px;
    background: #fff;
}
.yxl-cart-summary-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #000;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.yxl-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #000;
}
.yxl-cart-summary-row span:first-child {
    color: #888;
    font-size: 13px;
}
.yxl-muted {
    color: #888;
    font-size: 13px;
}

/* Total */
.yxl-cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 14px;
    font-weight: 500;
}
.yxl-cart-summary-total span:first-child {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
    color: #888;
}
.yxl-cart-total-amount,
.yxl-cart-total-amount .amount,
.yxl-cart-total-amount bdi,
.yxl-cart-total-amount .woocommerce-Price-amount,
.yxl-cart-total-amount .woocommerce-Price-currencySymbol {
    font-size: 20px;
    font-weight: 700;
    color: #000 !important;
}

/* Checkout button */
.yxl-cart-checkout-btn {
    display: block;
    width: 100%;
    background: #000;
    color: #fff;
    border-radius: 25px;
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-align: center;
    text-decoration: none;
    margin-top: 24px;
    transition: background 0.25s;
    box-sizing: border-box;
}
.yxl-cart-checkout-btn:hover {
    background: #222;
    color: #fff;
}

/* Payment buttons from WooCommerce hooks — style them to match */
.yxl-cart-checkout-actions > * {
    margin-top: 10px;
    border-radius: 25px !important;
    overflow: hidden;
}
/* Hide the default WooCommerce checkout button rendered by the hook (we have our own) */
.yxl-cart-checkout-actions > .wc-proceed-to-checkout > a.checkout-button,
.yxl-cart-checkout-actions > .checkout-button,
.yxl-cart-checkout-actions > a.wc-forward {
    display: none !important;
}
/* Style any remaining payment buttons (Apple Pay, Google Pay) */
.yxl-cart-checkout-actions > .wc-proceed-to-checkout {
    border-radius: 25px !important;
    overflow: hidden;
}
.yxl-cart-checkout-actions > .wc-proceed-to-checkout > * {
    border-radius: 25px !important;
    overflow: hidden;
}

/* ------- Empty Cart ------- */
.yxl-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 100px 24px;
    text-align: center;
    min-height: 50vh;
}
.yxl-cart-empty-icon {
    opacity: 0.15;
    color: #000;
}
.yxl-cart-empty h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    margin: 0;
}
.yxl-cart-empty p {
    font-size: 15px;
    color: #888;
    margin: 0;
    max-width: 360px;
    line-height: 1.6;
}
.yxl-cart-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    border-radius: 25px;
    padding: 16px 40px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: background 0.25s;
    min-height: 48px;
}
.yxl-cart-empty-btn:hover {
    background: #222;
    color: #fff;
}

/* ------- Responsive ------- */
@media (max-width: 768px) {
    .yxl-cart {
        padding: 24px 16px 80px;
    }
    .yxl-cart-layout {
        flex-direction: column;
        gap: 32px;
    }
    .yxl-cart-summary {
        flex: none;
        width: 100%;
        position: static;
    }
    .yxl-cart-item {
        gap: 14px;
    }
    .yxl-cart-item-img {
        width: 80px;
    }
    .yxl-cart-item-img img {
        width: 80px;
        height: 100px;
    }
    .yxl-cart-item-name {
        font-size: 14px;
    }
    .yxl-cart-item-bottom {
        margin-top: 12px;
    }
    .yxl-cart-summary-card {
        padding: 20px;
    }
    .yxl-cart-empty {
        padding: 60px 16px;
        min-height: 40vh;
    }
}

/* ------- Hide parent theme cart wrapper ------- */
.woocommerce-cart .cart-wrapper {
    display: none !important;
}
.woocommerce-cart .cart-collaterals {
    display: none !important;
}

/* ------- Prices: always black ------- */
.yxl-cart .amount,
.yxl-cart ins .amount,
.yxl-cart bdi {
    color: #000;
}
.yxl-cart del,
.yxl-cart del .amount,
.yxl-cart del bdi {
    color: #999;
}
.yxl-cart ins {
    text-decoration: none;
}

/* ------- Hide WooCommerce notices ------- */
.woocommerce-cart .woocommerce-message {
    display: none !important;
}
