/**
 * OTOEKO Cart Page
 * Matches account page design language (main.css)
 */

/* ========== PAGE LAYOUT ========== */
/* Üst boşluk ana sayfa hero gibi (--space-3), alt boşluk eşit; min-height ile oluşan gereksiz alt boşluk kaldırıldı */
.site-main:has(> .cart-page) {
    min-height: 0;
}
.cart-page {
    background: #ffffff;
    padding: var(--space-3, 0.75rem) 0 var(--space-3, 0.75rem) 0;
}

/* Cart grid: sol kolon esnek, sağ kolon sabit 500px */
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 24px;
    align-items: start;
}

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

/* ========== CART SECTION (white card) ========== */
.cart-section {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 2px solid #e5e7eb;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.cart-section:hover {
    border-color: #fed7aa;
}

.cart-section-header {
    padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-section-header svg,
.cart-section-header i {
    flex-shrink: 0;
    color: #f97316;
    font-size: 18px;
}

.cart-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.cart-section-title .cart-count {
    font-weight: 400;
    color: #9ca3af;
    font-size: 14px;
}

.cart-section-body {
    padding: 0;
}

/* ========== CART ITEM ROW ========== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s, opacity 0.3s, max-height 0.4s, padding 0.4s;
}

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

.cart-item:hover {
    background: #fff7ed;
}

.cart-item.out-of-stock {
    opacity: 0.5;
}

/* Item Image */
.cart-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: block;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* Item Info */
.cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    transition: color 0.2s;
}

.cart-item-name:hover {
    color: #f97316;
}

.cart-item-variation {
    font-size: 12px;
    color: #9ca3af;
}

.cart-item-price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 8px;
}

.cart-item-unit-price {
    font-size: 15px;
    font-weight: 600;
    color: #f97316;
}

.cart-item-extra-info {
    font-size: 15px;
    font-weight: 600;
    color: #e65100;
}

.cart-item-stock-warning {
    font-size: 12px;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Quantity Controls */
.cart-item-quantity {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    cursor: pointer;
    color: #4b5563;
    font-size: 12px;
    transition: all 0.2s;
}

.cart-item-qty-btn:hover:not(:disabled) {
    background: #fff7ed;
    color: #f97316;
}

.cart-item-qty-btn.cart-qty-delete {
    color: #ef4444;
}

.cart-item-qty-btn.cart-qty-delete:hover:not(:disabled) {
    background: #fef2f2;
    color: #dc2626;
}

.cart-item-qty-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.cart-item-qty-value {
    width: 40px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    border-left: 2px solid #e5e7eb;
    border-right: 2px solid #e5e7eb;
    line-height: 36px;
}

/* Item Total */
.cart-item-total {
    flex-shrink: 0;
    min-width: 100px;
    text-align: right;
}

.cart-item-total-value {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

/* Remove Button */
.cart-item-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 14px;
}

.cart-item-remove:hover {
    background: none;
    color: #dc2626;
}

/* ========== CART ACTIONS BAR ========== */
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 0;
}

.cart-action-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    padding: 10px 18px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-action-link:hover {
    color: #f97316;
    border-color: #fed7aa;
    background: #fff7ed;
}

.cart-action-link i {
    font-size: 12px;
}

.cart-action-danger {
    color: #9ca3af;
}

.cart-action-danger:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

/* ========== TRUST STRIP ========== */
.cart-trust-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 0;
}

.cart-trust-signal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 16px 8px;
    background: #fff;
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

.cart-trust-signal:hover {
    border-color: #fed7aa;
}

.cart-trust-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cart-trust-icon.original { background: #fff7ed; color: #f97316; }
.cart-trust-icon.secure   { background: #ecfdf5; color: #059669; }
.cart-trust-icon.shipping  { background: #eff6ff; color: #3b82f6; }
.cart-trust-icon.support   { background: #fdf4ff; color: #a855f7; }

.cart-trust-title {
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
}

.cart-trust-desc {
    font-size: 11px;
    color: #9ca3af;
}

/* ========== ORDER SUMMARY SIDEBAR ========== */
.cart-summary {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 2px solid #e5e7eb;
    position: sticky;
    top: 100px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.cart-summary:hover {
    border-color: #fed7aa;
}

.cart-summary-header {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
    color: #fff;
}

.cart-summary-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-summary-body {
    padding: var(--space-5, 1.25rem);
}

/* Totals */
.cart-totals {
    margin-bottom: 20px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    color: #4b5563;
}

.cart-total-row i {
    margin-right: 5px;
    font-size: 13px;
}

.cart-total-row.extra-tax {
    color: #e65100;
}

.cart-total-row.discount {
    color: #059669;
}

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

.cart-coupon-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 2px 7px;
}

.cart-discount-value {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-coupon-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    padding: 0 0 0 2px;
    flex-shrink: 0;
    line-height: 1;
}

.cart-coupon-remove:hover {
    color: #dc2626;
    transform: none !important;
    box-shadow: none !important;
    background: none !important;
}

.cart-total-row.shipping.free span:last-child {
    color: #059669;
    font-weight: 600;
}

.cart-total-row.grand-total {
    border-top: 2px solid #e5e7eb;
    padding-top: 18px;
    margin-top: 10px;
}

.cart-total-row.grand-total span:first-child {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.cart-total-row.grand-total span:last-child {
    font-size: 24px;
    font-weight: 800;
    color: #f97316;
}

.cart-total-kdv {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    margin-bottom: 16px;
}

/* Coupon Toggle */
.cart-coupon-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: #f97316;
    cursor: pointer;
    padding: 10px 14px;
    margin-bottom: 4px;
    background: #fff7ed;
    border: 1.5px dashed #fdba74;
    border-radius: 10px;
    transition: all 0.2s;
}

.cart-coupon-toggle:hover {
    color: #ea580c;
    background: #ffedd5;
    border-color: #f97316;
}

.cart-coupon-toggle i {
    font-size: 11px;
    transition: transform 0.3s;
}

.cart-coupon-toggle.open i {
    transform: rotate(90deg);
}

.cart-coupon-toggle.open {
    border-style: solid;
    border-color: #f97316;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    border-bottom: none;
}

/* Coupon */
.cart-coupon {
    display: flex;
    gap: 8px;
    padding: 0 14px;
    margin-bottom: 20px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    border: 1.5px solid transparent;
    border-top: none;
    border-radius: 0 0 10px 10px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.cart-coupon.open {
    max-height: 70px;
    opacity: 1;
    padding: 12px 14px;
    border-color: #f97316;
}

.cart-coupon-input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cart-coupon-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.cart-coupon-input::placeholder {
    color: #9ca3af;
}

.cart-coupon-btn {
    height: 44px;
    padding: 0 18px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.cart-coupon-btn:hover {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
}

/* Checkout Button */
.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
}

.cart-checkout-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.45);
    color: #fff;
    transform: translateY(-1px);
}

/* Security Badges */
.cart-security-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.cart-security-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 5px 10px;
}

.cart-security-badge i {
    color: #16a34a;
    font-size: 11px;
}

/* ========== EMPTY CART ========== */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 2px solid #e5e7eb;
}

.cart-empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: #fff7ed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-empty-icon svg,
.cart-empty-icon i {
    width: 48px;
    height: 48px;
    font-size: 48px;
    color: #f97316;
}

.cart-empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
}

.cart-empty-desc {
    font-size: 14px;
    color: #9ca3af;
    margin: 0 0 28px;
}

.cart-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
}

.cart-empty-btn:hover {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.45);
    color: #fff;
    transform: translateY(-1px);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .cart-trust-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cart-page {
        padding: var(--space-3, 0.75rem) 0;
    }

    .cart-item {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-info {
        flex: 1;
        min-width: calc(100% - 80px);
    }

    .cart-item-quantity {
        margin-left: auto;
    }

    .cart-item-total {
        min-width: auto;
        margin-left: auto;
    }

    .cart-item-remove {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .cart-item {
        position: relative;
        padding-right: 44px;
    }

    .cart-trust-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .cart-trust-signal {
        padding: 12px 6px;
    }

    .cart-summary {
        position: static;
    }

    .cart-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .cart-action-link {
        justify-content: center;
    }
}

/* ========== RECENTLY VIEWED (cart page) ========== */
.cart-page .pd-recently-viewed {
    margin-top: var(--space-6, 1.5rem);
    padding-top: 0;
    border-top: none;
}

.cart-page .pd-recently-viewed .swiper-button-prev,
.cart-page .pd-recently-viewed .swiper-button-next {
    color: #f97316;
}

.cart-page .pd-recently-viewed .swiper-button-prev:hover,
.cart-page .pd-recently-viewed .swiper-button-next:hover {
    color: #ea580c;
}

.cart-page .pd-recently-viewed .swiper-button-prev.swiper-button-disabled,
.cart-page .pd-recently-viewed .swiper-button-next.swiper-button-disabled {
    pointer-events: auto;
    cursor: default;
}

.cart-page .pd-recently-viewed .swiper {
    overflow-x: clip;
    overflow-y: visible;
}

.cart-page .pd-recently-viewed .section-header {
    margin-bottom: var(--space-3, 0.75rem);
}
