/**
 * Etsy-Style Unified Cart Styles
 * ÇiftçidenEve - FAZ2 Unified Checkout
 *
 * Design System Colors:
 * - Primary Brand: #1A6355
 * - Accent Pink: #b9475e
 * - Accent Hover: #e79275
 * - Background Cream: #FFF3E5
 */

/* ==========================================================================
   CART UNIFIED LAYOUT - Two Column Structure
   ========================================================================== */

.cart-unified-layout {
    display: flex;
    gap: 30px;
    max-width: 1230px;
    margin: 0 auto;
    padding: 20px 0;
}

.cart-sellers-column {
    flex: 1;
    min-width: 0;
}

.cart-summary-column {
    width: 360px;
    flex-shrink: 0;
}

/* ==========================================================================
   SELLER BLOCK STYLES - Modernized
   ========================================================================== */

.cart-seller-block {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e6e6e6;
}

.cart-seller-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e6e6e6;
}

.cart-seller-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1A6355;
}

.cart-seller-info {
    flex: 1;
}

.cart-seller-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A6355;
    text-decoration: none;
    display: block;
}

.cart-seller-name:hover {
    color: #b9475e;
}

.cart-seller-rating {
    font-size: 13px;
    color: #7d91a3;
    margin-top: 2px;
}

.cart-seller-rating i {
    color: #f5a623;
    margin-right: 4px;
}

/* Seller Items */
.cart-seller-items {
    padding: 0;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

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

.cart-item-title a:hover {
    color: #b9475e;
}

.cart-item-option {
    font-size: 13px;
    color: #7d91a3;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #b9475e;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

/* Quantity Controls */
.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.cart-qty-btn {
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cart-qty-btn:hover {
    background: #e6e6e6;
    color: #333;
}

.cart-qty-input {
    width: 45px;
    height: 32px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.cart-qty-input:focus {
    outline: none;
    background: #fff8f0;
}

/* Remove Button */
.cart-item-remove {
    font-size: 13px;
    color: #999;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-remove:hover {
    color: #d63e2e;
}

/* Seller Footer - Address & Shipping */
.cart-seller-footer {
    padding: 16px 20px;
    background: #fafafa;
    border-top: 1px solid #e6e6e6;
}

.cart-address-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cart-address-label {
    font-size: 13px;
    color: #666;
    min-width: 80px;
}

.cart-address-select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    /* Override selectbox plugin hiding */
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
}

.cart-address-select:focus {
    outline: none;
    border-color: #1A6355;
    box-shadow: 0 0 0 2px rgba(26, 99, 85, 0.1);
}

/* Hide selectbox plugin wrapper for cart address selects */
.cart-address-row .sbHolder {
    display: none !important;
}

.cart-add-address {
    font-size: 13px;
    color: #1A6355;
    text-decoration: none;
}

.cart-add-address:hover {
    text-decoration: underline;
}

.cart-seller-totals {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
}

/* Each row in seller totals - table-like layout */
.cart-seller-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}

.cart-seller-totals-row:first-child {
    padding-top: 0;
}

.cart-seller-totals-row .row-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.cart-seller-totals-row .row-value {
    text-align: right;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* Subtotal row - always right-aligned, prominent */
.cart-seller-totals-row.subtotal-row {
    border-top: 1px solid #e6e6e6;
    margin-top: 8px;
    padding-top: 12px;
}

.cart-seller-totals-row.subtotal-row .row-label {
    font-weight: 500;
    color: #333;
}

.cart-seller-totals-row.subtotal-row .row-value {
    font-size: 16px;
    font-weight: 700;
    color: #b9475e;
}

/* Solidarity shipping row - Pink theme */
.cart-seller-totals-row.solidarity-row {
    background: linear-gradient(135deg, #fce7f3 0%, #fff1f2 100%);
    border: 1px solid #fbcfe8;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: #be185d;
}

.cart-seller-totals-row.solidarity-row .row-value {
    color: #be185d;
}

/* Distribution fee row - Pink theme (lighter) */
.cart-seller-totals-row.distribution-row {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #9d174d;
}

.cart-seller-totals-row.distribution-row .row-value {
    color: #be185d;
}

/* Normal shipping row - Green theme */
.cart-seller-totals-row.shipping-row {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: #166534;
}

.cart-seller-totals-row.shipping-row .row-value {
    color: #1A6355;
}

/* COD shipping row - Golden/Orange theme */
.cart-seller-totals-row.cod-row {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: #92400e;
}

.cart-seller-totals-row.cod-row .row-value {
    color: #b45309;
}

/* Exempt shipping row - Orange theme */
.cart-seller-totals-row.exempt-row {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 0 0 8px 0;
    color: #c2410c;
}

.cart-seller-totals-row.exempt-row .row-label {
    color: #c2410c;
}

.cart-seller-totals-row.exempt-row .row-value {
    color: #c2410c;
}

/* COD notice styling */
.cart-seller-totals-row .row-notice {
    font-size: 11px;
    color: #7d91a3;
    margin-top: 4px;
    display: block;
}

/* Legacy classes for backward compatibility */
.cart-seller-shipping,
.cart-seller-subtotal {
    font-size: 14px;
    color: #666;
}

.cart-seller-shipping strong,
.cart-seller-subtotal strong {
    color: #333;
    font-weight: 600;
}

/* ==========================================================================
   CART SUMMARY PANEL - Sticky Sidebar
   ========================================================================== */

.cart-summary-panel {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e6e6e6;
    position: sticky;
    top: 100px;
}

.cart-summary-body {
    padding: 20px;
}

/* Quick bar - shown on both desktop and mobile as header */
.cart-summary-quick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #b9475e 0%, #a03d52 100%);
    border-radius: 8px 8px 0 0;
    cursor: default;
}

.cart-summary-quick > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-summary-quick-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.cart-summary-quick-total {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

/* Hide expand button on desktop */
.cart-summary-expand-btn {
    display: none;
}

/* Summary Rows */
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
}

.cart-summary-row.total {
    border-top: 2px solid #e6e6e6;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.cart-summary-row.total .cart-summary-value {
    color: #b9475e;
    font-size: 22px;
}

.cart-summary-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-summary-value {
    font-weight: 500;
    color: #333;
}

/* Shipping Info */
.cart-shipping-info {
    font-size: 12px;
    color: #7d91a3;
    margin-top: 4px;
}

.cart-free-shipping {
    color: #1A6355;
    font-weight: 500;
}

/* Payment Methods */
.cart-payment-methods {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e6e6e6;
}

.cart-payment-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.cart-payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid #e6e6e6;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-payment-option:hover {
    border-color: #1A6355;
    background: #f9f9f9;
}

.cart-payment-option.selected {
    border-color: #1A6355;
    background: rgba(26, 99, 85, 0.05);
}

.cart-payment-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #1A6355;
}

.cart-payment-option-icon {
    width: 32px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-payment-option-icon img {
    max-width: 100%;
    max-height: 100%;
}

.cart-payment-option-label {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.cart-payment-option-icons {
    display: flex;
    gap: 4px;
}

.cart-payment-option-icons img {
    height: 20px;
}

.cart-payment-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Checkout Button */
.cart-checkout-btn {
    width: 100%;
    padding: 16px 24px;
    background: #b9475e;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.cart-checkout-btn:hover {
    background: #d45a71;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 71, 94, 0.3);
}

.cart-checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cart-checkout-btn i {
    font-size: 18px;
}

/* Address Warning */
.cart-address-warning {
    background: #fff8e6;
    border: 1px solid #f5c842;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #856404;
}

.cart-address-warning i {
    color: #f5c842;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cart-address-warning.hidden {
    display: none;
}

/* Info Box */
.cart-info-box {
    background: #e8f5f2;
    border-radius: 6px;
    padding: 14px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cart-info-box i {
    color: #1A6355;
    font-size: 18px;
    flex-shrink: 0;
}

.cart-info-box-text {
    font-size: 13px;
    color: #1A6355;
    line-height: 1.5;
}

/* ==========================================================================
   MOBILE RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 1050px) {
    .cart-unified-layout {
        flex-direction: column;
        gap: 0;
        padding-bottom: 20px;
    }

    .cart-summary-column {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .cart-summary-panel {
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
        border: none;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Mobile: quick bar is clickable */
    .cart-summary-quick {
        border-radius: 20px 20px 0 0;
        cursor: pointer;
    }

    .cart-summary-quick-info {
        font-size: 12px;
    }

    .cart-summary-quick-total {
        font-size: 22px;
    }

    /* Show expand button on mobile */
    .cart-summary-expand-btn {
        display: flex;
        background: rgba(255,255,255,0.15);
        border: none;
        color: #ffffff;
        font-size: 13px;
        cursor: pointer;
        align-items: center;
        gap: 6px;
        padding: 10px 16px;
        border-radius: 20px;
        transition: all 0.2s;
    }

    .cart-summary-expand-btn:hover,
    .cart-summary-expand-btn:active {
        background: rgba(255,255,255,0.25);
    }

    /* Collapsed state: hide body */
    .cart-summary-panel.collapsed .cart-summary-body {
        display: none;
    }

    /* Expanded state: show everything */
    .cart-summary-panel:not(.collapsed) .cart-summary-body {
        display: block;
        padding: 16px 20px 20px;
    }

    /* Make checkout button more prominent on mobile */
    .cart-summary-panel .cart-checkout-btn {
        padding: 18px 24px;
        font-size: 17px;
        border-radius: 8px;
        margin-top: 16px;
    }

    /* Simplify payment options on mobile */
    .cart-summary-panel .cart-payment-option {
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .cart-summary-panel .cart-payment-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    /* Hide info box on mobile to save space */
    .cart-summary-panel .cart-info-box {
        display: none;
    }

    /* Add padding to body for fixed summary */
    body.has-cart-summary {
        padding-bottom: 160px;
    }

    body.has-cart-summary.collapsed {
        padding-bottom: 90px;
    }
}

@media (max-width: 670px) {
    .cart-item {
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
    }

    /* Mobile: Keep image small and on the left */
    .cart-item-image {
        width: 70px !important;
        height: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        flex-shrink: 0;
    }

    .cart-item-image img {
        width: 70px !important;
        height: 70px !important;
        object-fit: cover;
    }

    .cart-item-details {
        flex: 1;
        min-width: 0;
    }

    .cart-item-title {
        font-size: 14px;
    }

    .cart-item-price {
        font-size: 16px;
    }

    .cart-item-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }

    .cart-address-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .cart-address-label {
        min-width: auto;
    }

    .cart-seller-totals {
        flex-direction: column;
        gap: 0;
    }

    .cart-seller-totals-row {
        padding: 6px 0;
    }

    .cart-seller-totals-row.solidarity-row,
    .cart-seller-totals-row.distribution-row,
    .cart-seller-totals-row.shipping-row,
    .cart-seller-totals-row.cod-row,
    .cart-seller-totals-row.exempt-row {
        padding: 8px 10px;
    }
}


/* ==========================================================================
   EMPTY CART STATE
   ========================================================================== */

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.cart-empty-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.cart-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.cart-empty-text {
    font-size: 14px;
    color: #7d91a3;
    margin-bottom: 24px;
}

.cart-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #1A6355;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.cart-empty-btn:hover {
    background: #2a7a6a;
    transform: translateY(-1px);
}

/* ==========================================================================
   LOCAL PICKUP OPTION
   ========================================================================== */

.cart-localpickup {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0f7f5;
    border-radius: 6px;
    margin-bottom: 12px;
}

.cart-localpickup input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1A6355;
}

.cart-localpickup label {
    font-size: 14px;
    color: #1A6355;
    cursor: pointer;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.cart-loading {
    position: relative;
}

.cart-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.cart-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #e6e6e6;
    border-top-color: #1A6355;
    border-radius: 50%;
    animation: cart-spin 0.8s linear infinite;
    z-index: 11;
}

@keyframes cart-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   COUPON CODE SECTION
   ========================================================================== */

.cart-coupon {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e6e6e6;
}

.cart-coupon-toggle {
    font-size: 14px;
    color: #1A6355;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-coupon-toggle:hover {
    text-decoration: underline;
}

.cart-coupon-form {
    display: none;
    margin-top: 12px;
}

.cart-coupon-form.active {
    display: flex;
    gap: 8px;
}

.cart-coupon-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cart-coupon-input:focus {
    outline: none;
    border-color: #1A6355;
}

.cart-coupon-btn {
    padding: 10px 16px;
    background: #1A6355;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-coupon-btn:hover {
    background: #2a7a6a;
}

/* Applied coupon */
.cart-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e8f5f2;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 12px;
}

.cart-coupon-applied-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1A6355;
    font-weight: 500;
}

.cart-coupon-applied-code {
    font-size: 14px;
    font-weight: 600;
    color: #1A6355;
}

.cart-coupon-applied-discount {
    font-size: 14px;
    color: #1A6355;
}

.cart-coupon-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
}

.cart-coupon-remove:hover {
    color: #d63e2e;
}

/* ==========================================================================
   OUT OF STOCK WARNING
   ========================================================================== */

.cart-item-stock-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-item-stock-warning i {
    color: #ffc107;
}
