/*--------------------------------------------------------------
# Cart Page — UI/UX Polish
# Restyle the WooCommerce Cart Block to match the gtango dark
# theme design system (pill quantity selector, dark totals,
# proper spacing, and currency toggle placement).
#
# @package TicketSystemTango
--------------------------------------------------------------*/


/* ==========================================================================
   §1  QUANTITY SELECTOR — PILL RESTYLE
   Match the single-product page's rounded pill design.
   ========================================================================== */

/* Container: rounded pill with subtle gold border */
.wc-block-cart .wc-block-components-quantity-selector {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(201, 169, 110, 0.25) !important;
    border-radius: 100px !important;
    padding: 2px !important;
    overflow: hidden !important;
    min-height: 40px;
    min-width: 120px !important;
    width: auto !important;
    box-sizing: border-box !important;
}

.wc-block-cart .wc-block-components-quantity-selector:focus-within {
    border-color: rgba(201, 169, 110, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.12);
}

/* +/- Buttons: circular touch targets with gold hover */
.wc-block-cart .wc-block-components-quantity-selector__button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: transparent !important;
    color: var(--ts-gold, #c9a96e) !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    padding: 0 !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

.wc-block-cart .wc-block-components-quantity-selector__button:hover:not(:disabled) {
    background-color: rgba(201, 169, 110, 0.15) !important;
    color: #ffffff !important;
}

.wc-block-cart .wc-block-components-quantity-selector__button:focus-visible:not(:disabled) {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.4) !important;
}

.wc-block-cart .wc-block-components-quantity-selector__button:disabled {
    opacity: 0.38 !important;
    cursor: not-allowed !important;
    background-color: transparent !important;
}

/* Input: transparent background, centered white text */
.wc-block-cart .wc-block-components-quantity-selector__input {
    width: 40px !important;
    min-width: 32px !important;
    height: 36px !important;
    padding: 0 2px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-align: center !important;
    flex: 0 1 auto !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.wc-block-cart .wc-block-components-quantity-selector__input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Hide native number spinners */
.wc-block-cart .wc-block-components-quantity-selector__input::-webkit-outer-spin-button,
.wc-block-cart .wc-block-components-quantity-selector__input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}


/* ==========================================================================
   §2  REMOVE / TRASH BUTTON — SAFE SPACING
   Separate the delete action from the + button to prevent misclicks.
   ========================================================================== */

.wc-block-cart .wc-block-cart-item__remove-link,
.wc-block-cart button.wc-block-cart-item__remove-link,
.wc-block-cart a.wc-block-cart-item__remove-link {
    margin-left: 14px !important;
    color: rgba(255, 255, 255, 0.35) !important;
    font-size: 0.78rem !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    transition: color 0.2s ease, background-color 0.2s ease !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Reset inherited gold button styles */
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    padding: 4px 8px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 400 !important;
}

.wc-block-cart .wc-block-cart-item__remove-link:hover,
.wc-block-cart button.wc-block-cart-item__remove-link:hover,
.wc-block-cart a.wc-block-cart-item__remove-link:hover {
    color: #D32F2F !important;
    background-color: rgba(211, 47, 47, 0.08) !important;
    text-decoration: underline !important;
    transform: none !important;
    box-shadow: none !important;
}


/* ==========================================================================
   §3  CART ITEM ROW — DARK THEME CONSISTENCY
   Ensure product info, prices, and images look correct.
   ========================================================================== */

/* Product name link */
.wc-block-cart .wc-block-components-product-name {
    color: var(--ts-gold, #c9a96e) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
}

.wc-block-cart .wc-block-components-product-name:hover {
    color: #ffffff !important;
}

/* Product thumbnail */
.wc-block-cart .wc-block-cart-item__image img {
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Cart item row subtle separator */
.wc-block-cart .wc-block-cart-items__row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-bottom: 20px !important;
    margin-bottom: 20px !important;
}

.wc-block-cart .wc-block-cart-items__row:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}


/* ==========================================================================
   §4  CART TOTALS SIDEBAR — DARK POLISH
   ========================================================================== */

/* Totals title */
.wc-block-cart .wc-block-cart__totals-title {
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    font-family: var(--font-body) !important;
}

/* Total value gold accent */
.wc-block-cart .wc-block-components-totals-item__value {
    color: var(--ts-gold, #c9a96e) !important;
    font-weight: 700 !important;
}

/* Total footer — larger font for final total */
.wc-block-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 1.25rem !important;
}

.wc-block-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

/* Sidebar card styling */
.wc-block-cart .wc-block-cart__sidebar {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    padding: 24px !important;
}

/* Divider lines within totals */
.wc-block-cart .wc-block-components-totals-wrapper {
    border-color: rgba(255, 255, 255, 0.08) !important;
}


/* ==========================================================================
   §5  COUPON / DISCOUNT SECTION — IMPROVED CONTRAST
   ========================================================================== */

/* Panel toggle button (chevron + text) */
.wc-block-cart .wc-block-components-totals-coupon .wc-block-components-panel__button {
    color: var(--ts-gold, #c9a96e) !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
}

.wc-block-cart .wc-block-components-totals-coupon .wc-block-components-panel__button:hover {
    color: #ffffff !important;
}

/* Panel chevron icon */
.wc-block-cart .wc-block-components-totals-coupon .wc-block-components-panel__button svg {
    fill: var(--ts-gold, #c9a96e) !important;
    color: var(--ts-gold, #c9a96e) !important;
    transition: fill 0.2s ease, transform 0.25s ease !important;
}

/* Coupon input when expanded */
.wc-block-cart .wc-block-components-totals-coupon input {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    font-family: var(--font-body) !important;
}

.wc-block-cart .wc-block-components-totals-coupon input:focus {
    border-color: var(--ts-gold, #c9a96e) !important;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2) !important;
    outline: none !important;
}

/* Coupon apply button */
.wc-block-cart .wc-block-components-totals-coupon__button {
    background-color: var(--ts-gold, #c9a96e) !important;
    color: #111111 !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 12px 20px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    font-size: 0.85rem !important;
    transition: background-color 0.2s ease !important;
}

.wc-block-cart .wc-block-components-totals-coupon__button:hover {
    background-color: #d4b87a !important;
}


/* ==========================================================================
   §6  CURRENCY TOGGLE PLACEMENT — CART CONTEXT
   Positioned above the totals in the sidebar, or below items on mobile.
   ========================================================================== */

.ts-cart-currency-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    margin-bottom: 8px;
}


/* ==========================================================================
   §7  LAYOUT — REDUCE DEAD SPACE & RESPONSIVENESS
   ========================================================================== */

/* Tighten up the main cart area so it doesn't float in empty space */
.wc-block-cart .wc-block-cart__main {
    min-height: auto !important;
}

/* Ensure items + sidebar align at top on desktop */
.wc-block-cart .wc-block-components-sidebar-layout {
    align-items: flex-start !important;
}

/* Mobile layout adjustments */
@media (max-width: 768px) {

    /* Stack sidebar below items */
    .wc-block-cart .wc-block-components-sidebar-layout {
        flex-direction: column !important;
    }

    .wc-block-cart .wc-block-cart__sidebar,
    .wc-block-cart .wc-block-cart__main {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Full-width quantity selector on mobile */
    .wc-block-cart .wc-block-components-quantity-selector {
        min-height: 44px;
        min-width: 130px !important;
    }

    .wc-block-cart .wc-block-components-quantity-selector__button {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    /* More spacing on mobile for trash icon */
    .wc-block-cart .wc-block-cart-item__remove-link {
        margin-left: 16px !important;
    }
}

/* Ensure page doesn't stretch with too much bottom padding */
.woocommerce-cart .entry-content {
    padding-bottom: 0 !important;
}


/* ==========================================================================
   §8  PAGE TITLE
   Cart title matches the checkout title styling.
   ========================================================================== */

.woocommerce-cart .entry-title,
.woocommerce-cart .page-title,
.woocommerce-cart .wp-block-post-title {
    font-family: var(--font-headings) !important;
    color: #ffffff !important;
    text-align: center !important;
    font-size: 1.6rem !important;
    margin-bottom: 32px !important;
}
