/* #last edited 2026-07-24T16:47:02.0692880+01:00 */
/**
 * TLD Cart Flyout Content Styles
 *
 * Styles for cart items and totals displayed in the cart flyout.
 * Le Labo aesthetic: clean borders, minimal design, square corners.
 *
 * Works with WooCommerce fragment system for AJAX updates.
 */

/* ============================================================================
   CART ITEMS
   ============================================================================ */

.tld-cart-items {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 12px;
    padding: 0;
    margin: 0;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.tld-cart-item {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--tld-gray-200, #eeeeee);
    border-radius: 0;
    background: var(--tld-white, #ffffff);
    transition: border-color 0.2s ease;
    min-width: 0;
}

.tld-cart-item:hover {
    border-color: var(--tld-gray-300, #d4d4d4);
}

/* Product Image */
.tld-cart-item__image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.tld-cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.tld-cart-item__image a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Product Details */
.tld-cart-item__details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tld-cart-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--tld-black, #1a1a1a);
    line-height: 1.4;
    margin: 0;
    overflow-wrap: anywhere;
}

.tld-cart-item__name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tld-cart-item__name a:hover {
    color: var(--tld-primary, #1a4a5e);
}

.tld-cart-item__meta {
    font-size: 11px;
    color: var(--tld-gray-500, #737373);
    line-height: 1.4;
}

.tld-cart-item__meta dl {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.tld-cart-item__meta dt,
.tld-cart-item__meta dd {
    display: inline;
    margin: 0;
}

.tld-cart-item__meta dt {
    font-weight: 500;
}

.tld-cart-item__meta dt::after {
    content: ':';
}

.tld-cart-item__quantity {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--tld-gray-600, #525252);
}

.tld-cart-item__quantity-label {
    font-weight: 500;
}

.tld-cart-item__quantity-value {
    font-weight: 600;
    color: var(--tld-black, #1a1a1a);
}

.tld-cart-item__qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--tld-gray-300, #d4d4d4);
    background: var(--tld-white, #ffffff);
    color: var(--tld-black, #1a1a1a);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.tld-cart-item__qty-input {
    width: 42px;
    height: 26px;
    padding: 0 4px;
    border: 1px solid var(--tld-gray-300, #d4d4d4);
    background: var(--tld-white, #ffffff);
    color: var(--tld-black, #1a1a1a);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* Actions Column */
.tld-cart-item__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    justify-content: space-between;
}

.tld-cart-item__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--tld-black, #1a1a1a);
    white-space: nowrap;
    text-align: right;
}

.tld-cart-item__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--tld-gray-300, #d4d4d4);
    border-radius: 0;
    color: var(--tld-gray-600, #525252);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tld-cart-item__remove:hover {
    background: var(--tld-black, #1a1a1a);
    border-color: var(--tld-black, #1a1a1a);
    color: var(--tld-white, #ffffff);
}

.tld-cart-item__remove svg {
    width: 14px;
    height: 14px;
}

/* Empty Cart State */
.tld-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.tld-cart-empty__icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--tld-gray-400, #a3a3a3);
}

.tld-cart-empty__text {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--tld-gray-600, #525252);
}

.tld-cart-empty__link {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--tld-black, #1a1a1a);
    border: 1px solid var(--tld-black, #1a1a1a);
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tld-white, #ffffff);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.tld-cart-empty__link:hover {
    background: var(--tld-white, #ffffff);
    color: var(--tld-black, #1a1a1a);
}

/* ============================================================================
   CART TOTALS
   ============================================================================ */

.tld-cart-totals {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--tld-black, #1a1a1a);
    flex: 0 0 auto;
    background: var(--tld-cream, #f5f0e8);
}

.tld-cart-totals__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--tld-gray-200, #eeeeee);
}

.tld-cart-totals__row:last-of-type {
    margin-bottom: 0;
}

.tld-cart-totals__label {
    font-weight: 500;
    color: var(--tld-gray-700, #404040);
}

.tld-cart-totals__value {
    font-weight: 600;
    color: var(--tld-black, #1a1a1a);
}

/* Total Row */
.tld-cart-totals__row--total {
    margin-top: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--tld-black, #1a1a1a);
    border-bottom: none;
    font-size: 16px;
}

.tld-cart-totals__row--total .tld-cart-totals__label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tld-black, #1a1a1a);
}

.tld-cart-totals__row--total .tld-cart-totals__value {
    font-size: 18px;
    font-weight: 700;
}

/* Shipping Progress */
.tld-cart-totals__shipping-progress {
    margin: 16px 0;
    padding: 12px;
    background: var(--tld-cream, #f5f0e8);
    border: 1px solid var(--tld-gray-200, #eeeeee);
    border-radius: 0;
}

.tld-cart-totals__shipping-text {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--tld-gray-700, #404040);
}

.tld-cart-totals__shipping-bar {
    width: 100%;
    height: 6px;
    background: var(--tld-gray-200, #eeeeee);
    border-radius: 0;
    overflow: hidden;
}

.tld-cart-totals__shipping-fill {
    height: 100%;
    background: var(--tld-primary, #1a4a5e);
    transition: width 0.3s ease;
}

.tld-cart-totals__shipping-progress--complete {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.tld-cart-totals__shipping-progress--complete svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.tld-cart-coupon {
    display: grid;
    gap: 8px;
    margin: 14px 0 4px;
    padding: 12px 0 0;
    border-top: 1px solid var(--tld-gray-200, #eeeeee);
}

.tld-cart-coupon__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tld-gray-700, #404040);
}

.tld-cart-coupon__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.tld-cart-coupon__input {
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--tld-gray-300, #d4d4d4);
    background: var(--tld-white, #ffffff);
    color: var(--tld-black, #1a1a1a);
    font-size: 13px;
}

.tld-cart-coupon__button {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--tld-black, #1a1a1a);
    background: var(--tld-black, #1a1a1a);
    color: var(--tld-white, #ffffff);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tld-cart-coupon__message {
    min-height: 14px;
    font-size: 11px;
    color: var(--tld-gray-600, #525252);
}

/* Actions */
.tld-cart-totals__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    min-width: 0;
}

.tld-cart-totals__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: var(--tld-black, #1a1a1a);
    border: 1px solid var(--tld-black, #1a1a1a);
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tld-white, #ffffff);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.tld-cart-totals__checkout:hover {
    background: var(--tld-white, #ffffff);
    color: var(--tld-black, #1a1a1a);
}

.tld-cart-totals__view-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--tld-black, #1a1a1a);
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tld-black, #1a1a1a);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.tld-cart-totals__view-cart:hover {
    background: var(--tld-black, #1a1a1a);
    color: var(--tld-white, #ffffff);
}

.tld-cart-flyout .wp-block-button,
.tld-cart-flyout .gspb-buttonbox {
    width: 100%;
    margin: 0 !important;
}

.tld-cart-flyout .wp-block-button__link,
.tld-cart-flyout .gspb-buttonbox .wp-element-button,
.tld-cart-flyout .gspb-buttonbox a,
.tld-cart-flyout .gspb-buttonbox button {
    min-height: 42px !important;
    width: 100% !important;
    padding: 10px 14px !important;
    border-radius: 0 !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    letter-spacing: 0.04em !important;
}

/* Trust Badges */
.tld-cart-totals__trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tld-gray-200, #eeeeee);
}

.tld-cart-totals__trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--tld-gray-600, #525252);
}

.tld-cart-totals__trust-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--tld-gray-500, #737373);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

/* Mobile */
@media (max-width: 640px) {
    .tld-cart-item {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 9px 10px;
        padding: 10px;
    }

    .tld-cart-item__image {
        width: 48px;
        height: 48px;
    }

    .tld-cart-item__name {
        font-size: 12px;
    }

    .tld-cart-item__meta {
        font-size: 10px;
    }

    .tld-cart-item__quantity {
        font-size: 11px;
    }

    .tld-cart-item__price {
        font-size: 13px;
        white-space: normal;
    }

    .tld-cart-item__actions {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-top: 2px;
    }

    .tld-cart-item__remove {
        width: 26px;
        height: 26px;
    }

    .tld-cart-item__qty-btn,
    .tld-cart-item__qty-input {
        height: 28px;
    }

    .tld-cart-totals {
        margin-top: 18px;
        padding-top: 18px;
    }

    .tld-cart-totals__checkout,
    .tld-cart-totals__view-cart,
    .tld-cart-empty__link {
        min-height: 44px;
        padding-right: 12px;
        padding-left: 12px;
        letter-spacing: 0.06em;
        overflow-wrap: anywhere;
    }

    .tld-cart-totals__row {
        font-size: 12px;
        gap: 12px;
    }

    .tld-cart-totals__label,
    .tld-cart-totals__value {
        min-width: 0;
    }

    .tld-cart-totals__value {
        text-align: right;
    }

    .tld-cart-totals__row--total {
        font-size: 15px;
    }

    .tld-cart-totals__row--total .tld-cart-totals__value {
        font-size: 16px;
    }

    .tld-cart-totals__trust {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tld-cart-empty {
        padding: 32px 16px;
    }

    .tld-cart-empty__icon {
        width: 48px;
        height: 48px;
    }
}
