/* ─── Basket Page ─── */
:root {
    --basket-bg: #f8fafc;
    --basket-card-bg: #ffffff;
    --basket-border: #e2e8f0;
    --basket-primary: #4f46e5;
    --basket-secondary: #64748b;
}

body {
    background-color: var(--basket-bg);
}

.basket-container {
    margin: 2rem auto 5rem;
}

.basket-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.basket-card {
    background: var(--basket-card-bg);
    border-radius: 16px;
    border: 1px solid var(--basket-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Seller Group Styling */
.basket-seller-group {
    border-bottom: 8px solid var(--basket-bg);
}

.basket-seller-group:last-child {
    border-bottom: none;
}

.seller-header {
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--basket-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.seller-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.seller-name {
    font-weight: 700;
    color: #334155;
}

.seller-shipping-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 600;
    margin-left: 0.5rem;
}

.seller-carrier-select {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
    margin-left: 0.5rem;
    cursor: pointer;
    outline: none;
}

.seller-carrier-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.btn-message-seller {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    background: #eef2ff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.5rem;
}

.btn-message-seller:hover {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #a5b4fc;
}

/* Teklif Gönder butonu */
.btn-offer-seller {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #fcd34d;
    color: #92400e;
    background: #fef3c7;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-offer-seller:hover {
    background: #fde68a;
    color: #78350f;
    border-color: #f59e0b;
}

.btn-offer-seller.is-pending {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
    cursor: not-allowed;
}

.btn-offer-seller.is-accepted {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.btn-offer-seller.is-accepted:hover {
    background: #a7f3d0;
}

/* Geri Çek butonu — .btn-offer-seller ile aynı kabuk, iptal/ikincil tonlaması */
.btn-withdraw-offer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    color: #6b7280;
    background: #f3f4f6;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px; /* touch target */
    min-width: 44px;
}

.btn-withdraw-offer:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.btn-withdraw-offer:disabled,
.btn-withdraw-offer[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Teklif Modal */
.basket-offer-modal-content {
    border-radius: 16px;
    overflow: hidden;
}

.basket-offer-seller-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.basket-offer-seller-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
}

.basket-offer-label {
    color: #64748b;
    font-size: 0.85rem;
}

.basket-offer-value {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.9rem;
}

.basket-offer-info-box {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    color: #3730a3;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}

.basket-offer-info-box i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.basket-offer-form-label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.basket-offer-input,
.basket-offer-textarea {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
}

.basket-offer-input:focus,
.basket-offer-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.basket-offer-currency {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
    font-weight: 600;
}

.basket-offer-error {
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
}

/* Dark theme — Geri Çek */
.theme-dark .btn-withdraw-offer {
    background: #1f2937;
    color: #9ca3af;
    border-color: #374151;
}

.theme-dark .btn-withdraw-offer:hover {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

/* Dark theme */
.theme-dark .btn-offer-seller {
    background: #422006;
    color: #fde68a;
    border-color: #78350f;
}

.theme-dark .btn-offer-seller:hover {
    background: #78350f;
    color: #fff;
    border-color: #f59e0b;
}

.theme-dark .btn-offer-seller.is-pending {
    background: #1f2937;
    color: #9ca3af;
    border-color: #374151;
}

.theme-dark .btn-offer-seller.is-accepted {
    background: #064e3b;
    color: #a7f3d0;
    border-color: #047857;
}

.theme-dark .basket-offer-modal-content {
    background: #111827;
    color: #e5e7eb;
}

.theme-dark .basket-offer-seller-info {
    background: #0f172a;
    border-color: #1f2937;
}

.theme-dark .basket-offer-label {
    color: #94a3b8;
}

.theme-dark .basket-offer-value {
    color: #e5e7eb;
}

.theme-dark .basket-offer-info-box {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
}

.theme-dark .basket-offer-form-label {
    color: #e5e7eb;
}

.theme-dark .basket-offer-input,
.theme-dark .basket-offer-textarea {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}

.theme-dark .basket-offer-currency {
    background: #1f2937;
    border-color: #374151;
    color: #cbd5e1;
}

.theme-dark .basket-offer-error {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

/* Mobile */
@media (max-width: 575.98px) {
    .btn-offer-seller {
        padding: 0.25rem 0.55rem;
        font-size: 0.75rem;
        margin-left: 0.3rem;
    }

    .btn-offer-seller .bi-tag {
        font-size: 0.85rem;
    }

    .btn-withdraw-offer {
        padding: 0.25rem 0.55rem;
        font-size: 0.75rem;
        margin-left: 0.3rem;
    }

    .btn-withdraw-offer .bi-x-circle {
        font-size: 0.85rem;
    }
}

/* Basket Item */
.basket-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--basket-border);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    transition: background 0.2s;
}

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

.basket-item:hover {
    background: #fcfcfc;
}

.basket-item-img {
    width: 80px;
    height: 110px;
    object-fit: contain;
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.basket-item-content {
    flex: 1;
}

.basket-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.basket-item-title a {
    color: #1e293b;
    text-decoration: none;
}

.basket-item-title a:hover {
    color: var(--basket-primary);
}

.basket-item-meta {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.basket-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-selector {
    width: 100px;
}

.basket-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.btn-remove {
    color: #ef4444;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
    border-radius: 6px;
}

.btn-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Review Card */
.review-card {
    position: sticky;
    top: 2rem;
}

.review-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--basket-border);
    font-weight: 700;
    color: #1e293b;
}

.review-body {
    padding: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

.summary-row.total {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed #e2e8f0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0;
}

.btn-checkout {
    background: var(--basket-primary);
    color: white;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    margin-top: 1.5rem;
    transition: all 0.2s;
}

.btn-checkout:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-checkout:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

/* Empty State */
.empty-basket {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.empty-basket i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    color: #e2e8f0;
}

/* ─── Summary Location Panel (Global) ─── */
.summary-location-panel {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.summary-location-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.summary-location-selects {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.summary-location-select {
    font-size: 0.82rem;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid #fbbf24;
    background: #fff;
    color: #92400e;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    width: 100%;
}

.summary-location-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.summary-location-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Platform Shipping (Kargonomi) ─── */

.platform-shipping-offers {
    padding: 0.5rem 1.5rem 0.75rem;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}

.platform-shipping-offers .offer-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.platform-shipping-offers .offer-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.platform-shipping-offers .offer-item:hover {
    border-color: #fbbf24;
    background: #fef9c3;
}

.platform-shipping-offers .offer-item.selected {
    border-color: #f59e0b;
    background: #fef3c7;
    box-shadow: 0 0 0 1px #f59e0b;
}

.platform-shipping-offers .offer-item input[type="radio"] {
    accent-color: #f59e0b;
    margin: 0;
}

.platform-shipping-offers .offer-name {
    font-weight: 600;
    color: #78350f;
}

.platform-shipping-offers .offer-price {
    font-weight: 700;
    color: #b45309;
}

.platform-shipping-offers .offer-days {
    font-size: 0.75rem;
    color: #92400e;
    opacity: 0.7;
}

.platform-shipping-loading {
    padding: 0.5rem 1.5rem;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    font-size: 0.82rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.platform-shipping-loading .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.platform-shipping-error {
    padding: 0.5rem 1.5rem;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    font-size: 0.82rem;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile */
@media (max-width: 991px) {
    .review-card {
        position: static;
        margin-top: 2rem;
    }

    .platform-shipping-offers .offer-list {
        flex-direction: column;
    }

    .platform-shipping-offers .offer-item {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .basket-item {
        flex-direction: column;
        gap: 1rem;
    }

    .basket-item-img {
        width: 60px;
        height: 85px;
    }

    .seller-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* ─── Dark Theme ─── */
.theme-dark .basket-title,
.theme-dark .seller-name,
.theme-dark .basket-item-title a,
.theme-dark .basket-item-price,
.theme-dark .review-header,
.theme-dark .summary-row.total {
    color: #e2e8f0;
}

.theme-dark .basket-card,
.theme-dark .seller-header,
.theme-dark .basket-item,
.theme-dark .info-box {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.theme-dark .basket-item:hover,
.theme-dark .seller-header,
.theme-dark .review-body,
.theme-dark .summary-row.total {
    background: #0f172a;
}

.theme-dark .basket-item-meta,
.theme-dark .summary-row,
.theme-dark .text-muted,
.theme-dark .empty-basket {
    color: #94a3b8 !important;
}

.theme-dark .vacation-seller-warning {
    background: #451a03 !important;
    color: #fde68a !important;
    border-color: #92400e !important;
}

.theme-dark .seller-icon,
.theme-dark .basket-item-img,
.theme-dark .seller-shipping-badge {
    background: #0f172a;
    border-color: #334155;
    color: #c7d2fe;
}

.theme-dark .seller-carrier-select {
    background: #0f172a;
    border-color: #334155;
    color: #c7d2fe;
}

.theme-dark .btn-message-seller {
    background: #0f172a;
    border-color: #334155;
    color: #c7d2fe;
}

.theme-dark .btn-message-seller:hover {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

.theme-dark .basket-item-meta .badge.bg-light.text-dark {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.theme-dark .quantity-selector,
.theme-dark .form-select,
.theme-dark .btn-checkout:disabled {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

/* Dark Theme - Summary Location Panel */
.theme-dark .summary-location-panel {
    background: #1c1917;
    border-color: #44403c;
}

.theme-dark .summary-location-header {
    color: #fde68a;
}

.theme-dark .summary-location-select {
    background: #292524;
    border-color: #78716c;
    color: #fde68a;
}

.theme-dark .summary-location-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

/* Dark Theme - Platform Shipping */
.theme-dark .platform-shipping-offers {
    background: #1c1917;
    border-color: #44403c;
}

.theme-dark .platform-shipping-offers .offer-item {
    background: #292524;
    border-color: #44403c;
    color: #e7e5e4;
}

.theme-dark .platform-shipping-offers .offer-item:hover {
    border-color: #fbbf24;
    background: #44403c;
}

.theme-dark .platform-shipping-offers .offer-item.selected {
    border-color: #f59e0b;
    background: #44403c;
}

.theme-dark .platform-shipping-offers .offer-name {
    color: #fde68a;
}

.theme-dark .platform-shipping-offers .offer-price {
    color: #fbbf24;
}

.theme-dark .platform-shipping-offers .offer-days {
    color: #d6d3d1;
}

.theme-dark .platform-shipping-loading {
    background: #1c1917;
    border-color: #44403c;
    color: #fde68a;
}

.theme-dark .platform-shipping-error {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

/* ─── Sepet Süre / Geri Sayım Banner ─── */
.basket-expiry-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 0.9rem;
    line-height: 1.35;
}

.basket-expiry-banner i {
    font-size: 1.25rem;
    color: #f97316;
    flex-shrink: 0;
}

.basket-expiry-banner strong {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #c2410c;
}

.basket-expiry-banner.is-urgent {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.basket-expiry-banner.is-urgent i,
.basket-expiry-banner.is-urgent strong {
    color: #dc2626;
}

.theme-dark .basket-expiry-banner {
    background: #1c1917;
    border-color: #44403c;
    color: #fde68a;
}

.theme-dark .basket-expiry-banner i {
    color: #fbbf24;
}

.theme-dark .basket-expiry-banner strong {
    color: #fcd34d;
}

.theme-dark .basket-expiry-banner.is-urgent {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

.theme-dark .basket-expiry-banner.is-urgent i,
.theme-dark .basket-expiry-banner.is-urgent strong {
    color: #fca5a5;
}
