/* ========================================
   WOOCOMMERCE CHECKOUT STYLES
   Стили для страницы оформления заказа
======================================== */

.woocommerce-notices-wrapper {
    display: none !important;
}

/* === CHECKOUT PAGE LAYOUT === */
.woocommerce-checkout {
    background: url('../img/bgw.png') repeat, linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
    min-height: 100vh;
}

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* === CHECKOUT HEADER === */
.checkout-header {
    text-align: center;
    margin-bottom: 2rem;
}

.checkout-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color, #2563eb), var(--primary-dark, #1d4ed8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.checkout-header p {
    color: var(--text-secondary, #64748b);
    font-size: 1.125rem;
    margin: 0;
}

/* === PROGRESS INDICATOR === */
.checkout-progress {
    margin-bottom: 3rem;
    display: block;
}

.progress-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--border-radius-pill);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius-pill, 500px);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.progress-step.active {
    background: var(--primary-color, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.progress-step:not(.active) {
    background: var(--light-bg, #f8fafc);
    color: var(--text-secondary, #64748b);
}

.progress-step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.progress-step.active .progress-step-number {
    background: white;
    color: var(--primary-color, #2563eb);
}

.progress-step:not(.active) .progress-step-number {
    background: white;
    color: var(--text-secondary, #64748b);
}

.progress-line {
    width: 60px;
    height: 3px;
    background: var(--border-color, #e2e8f0);
    border-radius: var(--border-radius-pill, 500px);
}

/* === FORM LAYOUT === */
.woocommerce form.checkout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2.5rem;
    align-items: start;
}

.checkout-form-wrapper {
    display: contents;
}

/* Hide unnecessary sections for simplified checkout */
#customer_details,
#order_review {
    display: none !important;
}

/* Center the payment panel on the page */
.checkout-payment-panel {
    margin: 2rem auto;
    max-width: 600px;
    text-align: center;
}

/* Main checkout title */
.checkout-main-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 2rem;
}

/* === BILLING FORM === */

.checkout-billing-form h2,
.woocommerce-billing-fields h3 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkout-billing-form h2::before,
.woocommerce-billing-fields h3::before {
    content: '📝';
    font-size: 1.25rem;
}

/* === ORDER REVIEW === */
.checkout-order-section {
    grid-column: 2;
}

.checkout-order-review {
    background: white;
    border-radius: var(--border-radius, 16px);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    border: 1px solid var(--border-color, #e2e8f0);
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.checkout-order-review h3 {
    color: var(--text-primary, #1e293b);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid var(--light-bg, #f8fafc);
    padding-bottom: 1rem;
}

.checkout-order-review h3::before {
    content: '📋';
    font-size: 1.25rem;
}

/* === ORDER TABLE === */

/* === MINIMALIST & MODERN ORDER TABLE === */
.woocommerce-checkout-review-order-table {
    width: 100%;
    margin-bottom: 2rem;
    background: #fff;
    border-radius: var(--border-radius, 16px);
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    font-size: 1rem;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 1.1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    background: none;
    font-size: 1rem;
    vertical-align: middle;
    transition: background 0.2s;
}

.woocommerce-checkout-review-order-table th {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    background: var(--card-bg, #f6f8fa);
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.97rem;
}

.woocommerce-checkout-review-order-table tr:last-child th,
.woocommerce-checkout-review-order-table tr:last-child td {
    border-bottom: none;
}

.woocommerce-checkout-review-order-table .cart_item td {
    color: var(--text-primary, #1e293b);
    background: none;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.woocommerce-checkout-review-order-table .cart_item .product-name {
    font-weight: 500;
    color: var(--text-primary, #1e293b);
}

.woocommerce-checkout-review-order-table .cart_item:hover td {
    background: var(--secondary-color, #f3f6fa);
}

.woocommerce-checkout-review-order-table .cart-subtotal th,
.woocommerce-checkout-review-order-table .cart-subtotal td {
    color: var(--text-secondary, #64748b);
    font-weight: 500;
    background: var(--light-bg, #f9fafb);
}

.woocommerce-checkout-review-order-table .cart-discount th,
.woocommerce-checkout-review-order-table .cart-discount td {
    color: var(--primary-color, #2563eb);
    background: #f0f6ff;
    font-weight: 500;
}

.woocommerce-checkout-review-order-table .fee th,
.woocommerce-checkout-review-order-table .fee td {
    color: var(--text-secondary, #64748b);
    background: #f9fafb;
}

.woocommerce-checkout-review-order-table .tax-rate th,
.woocommerce-checkout-review-order-table .tax-rate td,
.woocommerce-checkout-review-order-table .tax-total th,
.woocommerce-checkout-review-order-table .tax-total td {
    color: var(--text-secondary, #64748b);
    background: #f9fafb;
    font-size: 0.97rem;
}

.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    background: linear-gradient(90deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1d4ed8) 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: none;
    border-radius: 0 0 0 0;
    box-shadow: 0 2px 8px rgba(37,99,235,0.07);
}

.woocommerce-checkout-review-order-table .order-total td {
    text-align: right;
}

.woocommerce-checkout-review-order-table .product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.woocommerce-checkout-review-order-table .product-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f6fa;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(30,41,59,0.06);
}
.woocommerce-checkout-review-order-table .product-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.woocommerce-checkout-review-order-table .product-title {
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    font-size: 1rem;
}
.woocommerce-checkout-review-order-table .product-quantity {
    color: var(--text-secondary, #64748b);
    font-size: 0.95rem;
}
.woocommerce-checkout-review-order-table .amount {
    font-weight: 600;
    color: var(#fff, #2563eb);
    font-size: 1rem;
}

/* Remove table borders for a cleaner look */
.woocommerce-checkout-review-order-table,
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    border-left: none;
    border-right: none;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .woocommerce-checkout-review-order-table th,
    .woocommerce-checkout-review-order-table td {
        padding: 0.8rem 0.5rem;
        font-size: 0.95rem;
    }
    .woocommerce-checkout-review-order-table .product-thumbnail {
        width: 36px;
        height: 36px;
    }
}
@media (max-width: 480px) {
    .woocommerce-checkout-review-order-table th,
    .woocommerce-checkout-review-order-table td {
        padding: 0.6rem 0.3rem;
        font-size: 0.92rem;
    }
    .woocommerce-checkout-review-order-table .product-info {
        gap: 0.5rem;
    }
}

/* === PAYMENT METHODS === */
.woocommerce-checkout-payment {
    background: white !important;
    margin-top: 0.5rem;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    border-radius: 25px !important;
    padding: 1.5rem 1.5rem 1.5rem 1.5rem !important;
}

/* --- Custom layout: big centered product title above payment area --- */
.checkout-payment-panel {
    margin-bottom: 1rem;
}
.checkout-product-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 2rem 0 3rem 0;
    word-break: break-word;
}

/* Product title row: title left/center and small clear button to the right */
.checkout-product-title-row {
    display: flex;
    align-items: center;
    justify-content: center; /* default center */
    gap: 0.75rem;
}
.checkout-product-title-row .checkout-product-title {
    text-align: center;
}
.checkout-clear-cart-inline {
    margin-left: auto; /* push to right in wide layout */
}

/* Clear cart button below place order */
.checkout-clear-cart-below {
    text-align: center;
    margin-top: 1rem;
}
.checkout-clear-cart-below .wc-empty-cart-button-small {
    display: inline-block;
    margin: 0 auto;
}

/* Small inline empty cart button */
.wc-empty-cart-button-small {
    background: transparent;
    color: var(--text-secondary, #64748b);
    border: 1px solid rgba(99, 102, 241, 0.08);
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.wc-empty-cart-button-small:before {
    content: '🗑️';
    font-size: 0.9rem;
}
.wc-empty-cart-button-small:hover {
    background: rgba(37,99,235,0.05);
    color: #1e293b;
}

/* Responsive adjustments: on small screens, put clear button after title centered */
@media (max-width: 576px) {
    .checkout-product-title-row {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }
    .checkout-clear-cart-inline {
        margin-left: 0;
    }
}

/* Compact payment methods: show small icons and condensed labels */
.wc_payment_methods {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.wc_payment_methods .wc_payment_method {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    min-width: 80px;
}
.wc_payment_methods .wc_payment_method > label {
    padding: 0.25rem 0.4rem;
    font-size: 1.2rem;
}
.wc_payment_methods .payment-icon img {
    max-height: 16px;
    max-width: 30px;
    display: block;
}

/* Ensure payment_box (description) spans full width under the selected method */
.wc_payment_method .payment_box {
    order: 99;
    width: 100%;
}

/* Place order button adjustments to sit clearly under payment methods */
.woocommerce-checkout-payment .form-row.place-order {
    text-align: center;
}
.woocommerce-checkout-payment .form-row.place-order .button {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* Mobile: stack payment methods full width */
@media (max-width: 576px) {
    .wc_payment_methods {
        flex-direction: column;
        align-items: center;
    }
    .wc_payment_methods .wc_payment_method {
        width: 100%;
        max-width: 200px;
    }
    .checkout-product-title {
        font-size: 2rem;
        margin: 1.5rem 0 2rem 0;
    }
}

.woocommerce-checkout-payment h3 {
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.woocommerce-checkout-payment h3::before {
    content: '💳';
    font-size: 1rem;
}

.wc_payment_methods {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wc_payment_method {
    margin-bottom: 0;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center; /* vertically center radio and label */
    gap: 0.5rem;
    padding: 0 0.5rem; /* small horizontal padding so items don't touch edges */
    flex-wrap: wrap; /* allow children (payment_box) to wrap to next line */
}

.wc_payment_method::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(59, 130, 246, 0.01) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wc_payment_method:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.wc_payment_method:hover::before {
    opacity: 1;
}

.wc_payment_method > label {
    display: block;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    transition: color 0.2s ease;
    font-size: 0.9rem;
}

.wc_payment_method > input[type="radio"] {
    order: -1;
    margin-right: 0.75rem;
    margin-left: 0;
    transform: scale(1);
    accent-color: #2563eb;
    transition: transform 0.2s ease;
    align-self: center;
}

.wc_payment_method > input[type="radio"]:checked {
    transform: scale(1.1);
}

.wc_payment_method > label .payment-icon {
    margin-left: auto;
    margin-right: 0;
    opacity: 0.8;
    transition: all 0.2s ease;
    filter: grayscale(20%);
}

.wc_payment_method:hover .payment-icon {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.02);
}

.wc_payment_method .payment-icon img {
    max-height: 20px;
    width: auto;
    border-radius: 3px;
}

/* Ensure the label uses remaining space and radio sits to the left */
.wc_payment_method > label {
    flex: 1 1 auto;
    margin: 0; /* label padding handled inside label itself */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Make payment box full width below the row and force BACS to its own line */
.wc_payment_method .payment_box {
    background: #f7f7f7 !important;
    width: 100%;
    margin-top: 0.5rem;
    display: block;
    flex-basis: 100%;
    order: 99; /* default order to place after the main row */
    align-self: stretch;
    padding: 0.75rem 1rem;
    border-top: 1px solid #f7f7f7 !important;
    background: transparent;
    font-size: 0.85rem !important;
}

#add_payment_method #payment div.payment_box::before, .woocommerce-cart #payment div.payment_box::before, .woocommerce-checkout #payment div.payment_box::before {
        content: "";
    display: block;
    border: 1em solid #f7f7f7;
    border-right-color: transparent;
    border-left-color: transparent;
    border-top-color: transparent;
    position: absolute;
    top: -.75em;
    left: 0;
    margin: -1em 0 0 2em;
}

/* Specific targeting for BACS (in case markup uses class on li or wrapper) */
.payment_method_bacs .payment_box,
.wc_payment_method.payment_method_bacs .payment_box {
    order: 99; /* ensure BACS box comes after the label/radio */
    flex-basis: 100%;
    width: 100%;
    display: block;
    align-self: stretch;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #eef2f7;
    background: transparent;
}

/* Tweak input placement when rendered outside the label (safeguard) */
.wc_payment_method > input[type="radio"] {
    margin: 0 0.5rem 0 0.25rem;
    align-self: center;
}

.wc_payment_method.payment_method_selected {
    border-color: #2563eb;
    background: #f0f9ff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
    transform: translateY(0);
}

.wc_payment_method.payment_method_selected::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
}

.wc_payment_method.payment_method_selected .payment-icon {
    opacity: 1;
    filter: grayscale(0%);
}

/* Анимированный индикатор выбора */
.wc_payment_method.payment_method_selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    color: #2563eb;
    font-size: 1rem;
    font-weight: bold;
    opacity: 0;
    animation: checkmark 0.3s ease forwards;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* === PLACE ORDER BUTTON === */
.woocommerce #place_order {
    width: 100%;
    background: #ffffff !important;
    color: #00b10e !important;
    border: 2px solid #00b10e !important;
    border-radius: 500px !important;
    padding: 1.25rem 2rem !important;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    white-space: nowrap !important;
    min-height: 60px;
}

.woocommerce #place_order:hover {
    background: #00b10e !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 177, 14, 0.2);
}

.woocommerce #place_order::before {
    display: none;
}

.woocommerce #place_order::after {
    content: '';
    width: 22px;
    height: 22px;
    background: url('../img/sberbank-logo.svg') no-repeat center center;
    background-size: contain;
    order: -1;
    position: relative;
    z-index: 1;
    transition: filter 0.3s ease;
}

.woocommerce #place_order:hover::after {
    filter: brightness(0) invert(1);
}

.woocommerce #place_order:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.woocommerce #place_order:active {
    transform: translateY(0);
}

.woocommerce-error::before, .woocommerce-info::before, .woocommerce-message::before {
    position: static !important;
}

/* === SECURITY INFO === */
.checkout-security-info {
    max-width: 600px;
    margin: 1.5rem auto 2rem auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05), rgba(5, 150, 105, 0.02));
    border-radius: 25px;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.security-info-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.security-info-header .icon {
    font-size: 1.5rem;
}

.security-info-header h4 {
    color: var(--success-color, #059669);
    font-weight: 600;
    margin: 0;
}

.security-info-text {
    color: var(--text-secondary, #64748b);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* === NOTIFICATIONS === */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: none;
    font-weight: 500;
}

.woocommerce-message {
    background: #f0fdf4;
    color: #059669;
    border-left: 3px solid #059669;
}

.woocommerce-error {
    background: #fef2f2;
    color: #dc2626;
    border-left: 3px solid #dc2626;
}

.woocommerce-info {
    background: #f8fafc;
    color: #2563eb;
    border-left: 3px solid #2563eb;
}

/* === CHECKOUT UX HELPERS === */
.checkout-container {
    opacity: 0;
}

.woocommerce-checkout input.error {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.woocommerce-checkout .error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.spinner-border {
    width: 1rem;
    height: 1rem;
}

@keyframes checkout-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.payment_method_selected {
    animation: checkout-pulse 0.3s ease;
}


.woocommerce-order-received .thankyou-check-icon {
    font-size: 4rem;
}

.woocommerce-order-received .success-icon {
    animation: qstre-checkmark 0.8s ease-in-out;
}

@keyframes qstre-checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.woocommerce-order-received .order-items .border {
    transition: all 0.3s ease;
}

.woocommerce-order-received .order-items .border:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.woocommerce-order-received .btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.woocommerce-order-received .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.custom-error-message,
.duplicate-order-notice,
.checkout-error-notice {
    background: #fff3cd !important;
    border: 1px solid #ffeaa7 !important;
    border-left: 4px solid #f39c12 !important;
    color: #856404 !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    margin: 1rem 0 !important;
}

/* === EMPTY CART BUTTON === */
.wc-empty-cart-button {
    background: var(--danger-color, #dc2626) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.wc-empty-cart-button:before {
    content: '🗑️';
    font-size: 0.875rem;
}

.wc-empty-cart-button:hover {
    background: #b91c1c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

/* === PAYMENT METHODS IMPROVEMENTS === */
/* Упрощенные стили уже применены выше */

/* === CHECKOUT CONTAINER IMPROVEMENTS === */
.checkout-container {
    opacity: 1 !important;
}

.checkout-breadcrumb .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.checkout-progress .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === HIDDEN EMAIL FIELD === */
.form-row.hidden,
.form-row .hidden,
label.hidden {
    display: none !important;
}

/* === WOOCOMMERCE BILLING FIELDS === */
.woocommerce-billing-fields > h3,
.woocommerce-billing-fields > .woocommerce-billing-fields__field-wrapper:empty {
    display: none !important;
}

.woocommerce-billing-fields {
    margin-bottom: 0 !important;
}

/* === TERMS AND CONDITIONS === */
.woocommerce-terms-and-conditions-wrapper {
    margin: 0 0 1rem 0;
    padding: 1rem;
    background: var(--light-bg, #f8fafc);
    border-radius: 25px;
    border: 1px solid var(--border-color, #e2e8f0);
}

.woocommerce-privacy-policy-text {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    margin: 0;
}

.woocommerce-privacy-policy-text a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-privacy-policy-text a:hover {
    text-decoration: underline;
}

.woocommerce-privacy-policy-text p {
    margin-bottom: 0;
}


/* === RESPONSIVE DESIGN === */
@media (max-width: 1200px) {
    .woocommerce form.checkout {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .checkout-container {
        padding: 1rem 0.75rem;
    }

    .checkout-header {
        margin-bottom: 1.5rem;
    }

    .checkout-progress {
        margin-bottom: 2rem;
    }

    .checkout-main-title {
        margin-bottom: 1.5rem;
    }
    
    .checkout-header h1 {
        font-size: 2rem;
    }
    
    .col2-set,
    .checkout-order-review {
        padding: 1.5rem;
    }
    
    .progress-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-line {
        width: 2px;
        height: 30px;
    }
    
    .no-payment-methods-message {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .no-payment-methods-message .message-icon {
        font-size: 1.5rem;
        align-self: center;
    }
}

@media (max-width: 480px) {
    .checkout-container {
        padding: 1rem 0.5rem;
    }
    
    .checkout-header h1 {
        font-size: 1.75rem;
    }
    
    .checkout-billing-form,
    .checkout-order-review {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .progress-step {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .woocommerce form .form-row input,
    .woocommerce form .form-row select,
    .woocommerce form .form-row textarea {
        padding: 0.875rem 1rem;
    }
}

/* === LOADING STATES === */

#customer_details {
    display: none;
}

.woocommerce-checkout.processing {
    position: relative;
}

.woocommerce-checkout.processing::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woocommerce-checkout.processing::after {
    content: 'Обработка заказа...';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
}

/* === NO PAYMENT METHODS MESSAGE === */
.no-payment-methods-message {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    margin: 1rem 0;
}

.no-payment-methods-message .message-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.no-payment-methods-message .message-content {
    flex: 1;
}

.no-payment-methods-message h4 {
    color: var(--primary-color, #2563eb);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.no-payment-methods-message p {
    color: var(--text-secondary, #64748b);
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.no-payment-methods-message .contact-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #e2e8f0);
    margin-top: 1.5rem;
}

.no-payment-methods-message .contact-info p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.no-payment-methods-message .contact-info a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.no-payment-methods-message .contact-info a:hover {
    text-decoration: underline;
}

/* === LAYOUT FIXES === */
.woocommerce-checkout-wrapper {
    background: var(--light-bg, #f8fafc);
    min-height: 100vh;
    padding: 2rem 0;
}

/* === CHECKOUT SECTIONS === */


#checkout_columns {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

#checkout_columns .col-1 {
    flex: 1;
}

#checkout_columns .col-2 {
    flex: 2;
    background: white;

}

.checkout-order-section {
    width: 100%;
}

/* === SIMPLE ORDER REVIEW === */
.order-review-simple {
    font-size: 0.95rem;
}

.order-items {
    margin-bottom: 1.5rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.order-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
    margin-right: 1rem;
}

.item-name {
    font-weight: 700;
    color: #1e293b;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.item-quantity {
    color: #64748b;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.item-price {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.order-totals {
    border-top: 2px solid #e2e8f0;
    padding-top: 1rem;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.totals-row.subtotal {
    display: none;
}

.totals-row.discount {
    color: #059669;
}

.totals-row.fee {
    color: #dc2626;
}

.totals-row.tax {
    color: #7c3aed;
}

.totals-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.totals-row .label {
    font-weight: 500;
}

.totals-row .amount {
    font-weight: 600;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .item-info {
        margin-right: 0;
    }

    .item-price {
        align-self: flex-end;
    }

    .wc_payment_method {
        margin-bottom: 0.25rem;
    }

    .wc_payment_method label {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }

    .wc_payment_method .payment-icon img {
        max-height: 18px;
    }

    .woocommerce-checkout-payment {
        padding: 1.25rem;
    }

    .woocommerce-checkout-payment h3 {
        font-size: 0.95rem;
        margin-bottom: 0.625rem;
    }

    .woocommerce #place_order {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

/* === CLEAR CART BUTTON === */
.checkout-clear-cart .wc-empty-cart-button {
    background: var(--danger-color, #dc2626) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2) !important;
}

.checkout-clear-cart .wc-empty-cart-button:hover {
    background: #b91c1c !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
    text-decoration: none !important;
    color: white !important;
}

/* === MOBILE FIXES FOR GUEST LOGIN ON CHECKOUT === */
@media (max-width: 768px) {
    .woocommerce-checkout {
        overflow-x: hidden;
    }

    .woocommerce-checkout .checkout-progress {
        margin-bottom: 1.25rem;
        padding: 0; 
        width: 100%;
    }

    .woocommerce-checkout .checkout-progress .container {
        padding: 0 0.5rem;
        max-width: 100%;
        width: 100%;
    }

    .woocommerce-checkout .progress-wrapper {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.2rem;
        padding: 0.4rem;
        border-radius: 10px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        border: 1px solid rgba(0,0,0,0.05);
    }

    .woocommerce-checkout .progress-line {
        flex: 1 1 5px;
        max-width: 30px;
        height: 2px;
        min-width: 4px;
    }

    .woocommerce-checkout .progress-step {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
        gap: 0.25rem;
    }

    .woocommerce-checkout .progress-step-number {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    /* На совсем маленьких экранах скрываем текст неактивных шагов */
    @media (max-width: 400px) {
        .woocommerce-checkout .progress-step:not(.active) span:not(.progress-step-number) {
            display: none;
        }
        .woocommerce-checkout .progress-step {
            padding: 0.35rem;
        }
    }

    .woocommerce-checkout .login-page {
        padding: 0 0.75rem 1.25rem;
        background: transparent;
        align-items: flex-start;
    }

    .woocommerce-checkout .login-page .container {
        padding-left: 0;
        padding-right: 0;
    }

    .woocommerce-checkout .login-card {
        padding: 1.1rem;
        max-width: 100%;
        overflow: hidden;
    }

    .woocommerce-checkout .login-card .input-group {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
    }

    .woocommerce-checkout .login-card .form-control {
        min-width: 0;
        font-size: 16px;
        max-width: 100%;
    }

    .woocommerce-checkout .login-card .input-group-text,
    .woocommerce-checkout .login-card #togglePassword {
        min-width: 44px;
        justify-content: center;
    }

    .woocommerce-checkout #loginForm .row {
        margin-left: 0;
        margin-right: 0;
    }

    .woocommerce-checkout #loginForm .row > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .woocommerce-checkout .login-card {
        border-radius: 16px;
        padding: 1rem;
    }

    .woocommerce-checkout .login-header h1 {
        font-size: 1.8rem;
    }

    .woocommerce-checkout .login-header p {
        font-size: 0.85rem;
    }

    .woocommerce-checkout .progress-step {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
    }

    .woocommerce-checkout .progress-step-number {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
}

/* === FINAL CHECKOUT LAYOUT (ONE COLUMN) === */
.woocommerce-checkout .checkout-progress .container,
.woocommerce-checkout form.checkout,
.woocommerce-checkout .checkout-security-info {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.woocommerce-checkout form.checkout {
    display: block;
    width: 100%;
}

.woocommerce-checkout #checkout_columns {
    display: block;
    margin: 0;
}

.woocommerce-checkout #checkout_columns .col-1,
.woocommerce-checkout #checkout_columns .col-2 {
    width: 100%;
    flex: none;
}

.woocommerce-checkout .checkout-main-title {
    margin: 1rem 0 1rem;
    font-size: 2rem;
}

.woocommerce-checkout .checkout-payment-panel {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.woocommerce-checkout .checkout-product-title {
    font-size: 2.1rem;
    margin: 0.5rem 0 1.5rem;
}

.woocommerce-checkout .woocommerce-checkout-payment {
    margin: 0 auto;
}

.woocommerce-checkout .checkout-clear-cart-below {
    margin-top: 0.75rem;
}

.woocommerce-checkout .checkout-security-info {
    margin-top: 1rem;
}

@media (max-width: 992px) {
    .woocommerce-checkout .checkout-progress .container,
    .woocommerce-checkout form.checkout,
    .woocommerce-checkout .checkout-security-info {
        max-width: 680px;
    }

    .woocommerce-checkout .checkout-product-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .woocommerce-checkout .checkout-progress .container,
    .woocommerce-checkout form.checkout,
    .woocommerce-checkout .checkout-security-info {
        max-width: 100%;
    }

    .woocommerce-checkout .checkout-main-title {
        font-size: 1.6rem;
        margin-top: 0.5rem;
    }

    .woocommerce-checkout .checkout-product-title {
        font-size: 1.4rem;
        margin: 0.25rem 0 1rem;
    }

    .woocommerce-checkout .woocommerce-checkout-payment,
    .woocommerce-checkout .checkout-security-info {
        max-width: 100%;
    }
}
