/**
 * Яндекс.Доставка — Стили для Bigzi
 *
 * @package Bigzi
 * @since 1.2.0
 */

/* Container */
.yandex-delivery {
    margin: 24px 0;
    font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.yandex-delivery__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: -0.01em;
}

.yandex-delivery__title svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.yandex-delivery__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #00A046;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Options */
.yandex-delivery__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yandex-delivery__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yandex-delivery__option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.yandex-delivery__option--selected {
    border-color: #00A046;
    background: #f0faf4;
}

.yandex-delivery__option--selected:hover {
    border-color: #00A046;
    background: #f0faf4;
}

.yandex-delivery__option--error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    animation: yandex-shake 0.5s ease;
}

@keyframes yandex-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.yandex-delivery__option-info {
    flex: 1;
    min-width: 0;
}

.yandex-delivery__option-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
}

.yandex-delivery__option-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    margin-top: 2px;
}

.yandex-delivery__option-price {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
}

/* Loading */
.yandex-delivery__loading {
    display: none;
    padding: 24px;
    text-align: center;
}

.yandex-delivery__spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    border: 3px solid #e2e8f0;
    border-top-color: #00A046;
    border-radius: 50%;
    animation: yandex-spin 0.8s linear infinite;
}

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

.yandex-delivery__loading-text {
    font-size: 13px;
    color: #64748b;
}

/* Error */
.yandex-delivery__error {
    display: none;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    text-align: center;
}

.yandex-delivery__error-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 8px;
    color: #ef4444;
}

.yandex-delivery__error-text {
    font-size: 13px;
    color: #991b1b;
    margin-bottom: 12px;
}

.yandex-delivery__retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yandex-delivery__retry:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

/* Notice */
.yandex-delivery__notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.yandex-delivery__notice svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #94a3b8;
}

/* PVZ Button */
.yandex-delivery__pvz-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 14px;
    background: #00A046;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yandex-delivery__pvz-btn:hover {
    background: #008c3c;
}

.yandex-delivery__pvz-btn--change {
    background: transparent;
    color: #00A046;
    padding: 4px 8px;
    font-size: 12px;
}

.yandex-delivery__pvz-btn--change:hover {
    background: rgba(0, 160, 70, 0.08);
}

/* Selected PVZ */
.yandex-delivery__pvz-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 10px 12px;
    background: #f0faf4;
    border-radius: 8px;
}

.yandex-delivery__pvz-icon {
    width: 20px;
    height: 20px;
    color: #00A046;
    flex-shrink: 0;
}

.yandex-delivery__pvz-info {
    flex: 1;
    min-width: 0;
}

.yandex-delivery__pvz-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.3;
}

.yandex-delivery__pvz-address {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
    margin-top: 2px;
}

/* PVZ Modal */
.yandex-pvz-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.yandex-pvz-modal__backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.yandex-pvz-modal__content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.yandex-pvz-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.yandex-pvz-modal__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.yandex-pvz-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yandex-pvz-modal__close:hover {
    background: #f1f5f9;
    color: #1a1a2e;
}

.yandex-pvz-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Search */
.yandex-pvz-modal__search {
    position: relative;
    padding: 12px 24px 16px;
}

.yandex-pvz-modal__search-icon {
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.yandex-pvz-modal__search-input,
.woocommerce-checkout input.yandex-pvz-modal__search-input[type="text"] {
    width: 100%;
    padding: 14px 40px 14px 60px !important;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1a1a2e;
    background: #f8fafc;
    transition: all 0.2s ease;
    outline: none;
}

.yandex-pvz-modal__search-input:focus {
    border-color: #00A046;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 160, 70, 0.1);
}

.yandex-pvz-modal__search-input::placeholder {
    color: #94a3b8;
}

.yandex-pvz-modal__search-clear {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yandex-pvz-modal__search-clear:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* PVZ Loading/Empty */
.yandex-pvz-modal__loading,
.yandex-pvz-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.yandex-pvz-modal__loading .yandex-delivery__spinner {
    margin-bottom: 16px;
}

.yandex-pvz-modal__no-results {
    text-align: center;
    padding: 40px 20px;
}

.yandex-pvz-modal__no-results p,
.yandex-pvz-modal__empty p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* PVZ List */
.yandex-pvz-modal__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yandex-pvz-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.yandex-pvz-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.yandex-pvz-item--selected {
    border-color: #00A046;
    background: rgba(0, 160, 70, 0.03);
}

.yandex-pvz-item__info {
    flex: 1;
    min-width: 0;
}

.yandex-pvz-item__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 4px;
}

.yandex-pvz-item__distance {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #f0faf4;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #00A046;
    white-space: nowrap;
}

.yandex-pvz-item__address {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 6px;
}

.yandex-pvz-item__schedule {
    font-size: 12px;
    color: #475569;
}

.yandex-pvz-item__check {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #00A046;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.yandex-pvz-item--selected .yandex-pvz-item__check {
    opacity: 1;
}

/* Mobile */
@media (max-width: 600px) {
    .yandex-delivery__option {
        padding: 14px;
    }
    .yandex-delivery__option-name {
        font-size: 13px;
    }
    .yandex-delivery__option-desc {
        font-size: 12px;
    }
    .yandex-delivery__option-price {
        font-size: 13px;
    }
    .yandex-pvz-modal {
        padding: 0;
        align-items: flex-end;
    }
    .yandex-pvz-modal__content {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
    }
    .yandex-pvz-modal__header {
        padding: 16px 20px;
    }
    .yandex-pvz-modal__header h3 {
        font-size: 16px;
    }
    .yandex-pvz-modal__body {
        padding: 12px;
    }
    .yandex-pvz-item {
        padding: 12px 14px;
    }
    .yandex-pvz-item__name {
        font-size: 13px;
    }
    .yandex-pvz-item__address {
        font-size: 12px;
    }
}

/* Body lock when modal open */
body.yandex-pvz-modal-open {
    overflow: hidden;
}

/* City select */
.yandex-delivery__city-select {
    margin-bottom: 20px;
}
.yandex-delivery__city-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.yandex-delivery__city-wrapper {
    position: relative;
}
.yandex-delivery__city-input {
    width: 100%;
    padding: 14px !important;
    font-size: 15px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #F9FAFB;
    transition: border-color 0.2s, background-color 0.2s;
    box-sizing: border-box;
}
.yandex-delivery__city-input:focus {
    outline: none;
    border-color: #0DB14B;
    background: #fff;
}

/* PVZ section */
.yandex-delivery__pvz-section {
    margin-top: 4px;
}
.yandex-delivery__pvz-btn--main {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #0DB14B;
    background: #F0FDF4;
    border: 2px dashed #BBF7D0;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.yandex-delivery__pvz-btn--main:hover {
    background: #DCFCE7;
    border-color: #86EFAC;
}
.yandex-delivery__pvz-btn--main svg {
    flex-shrink: 0;
    color: #0DB14B;
}
.yandex-delivery__pvz-prompt--error .yandex-delivery__pvz-btn--main {
    border-color: #FCA5A5;
    background: #FEF2F2;
    color: #DC2626;
    animation: shake 0.4s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Selected PVZ card */
.yandex-delivery__pvz-selected-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
}
.yandex-delivery__pvz-card-icon {
    flex-shrink: 0;
    color: #0DB14B;
}
.yandex-delivery__pvz-card-info {
    flex: 1;
    min-width: 0;
}
.yandex-delivery__pvz-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #040507;
    margin-bottom: 2px;
}
.yandex-delivery__pvz-card-address {
    font-size: 13px;
    color: #6B7280;
}
.yandex-delivery__pvz-btn--change {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #0DB14B;
    background: #fff;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.yandex-delivery__pvz-btn--change:hover {
    background: #DCFCE7;
}

/* Price row */
.yandex-delivery__price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 10px;
}
.yandex-delivery__price-label {
    font-size: 14px;
    color: #6B7280;
}
.yandex-delivery__price-value {
    font-size: 16px;
    font-weight: 700;
    color: #040507;
}
