/**
 * Cart Page — OPTEAM Construct
 * Airy 2-column layout: cart items (left) + totals card (right)
 */

/* ============================================
   ASTRA / WC AGGRESSIVE RESETS
   ============================================ */
.ot-cart-page .entry-title,
.ot-cart-page .page-title,
.ot-cart-page .ast-archive-description,
.ot-cart-page .woocommerce-result-count,
.ot-cart-page .woocommerce-ordering,
.ot-cart-page .ast-woocommerce-container > .entry-title {
    display: none !important;
}

.ot-cart-page,
.ot-cart-page .ast-container,
.ot-cart-page .ast-woocommerce-container,
.ot-cart-page #primary,
.ot-cart-page #content,
.ot-cart-page .site-main,
.ot-cart-page .content-area {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    background: var(--bg-primary) !important;
}

.ot-cart-page .woocommerce .col2-set,
.ot-cart-page .woocommerce-page .col2-set,
.ot-cart-page .woocommerce .col2-set .col-1,
.ot-cart-page .woocommerce .col2-set .col-2 {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ============================================
   PAGE WRAPPER
   ============================================ */
.ot-cart-page {
    padding-top: clamp(130px, 15vw, 180px) !important;
    padding-bottom: clamp(80px, 10vw, 120px) !important;
    margin-bottom: 0 !important;
}

.ot-cart-page > .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px !important;
}

/* ============================================
   REVEAL
   ============================================ */
.ot-cart-page .reveal {
    transform: translateY(24px) !important;
    transition: opacity 0.6s ease, transform 0.6s ease !important;
}
.ot-cart-page .reveal.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ============================================
   HERO — generous spacing
   ============================================ */
.ot-cart-hero {
    text-align: center;
    margin-bottom: 56px;
}

.ot-cart-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--text-primary);
    margin: 16px 0 14px;
}

.ot-cart-hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

.ot-cart-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    color: var(--accent-gold);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.ot-cart-back-link:hover {
    gap: 10px;
    color: var(--accent-gold);
}

/* ============================================
   2-COLUMN GRID
   ============================================ */
.ot-cart-content .woocommerce {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* Notices span full width */
.ot-cart-content .woocommerce > .woocommerce-notices-wrapper {
    grid-column: 1 / -1;
    margin-bottom: 8px;
}

/* Cart form = left column */
.ot-cart-content .woocommerce .woocommerce-cart-form {
    grid-column: 1;
}

/* Cart collaterals = right column, sticky */
.ot-cart-content .woocommerce .cart-collaterals {
    grid-column: 2;
    position: sticky;
    top: calc(var(--header-height, 80px) + 24px);
    margin-top: 0 !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ============================================
   WC NOTICES
   ============================================ */
.ot-cart-page .woocommerce-message,
.ot-cart-page .woocommerce-info,
.ot-cart-page .woocommerce-error {
    background: var(--glass-bg) !important;
    border: 1px solid rgba(242, 183, 5, 0.2) !important;
    border-radius: 16px !important;
    color: var(--text-primary) !important;
    padding: 16px 24px !important;
    margin-bottom: 20px !important;
    list-style: none !important;
    font-size: 0.92rem;
}

.ot-cart-page .woocommerce-message::before,
.ot-cart-page .woocommerce-info::before {
    color: var(--accent-gold) !important;
}

.ot-cart-page .woocommerce-error {
    border-color: rgba(239, 68, 68, 0.25) !important;
}

.ot-cart-page .woocommerce-message a.button,
.ot-cart-page .woocommerce-info a.button {
    background: var(--accent-gold) !important;
    color: var(--bg-primary) !important;
    border-radius: 999px !important;
    padding: 8px 18px !important;
    font-weight: 700 !important;
    border: none !important;
    text-decoration: none !important;
}

/* ============================================
   CART TABLE — spacious
   ============================================ */
.ot-cart-page .woocommerce table.shop_table {
    background: var(--glass-bg) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 24px !important;
    overflow: hidden;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

/* Table header — full-width band, matching totals card header */
.ot-cart-page .woocommerce table.shop_table thead th {
    background: rgba(242, 183, 5, 0.05) !important;
    color: var(--accent-gold) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 16px 28px !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Hide remove column header — cleaner look */
.ot-cart-page .woocommerce table.shop_table thead th.product-remove {
    font-size: 0 !important;
    padding: 16px 8px !important;
}

/* Table cells — generous padding, matching header */
.ot-cart-page .woocommerce table.shop_table td {
    background: transparent !important;
    color: var(--text-primary) !important;
    padding: 24px 28px !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
    vertical-align: middle !important;
}

.ot-cart-page .woocommerce table.shop_table tbody tr:first-child td {
    border-top: none !important;
}

/* Subtle row hover */
.ot-cart-page .woocommerce table.shop_table tbody tr:hover td {
    background: rgba(242, 183, 5, 0.02) !important;
}

/* Product thumbnail */
.ot-cart-page .woocommerce table.shop_table .product-thumbnail {
    width: 88px !important;
}

.ot-cart-page .woocommerce table.shop_table .product-thumbnail img {
    width: 64px !important;
    height: 64px !important;
    object-fit: cover;
    border-radius: 14px !important;
    border: 1px solid var(--border-glass);
}

/* Product name */
.ot-cart-page .woocommerce table.shop_table .product-name a {
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.ot-cart-page .woocommerce table.shop_table .product-name a:hover {
    color: var(--accent-gold) !important;
}

/* Estimate fields under product name */
.ot-cart-page .woocommerce table.shop_table .product-name dl {
    margin: 8px 0 0 !important;
    padding: 0 !important;
}

.ot-cart-page .woocommerce table.shop_table .product-name dt {
    float: none !important;
    display: inline !important;
    font-weight: 600;
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    margin: 0 !important;
    padding: 0 !important;
}

.ot-cart-page .woocommerce table.shop_table .product-name dd {
    display: inline !important;
    margin: 0 0 0 4px !important;
    padding: 0 !important;
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
}

.ot-cart-page .woocommerce table.shop_table .product-name dd p {
    display: inline !important;
    margin: 0 !important;
}

/* Price columns */
.ot-cart-page .woocommerce table.shop_table .product-price .woocommerce-Price-amount,
.ot-cart-page .woocommerce table.shop_table .product-subtotal .woocommerce-Price-amount {
    color: var(--accent-gold) !important;
    font-weight: 800;
    font-size: 0.95rem;
}

.ot-cart-page .woocommerce table.shop_table .product-price .woocommerce-Price-currencySymbol,
.ot-cart-page .woocommerce table.shop_table .product-subtotal .woocommerce-Price-currencySymbol {
    color: var(--accent-gold) !important;
}

/* Quantity input */
.ot-cart-page .woocommerce table.shop_table .quantity .qty {
    background: rgba(10, 14, 23, 0.8) !important;
    border: 1px solid rgba(242, 183, 5, 0.12) !important;
    border-radius: 10px !important;
    color: var(--text-primary) !important;
    padding: 10px 12px !important;
    width: 60px !important;
    text-align: center;
    font-family: inherit;
    font-size: 0.95rem;
    -moz-appearance: textfield;
}

.ot-cart-page .woocommerce table.shop_table .quantity .qty:focus {
    border-color: rgba(242, 183, 5, 0.4) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.08);
}

.ot-cart-page .woocommerce table.shop_table .quantity .qty::-webkit-inner-spin-button,
.ot-cart-page .woocommerce table.shop_table .quantity .qty::-webkit-outer-spin-button {
    opacity: 1;
}

/* Remove button */
.ot-cart-page .woocommerce table.shop_table .product-remove {
    width: 48px !important;
    text-align: center !important;
}

.ot-cart-page .woocommerce table.shop_table .product-remove a.remove {
    color: rgba(239, 68, 68, 0.6) !important;
    font-size: 1.2rem !important;
    background: rgba(239, 68, 68, 0.06) !important;
    border-radius: 10px !important;
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none !important;
}

.ot-cart-page .woocommerce table.shop_table .product-remove a.remove:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--error-color) !important;
}

/* ============================================
   ACTIONS ROW (Coupon + Update)
   ============================================ */
.ot-cart-page .woocommerce table.shop_table td.actions {
    padding: 24px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.ot-cart-page .woocommerce .coupon {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ot-cart-page .woocommerce .coupon label {
    display: none !important;
}

.ot-cart-page .woocommerce .coupon .input-text {
    background: rgba(10, 14, 23, 0.8) !important;
    border: 1px solid rgba(242, 183, 5, 0.12) !important;
    border-radius: 999px !important;
    color: var(--text-primary) !important;
    padding: 12px 20px !important;
    font-size: 0.88rem;
    min-width: 160px;
    font-family: inherit;
}

.ot-cart-page .woocommerce .coupon .input-text:focus {
    border-color: rgba(242, 183, 5, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.08);
    outline: none;
}

.ot-cart-page .woocommerce .coupon .input-text::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.ot-cart-page .woocommerce .coupon .button,
.ot-cart-page .woocommerce td.actions > .button {
    background: rgba(242, 183, 5, 0.08) !important;
    color: var(--accent-gold) !important;
    border: 1px solid rgba(242, 183, 5, 0.2) !important;
    border-radius: 999px !important;
    padding: 12px 24px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    text-decoration: none !important;
    line-height: 1.4 !important;
}

.ot-cart-page .woocommerce .coupon .button:hover,
.ot-cart-page .woocommerce td.actions > .button:hover {
    background: rgba(242, 183, 5, 0.16) !important;
    border-color: rgba(242, 183, 5, 0.4) !important;
}

.ot-cart-page .woocommerce td.actions > .button[name="update_cart"] {
    float: right;
}

.ot-cart-page .woocommerce td.actions > .button[name="update_cart"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ============================================
   CART TOTALS — right column card
   ============================================ */
.ot-cart-page .woocommerce .cart_totals {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass) !important;
    border-radius: 24px !important;
    padding: 0 !important;
    overflow: hidden;
}

/* Header — matching cart table header style */
.ot-cart-page .woocommerce .cart_totals h2 {
    color: var(--accent-gold) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(242, 183, 5, 0.05) !important;
    margin: 0 !important;
    padding: 16px 28px !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Inner content padding */
.ot-cart-page .woocommerce .cart_totals .shop_table_responsive,
.ot-cart-page .woocommerce .cart_totals > table,
.ot-cart-page .woocommerce .cart_totals .wc-proceed-to-checkout {
    padding-left: 28px !important;
    padding-right: 28px !important;
}

.ot-cart-page .woocommerce .cart_totals table {
    border: none !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

.ot-cart-page .woocommerce .cart_totals table th,
.ot-cart-page .woocommerce .cart_totals table td {
    background: transparent !important;
    color: var(--text-secondary) !important;
    padding: 16px 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
    font-size: 0.95rem;
}

.ot-cart-page .woocommerce .cart_totals table th {
    font-weight: 600 !important;
    text-align: left !important;
}

.ot-cart-page .woocommerce .cart_totals table td {
    text-align: right !important;
}

.ot-cart-page .woocommerce .cart_totals table tr:first-child th,
.ot-cart-page .woocommerce .cart_totals table tr:first-child td {
    border-top: none !important;
    padding-top: 20px !important;
}

/* Order total row — prominent */
.ot-cart-page .woocommerce .cart_totals .order-total th,
.ot-cart-page .woocommerce .cart_totals .order-total td {
    color: var(--text-primary) !important;
    font-weight: 800 !important;
    font-size: 1.05rem !important;
    border-top: 1px solid rgba(242, 183, 5, 0.15) !important;
    padding-top: 20px !important;
    padding-bottom: 4px !important;
}

.ot-cart-page .woocommerce .cart_totals .order-total .woocommerce-Price-amount {
    color: var(--accent-gold) !important;
    font-size: 1.4rem !important;
}

/* ============================================
   CHECKOUT BUTTON — full width, prominent
   ============================================ */
.ot-cart-page .woocommerce .wc-proceed-to-checkout {
    padding: 0 28px 28px !important;
    margin-top: 24px !important;
}

.ot-cart-page .woocommerce .wc-proceed-to-checkout a.checkout-button,
.ot-cart-page .woocommerce .wc-proceed-to-checkout a.checkout-button:link,
.ot-cart-page .woocommerce .wc-proceed-to-checkout a.checkout-button:visited {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber)) !important;
    color: var(--bg-primary) !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 18px 32px !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box !important;
}

.ot-cart-page .woocommerce .wc-proceed-to-checkout a.checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(242, 183, 5, 0.3);
}

/* Security note under checkout button */
.ot-cart-page .woocommerce .wc-proceed-to-checkout::after {
    content: '🔒 Plată securizată';
    display: block;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 12px;
    letter-spacing: 0.02em;
}

/* ============================================
   CROSS-SELLS (hide)
   ============================================ */
.ot-cart-page .woocommerce .cross-sells {
    display: none !important;
}

/* ============================================
   EMPTY CART — centered card
   ============================================ */
.ot-cart-empty {
    text-align: center;
    padding: 72px 32px;
    background: var(--glass-bg);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    max-width: 520px;
    margin: 0 auto;
}

.ot-cart-empty-icon {
    margin-bottom: 28px;
    opacity: 0.7;
}

.ot-cart-empty h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 14px;
}

.ot-cart-empty p {
    color: var(--text-secondary);
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.7;
    font-size: 0.98rem;
}

/* WooCommerce built-in empty cart (hide — we use custom) */
.ot-cart-page .woocommerce .cart-empty,
.ot-cart-page .woocommerce .return-to-shop {
    display: none !important;
}

/* ============================================
   POPUP
   ============================================ */
.ot-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.ot-popup-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(242, 183, 5, 0.2);
    border-radius: 24px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

.ot-popup-icon {
    color: var(--accent-gold);
    margin-bottom: 16px;
    opacity: 0.8;
}

.ot-popup-card h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.ot-popup-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.ot-popup-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.ot-popup-btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE — Tablet (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    .ot-cart-content .woocommerce {
        grid-template-columns: 1fr 320px;
        gap: 28px;
    }
}

/* ============================================
   RESPONSIVE — Stack (≤900px)
   ============================================ */
@media (max-width: 900px) {
    .ot-cart-content .woocommerce {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .ot-cart-content .woocommerce .woocommerce-cart-form,
    .ot-cart-content .woocommerce .cart-collaterals {
        grid-column: 1;
    }

    .ot-cart-content .woocommerce .cart-collaterals {
        position: static;
    }

    .ot-cart-page > .container {
        padding: 0 20px !important;
    }
}

/* ============================================
   RESPONSIVE — Mobile cards (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .ot-cart-hero {
        margin-bottom: 36px;
    }

    .ot-cart-hero h1 {
        font-size: 1.7rem;
    }

    /* Table → card layout */
    .ot-cart-page .woocommerce table.shop_table {
        display: block !important;
        border-radius: 20px !important;
    }

    .ot-cart-page .woocommerce table.shop_table thead {
        display: none !important;
    }

    .ot-cart-page .woocommerce table.shop_table tbody {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    /* Each row = a card */
    .ot-cart-page .woocommerce table.shop_table tbody tr {
        display: grid !important;
        grid-template-columns: 56px 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 14px;
        padding: 20px !important;
        border-bottom: none;
        background: rgba(15, 25, 40, 0.3);
        border-radius: 16px;
        position: relative;
    }

    .ot-cart-page .woocommerce table.shop_table td {
        padding: 0 !important;
        border: none !important;
    }

    /* Thumbnail */
    .ot-cart-page .woocommerce table.shop_table .product-thumbnail {
        grid-row: 1;
        grid-column: 1;
        width: 56px !important;
    }

    .ot-cart-page .woocommerce table.shop_table .product-thumbnail img {
        width: 50px !important;
        height: 50px !important;
        border-radius: 12px !important;
    }

    /* Product name */
    .ot-cart-page .woocommerce table.shop_table .product-name {
        grid-row: 1;
        grid-column: 2;
        align-self: center;
    }

    /* Remove button → top right */
    .ot-cart-page .woocommerce table.shop_table .product-remove {
        grid-row: 1;
        grid-column: 3;
        width: auto !important;
        align-self: start;
    }

    /* Price, Qty, Subtotal → second row, spread */
    .ot-cart-page .woocommerce table.shop_table .product-price,
    .ot-cart-page .woocommerce table.shop_table .product-quantity,
    .ot-cart-page .woocommerce table.shop_table .product-subtotal {
        grid-row: 2;
        width: auto !important;
        display: flex !important;
        align-items: center;
        gap: 4px;
    }

    .ot-cart-page .woocommerce table.shop_table .product-price {
        grid-column: 1 / 2;
    }

    .ot-cart-page .woocommerce table.shop_table .product-quantity {
        grid-column: 2;
        justify-self: center;
    }

    .ot-cart-page .woocommerce table.shop_table .product-subtotal {
        grid-column: 3;
        justify-self: end;
    }

    /* Mobile data labels */
    .ot-cart-page .woocommerce table.shop_table td::before {
        font-size: 0.7rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        display: block;
        margin-bottom: 2px;
    }

    .ot-cart-page .woocommerce table.shop_table .product-price::before {
        content: 'Preț';
    }

    .ot-cart-page .woocommerce table.shop_table .product-subtotal::before {
        content: 'Total';
    }

    /* Actions row */
    .ot-cart-page .woocommerce table.shop_table td.actions {
        display: flex !important;
        flex-direction: column;
        gap: 14px;
        padding: 20px !important;
        background: transparent;
        border-radius: 0;
    }

    .ot-cart-page .woocommerce td.actions > .button[name="update_cart"] {
        float: none;
        width: 100%;
        text-align: center;
    }

    .ot-cart-page .woocommerce .coupon {
        width: 100%;
    }

    .ot-cart-page .woocommerce .coupon .input-text {
        flex: 1;
        min-width: 0;
    }

    /* Totals card full width */
    .ot-cart-page .woocommerce .cart_totals {
        border-radius: 20px !important;
    }

    .ot-cart-page .woocommerce .cart_totals table,
    .ot-cart-page .woocommerce .cart_totals .shop_table_responsive,
    .ot-cart-page .woocommerce .cart_totals > table {
        padding: 0 20px !important;
    }

    .ot-cart-page .woocommerce .wc-proceed-to-checkout {
        padding: 0 20px 24px !important;
    }

    .ot-cart-page .woocommerce .cart_totals h2 {
        padding: 14px 20px !important;
    }
}

/* ============================================
   RESPONSIVE — Small phone (≤480px)
   ============================================ */
@media (max-width: 480px) {
    .ot-cart-page > .container {
        padding: 0 16px !important;
    }

    .ot-cart-hero h1 {
        font-size: 1.5rem;
    }

    .ot-cart-empty {
        padding: 48px 20px;
        border-radius: 20px;
    }

    .ot-cart-empty h2 {
        font-size: 1.3rem;
    }
}
