/* ========================================
   Checkout Page - Custom Styles
   Царский Сон - OctoberCMS
   ======================================== */

/* ========================================
   Breadcrumbs
   ======================================== */
.breadcrumb-nav {
    padding: 1rem 0;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-link {
    font-size: 0.875rem;
    color: #6b7280;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #C9A961;
}

.breadcrumb-separator {
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

.breadcrumb-current {
    font-size: 0.875rem;
    color: #2E1500;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2rem;
    color: #2E1500;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.page-subtitle {
    color: rgba(46, 21, 0, 0.6);
    font-size: 1rem;
}

/* ========================================
   Checkout Grid
   ======================================== */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .checkout-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* ========================================
   Checkout Section
   ======================================== */
.checkout-section {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .checkout-section {
        padding: 2rem;
    }
}

.checkout-section:hover .section-border-accent {
    opacity: 1;
}

.section-border-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #C9A961 0%, #A88B4D 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.section-header {
    position: relative;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    color: #2E1500;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.section-underline {
    height: 2px;
    width: 4rem;
    background: linear-gradient(to right, #C9A961 0%, transparent 100%);
    margin-top: 0.5rem;
}

/* ========================================
   Form Elements
   ======================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.875rem;
    color: rgba(46, 21, 0, 0.7);
    margin-bottom: 0.5rem;
    display: block;
}

.required {
    color: #C9A961;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: #2E1500;
    background: white;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #C9A961;
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========================================
   Delivery Methods
   ======================================== */
.delivery-methods {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .delivery-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}

.delivery-method-btn {
    position: relative;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.delivery-method-btn:hover {
    border-color: rgba(201, 169, 97, 0.3);
}

.delivery-method-btn.active {
    border-color: #C9A961;
    background: linear-gradient(to bottom right, rgba(201, 169, 97, 0.05) 0%, transparent 100%);
}

.method-check-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(to bottom right, #C9A961 0%, #A88B4D 100%);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.delivery-method-btn.active .method-check-badge {
    opacity: 1;
}

.method-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 0;
    transition: all 0.3s ease;
}

.delivery-method-btn.active .method-icon {
    background: linear-gradient(to bottom right, #C9A961 0%, #A88B4D 100%);
}

.method-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: rgba(46, 21, 0, 0.6);
    transition: color 0.3s ease;
}

.delivery-method-btn.active .method-icon svg {
    color: white;
}

.method-info {
    flex: 1;
}

.method-title {
    font-size: 1rem;
    color: #2E1500;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

.method-price {
    font-size: 0.875rem;
    color: rgba(46, 21, 0, 0.6);
}

.method-time {
    font-size: 0.75rem;
    color: rgba(46, 21, 0, 0.5);
    margin-top: 0.25rem;
}

/* ========================================
   Delivery Address Form
   ======================================== */
.delivery-address-form {
    padding: 1.5rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    transition: all 0.3s ease;
}

.delivery-address-form.hidden {
    display: none;
}

.address-form-title {
    font-size: 1rem;
    color: #2E1500;
    margin-bottom: 1rem;
    font-weight: 400;
}

/* ========================================
   Pickup Stores List
   ======================================== */
.pickup-stores-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pickup-stores-list.hidden {
    display: none;
}

.stores-list-title {
    font-size: 1rem;
    color: #2E1500;
    margin-bottom: 1rem;
    font-weight: 400;
}

.store-option-item {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.store-option-item:hover {
    border-color: rgba(201, 169, 97, 0.3);
}

.store-option-item.active {
    border-color: #C9A961;
    background: linear-gradient(to bottom right, rgba(201, 169, 97, 0.05) 0%, transparent 100%);
}

.store-option-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.store-option-item.active .store-option-icon {
    background: linear-gradient(to bottom right, #C9A961 0%, #A88B4D 100%);
}

.store-option-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(46, 21, 0, 0.6);
    transition: color 0.3s ease;
}

.store-option-item.active .store-option-icon svg {
    color: white;
}

.store-option-name {
    font-size: 1rem;
    color: #2E1500;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

.store-option-address {
    font-size: 0.875rem;
    color: rgba(46, 21, 0, 0.6);
    margin-bottom: 0.25rem;
}

.store-option-hours {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: rgba(46, 21, 0, 0.5);
}

.store-option-hours svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ========================================
   Payment Methods
   ======================================== */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-method-btn {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.payment-method-btn:hover {
    border-color: rgba(201, 169, 97, 0.3);
}

.payment-method-btn.active {
    border-color: #C9A961;
    background: linear-gradient(to bottom right, rgba(201, 169, 97, 0.05) 0%, transparent 100%);
}

.payment-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 0;
    transition: all 0.3s ease;
}

.payment-method-btn.active .payment-icon {
    background: linear-gradient(to bottom right, #C9A961 0%, #A88B4D 100%);
}

.payment-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: rgba(46, 21, 0, 0.6);
    transition: color 0.3s ease;
}

.payment-method-btn.active .payment-icon svg {
    color: white;
}

.payment-info {
    flex: 1;
}

.payment-title {
    font-size: 1rem;
    color: #2E1500;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

.payment-desc {
    font-size: 0.875rem;
    color: rgba(46, 21, 0, 0.6);
}

.payment-check-badge {
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(to bottom right, #C9A961 0%, #A88B4D 100%);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.payment-method-btn.active .payment-check-badge {
    opacity: 1;
}

/* ========================================
   Order Summary
   ======================================== */
.order-summary {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    position: sticky;
    top: 6rem;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.order-item-lk {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.item-image {
    width: 4rem;
    height: 4rem;
    background: #f3f4f6;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0;
}

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

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

.item-name {
    font-size: 0.875rem;
    color: #2E1500;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.item-quantity {
    color: rgba(46, 21, 0, 0.6);
}

.item-price {
    color: #2E1500;
    font-weight: 500;
}

.order-separator {
    height: 1px;
    background: linear-gradient(to right, transparent 0%, rgba(201, 169, 97, 0.2) 50%, transparent 100%);
    margin: 1.5rem 0;
}

.order-totals {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-row:last-child {
    font-size: 1rem;
    font-weight: 500;
}

#totalAmount {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2E1500;
}

/* ========================================
   Terms Agreement
   ======================================== */
.terms-agreement {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.terms-checkbox {
    margin-top: 0.125rem;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: #C9A961;
}

.terms-label {
    font-size: 0.875rem;
    color: rgba(46, 21, 0, 0.7);
    cursor: pointer;
    line-height: 1.4;
}

.terms-link {
    text-decoration: underline;
    transition: color 0.3s ease;
}

.terms-link:hover {
    color: #C9A961;
}

/* ========================================
   Submit Button
   ======================================== */
.submit-order-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(to right, #C9A961 0%, #A88B4D 100%);
    color: white;
    border: none;
    border-radius: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.submit-order-btn:hover {
    background: linear-gradient(to right, #A88B4D 0%, #C9A961 100%);
}

.submit-order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-order-btn:disabled:hover {
    background: linear-gradient(to right, #C9A961 0%, #A88B4D 100%);
}

.submit-btn-content {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-arrow {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.submit-order-btn:hover .submit-arrow {
    transform: translateX(0.25rem);
}

.submit-btn-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.submit-order-btn:hover .submit-btn-overlay {
    transform: translateY(0);
}

/* ========================================
   Security Notice
   ======================================== */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(46, 21, 0, 0.5);
    margin-top: 1rem;
}

.security-icon {
    width: 1rem;
    height: 1rem;
    border: 1px solid rgba(201, 169, 97, 0.3);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.security-icon-inner {
    width: 0.5rem;
    height: 0.5rem;
    background: rgba(201, 169, 97, 0.3);
    border-radius: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1023px) {
    .order-summary {
        position: relative;
        top: 0;
    }
}

@media (max-width: 767px) {
    .checkout-section {
        padding: 1.25rem;
    }

    .delivery-methods {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.125rem;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delivery-address-form,
.pickup-stores-list {
    animation: slideDown 0.3s ease;
}


/* Стили для переключателя ТК */
.placing-order__form-inputs-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.placing-order__form-radio {
    display: none;
}

.placing-order__form-radio-label {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.placing-order__form-radio-label:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.placing-order__form-radio:checked + .placing-order__form-radio-label {
    border-color: #f59e0b;
    background-color: #fffbeb;
    color: #92400e;
}

.placing-order__form-text {
    font-weight: 500;
    margin: 0;
}

/* Иконки для ТК */
.placing-order__form-radio-label::before {
    content: '';
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.placing-order__form-radio-label[for="delivery-cdek"]::before {
    background-image: url('/themes/demo/assets/images/cdek-icon.svg');
}

.placing-order__form-radio-label[for="delivery-yandex"]::before {
    background-image: url('/themes/demo/assets/images/yandex-delivery-icon.svg');
}

.placing-order__form-radio-label[for="delivery-dostavista"]::before {
    background-image: url('/themes/demo/assets/images/logo-opengraph-ru.png');
}

.delivery-type-option[for="door-to-door"]::before {
    background-image: url('/themes/demo/assets/images/logo-opengraph-ru.png');
}

.delivery-type-option[for="to-pvz"]::before {
    background-image: url('/themes/demo/assets/images/logo-opengraph-ru.png');
}

/* Кнопка расчета стоимости */
.calculate-delivery-btn {
    background-color: #f59e0b;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.calculate-delivery-btn:hover {
    background-color: #d97706;
}

.calculate-delivery-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Состояния загрузки */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

.border-gold {border:1px solid #C9A961}

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

/* ========================================
   Delivery Type Selector - Стилизация радио-кнопок
   ======================================== */

/* Основной контейнер для выбора ТК */
.delivery-type-selector .flex {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* Скрываем оригинальные радио-кнопки */
.delivery-type-selector .delivery-type-radio {
    display: none;
}

/* Стили для лейблов радио-кнопок */
.delivery-type-selector .delivery-type-option {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    position: relative;
}

.delivery-type-selector .delivery-type-option:hover {
    border-color: rgba(201, 169, 97, 0.3);
    background-color: #f9fafb;
}

.delivery-type-selector .delivery-type-radio:checked + .delivery-type-option {
    border-color: #C9A961;
    background: linear-gradient(to bottom right, rgba(201, 169, 97, 0.05) 0%, transparent 100%);
    color: #2E1500;
}

/* Стили для кружка выбора */
.delivery-type-selector .delivery-type-option .w-5 {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.delivery-type-selector .delivery-type-option .border-gold {
    border-color: #C9A961;
}

.delivery-type-selector .delivery-type-option .w-2\\.5 {
    width: 0.625rem;
    height: 0.625rem;
    background: #C9A961;
    border-radius: 50%;
}

/* Текст в лейблах */
.delivery-type-selector .delivery-type-option span {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: #2E1500;
    font-weight: 400;
    margin: 0;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .delivery-type-selector .flex {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .delivery-type-selector .delivery-type-option {
        padding: 12px 16px;
        width: 100%;
    }
}

/* Для сохранения существующих стилей и предотвращения конфликтов */
.delivery-type-option {
    transition: all 0.2s ease;
}

.delivery-type-option:hover {
    transform: translateY(-1px);
}


.delivery-type-radio:checked + .delivery-type-option {
    border-color: #f59e0b;
    background-color: #fffbeb;
    color: #92400e;
}



/* Адаптивные стили */
@media (max-width: 640px) {
    .delivery-type-selector .flex {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Стили для кнопки расчета до двери */
#doorDeliveryCalculateBtn {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.door-delivery-fields {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.select2-container--default .select2-selection--single { height:45px !important}
.select2-container .select2-selection--single .select2-selection__rendered { padding-top:7px !important}
.select2-container--default .select2-selection--single .select2-selection__arrow { height:45px !important}

/* Стили для неактивных опций */
.delivery-type-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.delivery-type-option.disabled span {
    color: #9ca3af;
}

/* Анимации для сообщений */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#doorOnlyMessage {
    animation: fadeIn 0.3s ease-out;
}