/* =============================================
   Teslimat Planlama Sistemi - Stiller
   ============================================= */

.delivery-section {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.delivery-section-title {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Sadece Ankara info satırı ── */
.delivery-only-ankara {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fdf1f3 0%, #fff8ed 100%);
    border-radius: 20px;
    color: var(--pink-dark);
    font-size: 0.78rem;
    line-height: 1;
}
.delivery-only-ankara svg {
    flex-shrink: 0;
    color: var(--pink);
}
.delivery-only-ankara strong {
    color: var(--pink-dark);
    font-weight: 700;
}

/* ── İlçe + Mahalle ── */
.delivery-location {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.delivery-location-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* allow shrinking on narrow viewports */
}
.delivery-location-field label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: 0.02em;
    padding-left: 2px;
}

.delivery-select {
    width: 100%;
    min-height: 46px; /* ≥44px tap target */
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.delivery-select:focus {
    outline: none;
    border-color: var(--pink);
    box-shadow: 0 0 0 3px var(--pink-pale);
}
.delivery-select:disabled {
    background-color: #f8f8f8;
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.85;
}

/* ── Teslimat ücreti pill ── */
.delivery-cost-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: #f8f8f8;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.delivery-cost-pill svg {
    flex-shrink: 0;
}
.delivery-cost-pill .delivery-cost-text {
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}
.delivery-cost-pill.is-set {
    background: #fdf1f3;
    border-style: solid;
    border-color: #f5c6cf;
    color: var(--pink-dark);
}
.delivery-cost-pill.is-near-free {
    background: #fff8ed;
    border-color: var(--gold);
    color: #8a6d2e;
}
.delivery-cost-pill.is-free {
    background: #e8f5e9;
    border-style: solid;
    border-color: #c1e1c5;
    color: #2e7d32;
    font-weight: 600;
}
.delivery-cost-pill.is-free svg {
    color: #2e7d32;
}

/* ── Tarih Seçici ── */
.delivery-dates {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.delivery-dates::-webkit-scrollbar {
    height: 4px;
}

.delivery-dates::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.delivery-date-btn {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    min-width: 90px;
    font-family: var(--sans);
}

.delivery-date-btn:hover {
    border-color: var(--pink-light);
    background: var(--pink-pale);
}

.delivery-date-btn.active {
    border-color: var(--pink);
    background: var(--pink);
    color: var(--white);
}

.delivery-date-btn .date-label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

.delivery-date-btn .date-sub {
    font-size: 0.72rem;
    opacity: 0.8;
    margin-top: 2px;
}

.delivery-date-btn.active .date-sub {
    opacity: 0.9;
}

.delivery-calendar-btn {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    min-width: 70px;
    min-height: 60px;
    position: relative;
    font-family: var(--sans);
    color: var(--text);
}

.delivery-calendar-btn:hover {
    border-color: var(--pink-light);
    background: var(--pink-pale);
}
.delivery-calendar-btn:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 2px;
}

.delivery-calendar-btn svg {
    margin-bottom: 2px;
    pointer-events: none;
}

.delivery-calendar-btn .date-label {
    font-size: 0.72rem;
    color: var(--text-soft);
    pointer-events: none;
}

/* Native date input görünmez ama showPicker() ile programatik açılır */
.delivery-calendar-btn input[type="date"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    /* iOS auto-zoom önleme */
    font-size: 16px;
}

/* ── Saat Dilimleri ── */
.delivery-slots-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.delivery-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.delivery-slot-btn {
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--text);
    transition: all var(--transition);
    text-align: center;
}

.delivery-slot-btn:hover:not(.disabled) {
    border-color: var(--pink-light);
    background: var(--pink-pale);
}

.delivery-slot-btn.active {
    border-color: var(--pink);
    background: var(--pink-pale);
    color: var(--pink-dark);
    font-weight: 600;
}

.delivery-slot-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-soft);
    text-decoration: line-through;
}

/* ── Acil Teslimat Geri Sayım ── */
.delivery-urgent-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.84rem;
    color: #e65100;
}

.delivery-urgent-banner svg {
    flex-shrink: 0;
}

.delivery-urgent-banner strong {
    font-weight: 700;
}

.delivery-urgent-banner .urgent-time {
    font-weight: 700;
    color: #bf360c;
}

/* ── Güven Rozetleri ── */
.delivery-trust-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.delivery-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-soft);
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.delivery-trust-badge svg {
    flex-shrink: 0;
    color: var(--green);
}

/* ── Görsel Onayı ── */
.delivery-visual-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: var(--pink-pale);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.delivery-visual-note svg {
    flex-shrink: 0;
    color: var(--pink);
    margin-top: 2px;
}

.delivery-visual-note strong {
    color: var(--text);
    display: block;
    margin-bottom: 2px;
}

/* ── Sticky Bottom Bar (Mobil) ── */
.delivery-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    z-index: 45;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}
.delivery-sticky-bar.visible {
    transform: translateY(0);
}

.delivery-sticky-price {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--pink-dark);
    line-height: 1.2;
}

.delivery-sticky-price small {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--success);
    display: block;
}

.delivery-sticky-bar .btn {
    white-space: nowrap;
    padding: 12px 20px;
}

.delivery-sticky-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.delivery-sticky-cart {
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0 !important;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--pink);
    border: 1.5px solid var(--pink);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.delivery-sticky-cart:hover { background: var(--pink-pale); }
.delivery-sticky-cart svg { width: 20px; height: 20px; }
.delivery-sticky-buy {
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(196,114,127,0.28);
}

/* ── Teslimat Özeti (Checkout) ── */
.delivery-summary-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--green-pale);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.delivery-summary-box svg {
    flex-shrink: 0;
    color: var(--green);
}

.delivery-summary-box .delivery-summary-text {
    flex: 1;
}

.delivery-summary-box .delivery-summary-text strong {
    font-size: 0.88rem;
    color: var(--text);
    display: block;
}

.delivery-summary-box .delivery-summary-text span {
    font-size: 0.78rem;
    color: var(--text-soft);
}

.delivery-summary-box .delivery-change-link {
    font-size: 0.78rem;
    color: var(--pink);
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .delivery-sticky-bar {
        display: flex;
    }
    /* Sticky bar görünürken sayfa içeriğini örtmesin */
    body:has(.delivery-sticky-bar.visible),
    body.has-sticky-bar {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .delivery-section {
        padding: 16px;
        margin-top: 16px;
        margin-bottom: 16px;
    }

    .delivery-date-btn {
        min-width: 80px;
        padding: 8px 14px;
    }

    .delivery-trust-badges {
        flex-direction: column;
    }

    .delivery-trust-badge {
        justify-content: flex-start;
    }

    .delivery-slot-btn {
        flex: 1;
        min-width: calc(50% - 4px);
    }

    /* İlçe+mahalle dar ekranda alt alta */
    .delivery-location {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .delivery-select {
        min-height: 48px;
        font-size: 1rem; /* iOS auto-zoom önlemek için ≥16px */
    }

    .delivery-cost-pill {
        font-size: 0.82rem;
        padding: 9px 12px;
    }

    .delivery-only-ankara {
        font-size: 0.72rem;
        padding: 5px 9px;
    }
}

@media (max-width: 480px) {
    .delivery-date-btn {
        min-width: 72px;
        padding: 8px 10px;
    }

    .delivery-date-btn .date-label {
        font-size: 0.78rem;
    }

    .delivery-slot-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .delivery-cost-pill .delivery-cost-text {
        font-size: 0.8rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   Çiçekiva Custom Date Picker (Premium Luxury Floral)
   ═══════════════════════════════════════════════════════════ */
.civdp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 107, 93, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.civdp-overlay.is-open {
    display: flex;
    opacity: 1;
    animation: civdpFadeIn 0.2s ease;
}
@keyframes civdpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.civdp-modal {
    width: 100%;
    max-width: 380px;
    background: #fffbf9;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(74, 107, 93, 0.25), 0 6px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(181, 152, 90, 0.18);
    overflow: hidden;
    animation: civdpScaleIn 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
    font-family: var(--sans, 'Nunito Sans', sans-serif);
}
@keyframes civdpScaleIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Header (Ay-Yıl + Nav) ── */
.civdp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
    background: linear-gradient(180deg, rgba(196, 114, 127, 0.06), transparent);
    border-bottom: 1px solid rgba(74, 107, 93, 0.08);
}
.civdp-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(74, 107, 93, 0.15);
    background: #fff;
    border-radius: 10px;
    color: var(--green, #4a6b5d);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.civdp-nav:hover:not(:disabled) {
    border-color: var(--pink, #c4727f);
    color: var(--pink, #c4727f);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(196, 114, 127, 0.15);
}
.civdp-nav:active:not(:disabled) {
    transform: translateY(0);
}
.civdp-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.civdp-nav:focus-visible {
    outline: 2px solid var(--pink, #c4727f);
    outline-offset: 2px;
}
.civdp-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--serif, 'Cormorant Garamond', serif);
    font-weight: 500;
}
.civdp-title-month {
    font-size: 1.5rem;
    color: var(--green, #4a6b5d);
    letter-spacing: 0.2px;
}
.civdp-title-year {
    font-size: 1.15rem;
    color: var(--gold, #b5985a);
    font-weight: 400;
    font-style: italic;
}

/* ── Hafta günleri ── */
.civdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 12px 14px 6px;
    gap: 2px;
}
.civdp-weekdays span {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-soft, rgba(0, 0, 0, 0.5));
    padding: 4px 0;
}

/* ── Gün hücreleri ── */
.civdp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 4px 14px 18px;
}
.civdp-day {
    aspect-ratio: 1;
    min-height: 40px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    color: var(--text, #2a2a2a);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.civdp-day:hover:not(.is-disabled) {
    background: rgba(196, 114, 127, 0.08);
    color: var(--pink, #c4727f);
}
.civdp-day:focus-visible {
    outline: 2px solid var(--pink, #c4727f);
    outline-offset: 1px;
}
.civdp-day.is-outside {
    color: rgba(0, 0, 0, 0.25);
    font-weight: 400;
}
.civdp-day.is-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: rgba(0, 0, 0, 0.4);
}
.civdp-day.is-today:not(.is-selected) {
    border-color: var(--gold, #b5985a);
    color: var(--gold, #b5985a);
    font-weight: 700;
}
.civdp-day.is-today:not(.is-selected)::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold, #b5985a);
}
.civdp-day.is-selected {
    background: linear-gradient(135deg, var(--pink, #c4727f), #a85a68);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(196, 114, 127, 0.35);
    transform: scale(1.02);
}
.civdp-day.is-selected:hover {
    background: linear-gradient(135deg, #a85a68, #8d4754);
    color: #fff;
}

/* ── Footer (İptal / Bugün) ── */
.civdp-footer {
    display: flex;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(74, 107, 93, 0.08);
    background: rgba(255, 251, 249, 0.6);
}
.civdp-btn {
    flex: 1;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    letter-spacing: 0.2px;
}
.civdp-btn-secondary {
    background: transparent;
    color: var(--text-soft, rgba(0, 0, 0, 0.55));
    border-color: rgba(74, 107, 93, 0.18);
}
.civdp-btn-secondary:hover {
    border-color: var(--green, #4a6b5d);
    color: var(--green, #4a6b5d);
    background: rgba(74, 107, 93, 0.04);
}
.civdp-btn-primary {
    background: var(--pink, #c4727f);
    color: #fff;
    border-color: var(--pink, #c4727f);
}
.civdp-btn-primary:hover {
    background: #a85a68;
    border-color: #a85a68;
    box-shadow: 0 4px 12px rgba(196, 114, 127, 0.3);
    transform: translateY(-1px);
}
.civdp-btn:focus-visible {
    outline: 2px solid var(--pink, #c4727f);
    outline-offset: 2px;
}

/* ── Mobile uyum ── */
@media (max-width: 480px) {
    .civdp-modal {
        max-width: 100%;
        border-radius: 18px 18px 0 0;
        margin-top: auto;
        animation: civdpSlideUp 0.28s cubic-bezier(0.34, 1.15, 0.64, 1);
    }
    @keyframes civdpSlideUp {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }
    .civdp-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .civdp-header { padding: 16px 14px 12px; }
    .civdp-title-month { font-size: 1.35rem; }
    .civdp-title-year { font-size: 1.05rem; }
    .civdp-weekdays { padding: 10px 12px 4px; }
    .civdp-days { padding: 4px 12px 16px; }
    .civdp-day {
        min-height: 44px;
        font-size: 0.92rem;
    }
    .civdp-footer { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
}

/* Reduced motion: animasyonları kaldır */
@media (prefers-reduced-motion: reduce) {
    .civdp-overlay,
    .civdp-modal,
    .civdp-day {
        animation: none !important;
        transition: none !important;
    }
}
