/* BudMarket Cart & Checkout - Simple Light Design */

/* ===== VARIABLES ===== */
:root {
    --bm-primary: #E31E24;
    --bm-primary-hover: #c31118;
    --bm-text: #333333;
    --bm-text-light: #666666;
    --bm-text-muted: #999999;
    --bm-bg: #ffffff;
    --bm-bg-light: #f8f9fa;
    --bm-border: #e1e1e1;
    --bm-success: #28a745;
    --bm-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --bm-radius: 8px;
    --bm-transition: all 0.2s ease;
}

/* ===== COMMON ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== CART PAGE ===== */

.budmarket-cart-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bm-bg-light);
}

/* Breadcrumbs */
.cart-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bm-text-light);
    text-decoration: none;
    transition: var(--bm-transition);
}

.breadcrumb-item:hover {
    color: var(--bm-primary);
}

.breadcrumb-item.active {
    color: var(--bm-text);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--bm-text-muted);
}

/* Empty Cart */
.empty-cart-section {
    padding: 80px 0;
    text-align: center;
}

.empty-cart-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-cart-icon svg {
    color: var(--bm-text-muted);
    opacity: 0.4;
}

.empty-cart-content h2 {
    font-size: 24px;
    margin: 20px 0 10px;
    color: var(--bm-text);
}

.empty-cart-content p {
    color: var(--bm-text-light);
    margin: 0 0 10px;
}

.shop-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bm-primary);
    color: white;
    padding: 14px 28px;
    border-radius: var(--bm-radius);
    text-decoration: none;
    font-weight: 600;
    margin-top: 30px;
    transition: var(--bm-transition);
}

.shop-now-btn:hover {
    background: var(--bm-primary-hover);
    color: white;
    text-decoration: none;
}

/* Cart Layout */
.cart-content-section {
    padding: 30px 0 60px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

/* Cart Items */
.cart-items-wrapper {
    background: var(--bm-bg);
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow);
    overflow: hidden;
}

.cart-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--bm-border);
    background: var(--bm-bg-light);
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--bm-text);
}

.custom-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--bm-primary);
}

.items-count {
    font-size: 14px;
    color: var(--bm-text-light);
}

/* Cart Item Card */
.cart-item-card {
    border-bottom: 1px solid var(--bm-border);
    transition: var(--bm-transition);
}

.cart-item-card:last-child {
    border-bottom: none;
}

.cart-item-card:hover {
    background: var(--bm-bg-light);
}

.cart-item-content {
    display: grid;
    grid-template-columns: 40px 100px 1fr 180px;
    gap: 20px;
    align-items: center;
    padding: 20px 25px;
}

.item-selector {
    display: flex;
    justify-content: center;
}

.item-image {
    position: relative;
    border-radius: var(--bm-radius);
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: auto;
    display: block;
}

.sale-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--bm-primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--bm-text);
    margin: 0;
}

.item-name a {
    color: inherit;
    text-decoration: none;
}

.item-name a:hover {
    color: var(--bm-primary);
}

.item-sku {
    font-size: 12px;
    color: var(--bm-text-muted);
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--bm-success);
}

.stock-status.out-of-stock {
    color: var(--bm-primary);
}

.delivery-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--bm-text-light);
}

.delivery-option,
.pickup-option {
    display: flex;
    align-items: center;
    gap: 6px;
}

.delivery-option svg,
.pickup-option svg {
    color: var(--bm-primary);
}

/* Item Actions */
.item-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.quantity-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-label {
    font-size: 12px;
    color: var(--bm-text-light);
}

.quantity input[type="number"] {
    width: 60px;
    text-align: center;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: 8px;
    font-size: 14px;
    background: var(--bm-bg);
}

.quantity input[type="number"]:focus {
    outline: none;
    border-color: var(--bm-primary);
}

.unit-text {
    font-size: 12px;
    color: var(--bm-text-muted);
}

.remove-item {
    background: none;
    border: none;
    color: var(--bm-text-muted);
    cursor: pointer;
    padding: 5px;
    transition: var(--bm-transition);
}

.remove-item:hover {
    color: var(--bm-primary);
}

.price-section {
    text-align: right;
}

.old-price {
    font-size: 13px;
    color: var(--bm-text-muted);
    text-decoration: line-through;
}

.current-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--bm-primary);
}

.total-price {
    font-size: 12px;
    color: var(--bm-text-light);
}

/* Cart Actions */
.cart-actions {
    padding: 20px 25px;
    border-top: 1px solid var(--bm-border);
    background: var(--bm-bg-light);
}

.update-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bm-bg);
    color: var(--bm-text);
    border: 1px solid var(--bm-border);
    padding: 10px 20px;
    border-radius: var(--bm-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--bm-transition);
}

.update-cart-btn:hover {
    border-color: var(--bm-primary);
    color: var(--bm-primary);
}

/* Cart Summary */
.cart-summary-wrapper {
    position: sticky;
    top: 100px;
}

.cart-summary-sticky,
.order-summary-wrapper {
    background: var(--bm-bg);
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow);
    overflow: hidden;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: var(--bm-primary);
    color: white;
}

.summary-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.summary-content {
    padding: 25px;
}

/* Coupon */
.coupon-section {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--bm-bg-light);
    border-radius: var(--bm-radius);
}

.coupon-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bm-text);
}

.coupon-form {
    display: flex;
    gap: 10px;
}

.coupon-input {
    flex: 1;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: 10px 12px;
    font-size: 14px;
}

.coupon-input:focus {
    outline: none;
    border-color: var(--bm-primary);
}

.coupon-btn {
    background: var(--bm-text);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--bm-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--bm-transition);
}

.coupon-btn:hover {
    background: var(--bm-primary);
}

/* Totals */
.totals-section {
    margin-bottom: 25px;
}

.cart-totals {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--bm-border);
}

.totals-row:last-child {
    border-bottom: none;
}

.totals-row.total {
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid var(--bm-border);
}

.totals-label {
    font-size: 14px;
    color: var(--bm-text);
}

.totals-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--bm-text);
}

.totals-row.discount .totals-value {
    color: var(--bm-success);
}

.totals-row.total .totals-label,
.totals-row.total .totals-value {
    font-size: 16px;
    font-weight: 600;
}

.totals-row.total .totals-value {
    color: var(--bm-primary);
    font-size: 18px;
}

/* Checkout Button */
.checkout-section,
.place-order-section {
    margin-top: 20px;
}

.checkout-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bm-primary);
    color: white;
    padding: 16px 24px;
    border: none;
    border-radius: var(--bm-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--bm-transition);
}

.checkout-btn:hover {
    background: var(--bm-primary-hover);
    color: white;
    text-decoration: none;
}

.checkout-total {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    font-size: 12px;
    color: var(--bm-text-muted);
}

.security-info svg {
    color: var(--bm-success);
}

/* Recommendations */
.cart-recommendations-section {
    padding: 50px 0;
    background: var(--bm-bg);
}

.recommendations-header {
    text-align: center;
    margin-bottom: 30px;
}

.recommendations-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 600;
    color: var(--bm-text);
    margin: 0 0 8px;
}

.recommendations-subtitle {
    font-size: 14px;
    color: var(--bm-text-light);
    margin: 0;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}


/* ===== CHECKOUT PAGE ===== */

.budmarket-checkout-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bm-bg-light);
}

.checkout-breadcrumb-section {
    background: var(--bm-bg);
    border-bottom: 1px solid var(--bm-border);
}

/* Checkout Layout */
.checkout-content-section {
    padding: 30px 0 60px;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.checkout-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Checkout Blocks */
.checkout-block {
    background: var(--bm-bg);
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow);
    overflow: hidden;
}

.checkout-block .block-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--bm-text);
    margin: 0;
    padding: 20px 25px;
    border-bottom: 1px solid var(--bm-border);
    background: var(--bm-bg-light);
}

.checkout-block .block-content {
    padding: 25px;
}

/* Form Fields */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
    display: grid;
    gap: 15px;
}

.form-row {
    margin-bottom: 0 !important;
}

.form-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--bm-text);
    margin-bottom: 6px;
}

.form-row label .required {
    color: var(--bm-primary);
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: 12px 14px;
    font-size: 14px;
    transition: var(--bm-transition);
    background: var(--bm-bg);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--bm-primary);
}

.form-row textarea {
    min-height: 100px;
    resize: vertical;
}

/* Select2 Override */
.select2-container--default .select2-selection--single {
    border: 1px solid var(--bm-border) !important;
    border-radius: var(--bm-radius) !important;
    height: 46px !important;
    padding: 8px 14px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px !important;
}

/* Shipping Methods */
.woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-shipping-methods li {
    padding: 12px 15px;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--bm-transition);
}

.woocommerce-shipping-methods li:hover {
    border-color: var(--bm-primary);
}

.woocommerce-shipping-methods li label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

.woocommerce-shipping-methods li input[type="radio"] {
    accent-color: var(--bm-primary);
}

/* Payment Methods */
.woocommerce-checkout-payment {
    background: transparent;
    border-radius: 0;
}

.wc_payment_methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wc_payment_method {
    padding: 15px;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--bm-transition);
}

.wc_payment_method:hover {
    border-color: var(--bm-primary);
}

.wc_payment_method label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    margin: 0;
}

.wc_payment_method input[type="radio"] {
    accent-color: var(--bm-primary);
}

.payment_box {
    margin-top: 15px;
    padding: 15px;
    background: var(--bm-bg-light);
    border-radius: var(--bm-radius);
    font-size: 13px;
    color: var(--bm-text-light);
}

/* Hide default payment button (we have custom) */
.woocommerce-checkout-payment .place-order {
    display: none;
}

/* Order Items in Checkout */
.order-items-list {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bm-border);
}

.order-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
}

.order-item:not(:last-child) {
    border-bottom: 1px solid var(--bm-border);
}

.order-item .item-image {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

.order-item .item-image img {
    width: 100%;
    height: auto;
}

.order-item .item-quantity {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--bm-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.order-item .item-name {
    font-size: 13px;
    color: var(--bm-text);
    line-height: 1.3;
}

.order-item .item-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--bm-text);
}

/* Checkout Sidebar */
.checkout-sidebar {
    position: sticky;
    top: 100px;
}

.back-to-cart {
    margin-top: 15px;
    text-align: center;
}

.back-to-cart a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--bm-text-light);
    text-decoration: none;
    font-size: 14px;
    transition: var(--bm-transition);
}

.back-to-cart a:hover {
    color: var(--bm-primary);
}

/* Login Required */
.checkout-login-required {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    background: var(--bm-bg-light);
}

.login-message {
    text-align: center;
    max-width: 350px;
}

.login-message h2 {
    font-size: 22px;
    color: var(--bm-text);
    margin: 0 0 10px;
}

.login-message p {
    color: var(--bm-text-light);
    margin: 0 0 25px;
}

.login-btn {
    display: inline-block;
    background: var(--bm-primary);
    color: white;
    padding: 12px 28px;
    border-radius: var(--bm-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--bm-transition);
}

.login-btn:hover {
    background: var(--bm-primary-hover);
    color: white;
    text-decoration: none;
}


/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary-wrapper,
    .checkout-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-item-content {
        grid-template-columns: 30px 80px 1fr;
        gap: 15px;
    }

    .item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 15px;
        border-top: 1px solid var(--bm-border);
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .cart-content-section,
    .checkout-content-section {
        padding: 20px 0 40px;
    }

    .cart-item-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .item-selector {
        display: none;
    }

    .item-image {
        max-width: 120px;
        margin: 0 auto;
    }

    .item-actions {
        flex-direction: column;
        align-items: center;
    }

    .summary-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .checkout-btn {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== PRINT ===== */

@media print {
    .cart-actions,
    .checkout-btn,
    .coupon-section,
    .security-info,
    .back-to-cart {
        display: none;
    }

    .budmarket-cart-wrapper,
    .budmarket-checkout-wrapper {
        background: white;
    }

    .cart-items-wrapper,
    .checkout-block,
    .order-summary-wrapper {
        box-shadow: none;
        border: 1px solid var(--bm-border);
    }
}