/**
 * Cart Page Styles - ArchFinishes
 * Matches the warm beige mockup design
 */

/* Variables */
:root {
    --af-cart-bg: #F5EDE4;
    --af-cart-surface: #FFFFFF;
    --af-cart-text: #121212;
    --af-cart-muted: #6B7280;
    --af-cart-border: #E5E7EB;
    --af-cart-primary: #C65A3A;
}

/* Page Layout */
.af-cart-page {
    background: var(--af-cart-bg);
    min-height: 100vh;
    padding: 48px 0 80px;
}

.af-cart-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Title */
.af-cart-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--af-cart-text);
    text-align: center;
    margin: 0 0 40px 0;
    font-family: 'Playfair Display', Georgia, serif;
}

/* Empty Cart */
.af-cart-empty {
    text-align: center;
    padding: 80px 40px;
    background: var(--af-cart-surface);
    border-radius: 16px;
}

.af-cart-empty .material-symbols-outlined {
    font-size: 64px;
    color: var(--af-cart-muted);
    margin-bottom: 16px;
}

.af-cart-empty h2 {
    font-size: 1.5rem;
    color: var(--af-cart-text);
    margin: 0 0 8px 0;
}

.af-cart-empty p {
    color: var(--af-cart-muted);
    margin: 0 0 24px 0;
}

/* Cart Layout */
.af-cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

/* Cart Main Column */
.af-cart-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cart Items */
.af-cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.af-cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    background: var(--af-cart-surface);
    border-radius: 12px;
    padding: 20px;
    align-items: start;
}

.af-cart-item-image {
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.af-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.af-cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.af-cart-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--af-cart-text);
    margin: 0;
    line-height: 1.4;
}

.af-cart-item-name a {
    color: inherit;
    text-decoration: none;
}

.af-cart-item-name a:hover {
    color: var(--af-cart-primary);
}

.af-cart-item-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--af-cart-text);
}

/* Quantity Controls */
.af-cart-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.af-qty-label {
    font-size: 0.875rem;
    color: var(--af-cart-muted);
}

.af-qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--af-cart-border);
    border-radius: 8px;
    overflow: hidden;
}

.af-qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--af-cart-text);
    transition: background 0.15s;
}

.af-qty-btn:hover {
    background: #f5f5f5;
}

.af-qty-btn .material-symbols-outlined {
    font-size: 18px;
}

.af-qty-input {
    width: 48px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--af-cart-border);
    border-right: 1px solid var(--af-cart-border);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--af-cart-text);
    -moz-appearance: textfield;
}

.af-qty-input::-webkit-outer-spin-button,
.af-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Cart Item Actions */
.af-cart-item-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Cart Item Total */
.af-cart-item-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 100px;
}

.af-item-total-label {
    font-size: 0.75rem;
    color: var(--af-cart-muted);
    margin-bottom: 4px;
}

.af-item-total-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--af-cart-text);
}

/* Form Actions */
.af-cart-form-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--af-cart-border);
}

.af-cart-remove,
.af-save-later {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--af-cart-border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--af-cart-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.af-cart-remove .material-symbols-outlined,
.af-save-later .material-symbols-outlined {
    font-size: 14px;
}

.af-cart-remove:hover {
    border-color: #EF4444;
    color: #EF4444;
    background: #FEF2F2;
}

.af-save-later:hover {
    border-color: var(--af-cart-primary);
    color: var(--af-cart-primary);
}

/* Update Cart Button */
.af-update-cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--af-cart-border);
    border-radius: 8px;
    color: var(--af-cart-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    width: fit-content;
}

.af-update-cart:hover {
    border-color: var(--af-cart-text);
    color: var(--af-cart-text);
}

.af-update-cart .material-symbols-outlined {
    font-size: 18px;
}

/* Summary Sidebar */
.af-cart-sidebar {
    position: sticky;
    top: 100px;
}

.af-cart-summary {
    background: var(--af-cart-surface);
    border-radius: 12px;
    padding: 24px;
}

.af-summary-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--af-cart-text);
    margin: 0 0 20px 0;
}

.af-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9375rem;
    color: var(--af-cart-muted);
    margin-bottom: 12px;
}

.af-summary-value {
    color: var(--af-cart-text);
    font-weight: 500;
}

.af-summary-value.af-discount {
    color: #10B981;
}

.af-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid var(--af-cart-border);
    margin-top: 8px;
}

.af-summary-total span:first-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--af-cart-text);
}

.af-total-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--af-cart-text);
}

.af-gst-note {
    font-size: 0.75rem;
    color: var(--af-cart-muted);
    text-align: center;
    margin: 0 0 16px 0;
}

.af-btn-checkout {
    display: block;
    width: 100%;
    padding: 14px 24px;
    text-align: center;
}

/* Bundle Upsell */
.af-cart-upsell {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--af-cart-border);
}

.af-upsell-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--af-cart-text);
    margin: 0 0 16px 0;
}

.af-upsell-card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    background: var(--af-cart-surface);
    border-radius: 12px;
    padding: 16px;
    align-items: center;
}

.af-upsell-image {
    width: 100px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.af-upsell-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.af-upsell-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--af-cart-text);
    margin: 0 0 4px 0;
}

.af-upsell-price {
    margin-bottom: 8px;
}

.af-upsell-price .af-price-current {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--af-cart-text);
}

.af-upsell-price .af-price-original {
    font-size: 0.8125rem;
    color: var(--af-cart-muted);
    text-decoration: line-through;
    margin-left: 8px;
}

/* Buttons */
.af-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.af-btn-primary {
    background: var(--af-cart-primary);
    color: #fff;
}

.af-btn-primary:hover {
    background: #b04e31;
}

.af-btn-secondary {
    background: var(--af-cart-surface);
    color: var(--af-cart-text);
    border: 1px solid var(--af-cart-border);
}

.af-btn-secondary:hover {
    border-color: var(--af-cart-text);
}

.af-btn-outline-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
    background: transparent;
    color: var(--af-cart-text);
    border: 1px solid var(--af-cart-border);
    border-radius: 20px;
}

.af-btn-outline-sm:hover {
    border-color: var(--af-cart-text);
}

/* Hide default WooCommerce elements that might interfere */
.woocommerce-cart .woocommerce-notices-wrapper,
.woocommerce-cart .wc-proceed-to-checkout {
    display: none;
}

/* Responsive */
@media (max-width: 900px) {
    .af-cart-layout {
        grid-template-columns: 1fr;
    }

    .af-cart-sidebar {
        position: static;
    }
}

@media (max-width: 600px) {
    .af-cart-title {
        font-size: 1.75rem;
    }

    .af-cart-item {
        grid-template-columns: 100px 1fr;
        gap: 16px;
        padding: 16px;
    }

    .af-cart-item-image {
        width: 100px;
        height: 75px;
    }

    .af-cart-item-actions {
        flex-wrap: wrap;
    }

    .af-upsell-card {
        grid-template-columns: 80px 1fr;
    }

    .af-upsell-image {
        width: 80px;
        height: 60px;
    }
}