body {
    font-family: 'Inter', sans-serif;
}

/* Flex overflow fix - allows flex child to shrink below content width */
.min-w-0 {
    min-width: 0;
}

/* Catalog: filter sidebar - don't stretch to full height */
@media (min-width: 768px) {
    .md\:self-start {
        align-self: flex-start;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F5F1E8;
}
::-webkit-scrollbar-thumb {
    background: #D4735E;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C06550;
}

/* Checkout steps styling */
#step1.active,
#step2.active,
#step3.active {
    background-color: #D4735E;
    color: #ffffff;
}

#step1.completed,
#step2.completed,
#step3.completed {
    background-color: #10b981;
    color: #ffffff;
}

/* Checkout: базовые стили, если utility‑классы не срабатывают */
.checkout-wrapper input[type="text"],
.checkout-wrapper input[type="tel"],
.checkout-wrapper input[type="email"] {
    border: 1px solid #E5E5E5;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.checkout-wrapper button {
    border-radius: 9999px;
}

.checkout-wrapper #step1,
.checkout-wrapper #step2,
.checkout-wrapper #step3 {
    border-radius: 9999px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.checkout-wrapper #step2,
.checkout-wrapper #step3 {
    background-color: #E5E5E5;
    color: #666666;
}

/* active/completed должны перекрывать базовый стиль шагов */
.checkout-wrapper #step1.active,
.checkout-wrapper #step2.active,
.checkout-wrapper #step3.active {
    background-color: #D4735E !important;
    color: #ffffff !important;
}

.checkout-wrapper #step1.completed,
.checkout-wrapper #step2.completed,
.checkout-wrapper #step3.completed {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

/* Loading modal — центрирование и анимация спиннера */
.loading-modal {
    background: rgba(0, 0, 0, 0.5);
}

.loading-modal-content {
    flex-shrink: 0;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    border: 2px solid #E5E5E5;
    border-top-color: #D4735E;
    animation: loading-spin 0.8s linear infinite;
}

/* Главная: hero под шапкой при scroll=0 */
.hero-section {
    margin-top: -5rem;
}

/* Главная: при прокрутке шапка получает фон как на других страницах */
header.header-hero.header-scrolled {
    background-color: #F5F1E8 !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

header.header-hero.header-scrolled .header-hero-text,
header.header-hero.header-scrolled nav a,
header.header-hero.header-scrolled .ri-shopping-cart-line,
header.header-hero.header-scrolled .ri-menu-line {
    color: #2C2C2C !important;
}

/* Значок корзины (мобильная версия) */
@media (max-width: 767px) {
    /* Контейнер кнопки корзины — overflow: visible, чтобы бейдж не обрезался */
    .md\:hidden button.relative {
        overflow: visible;
    }
    #cart-count-badge-mobile {
        min-width: 1.25rem;
        width: auto;
        height: 1.25rem;
        padding: 0 0.35rem;
        font-size: 0.7rem;
        line-height: 1.25rem;
        font-weight: 600;
    }
}

/* Корзина */
.cart-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
    display: flex;
    justify-content: flex-end;
}

.cart-modal.hidden {
    display: none !important;
}

.cart-panel {
    width: 100%;
    height: 100%;
    background: #fff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .cart-panel {
        max-width: 420px;
        max-height: 85vh;
        margin: 2vh 1rem 2vh 0;
        border-radius: 1rem 0 0 1rem;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }
}

.cart-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #E5E5E5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2C2C2C;
    margin: 0;
}

.cart-close-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2C2C2C;
    cursor: pointer;
}

.cart-close-btn:hover {
    color: #D4735E;
}

.cart-items {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #E5E5E5;
}

.cart-item-image {
    width: 4rem;
    height: 4rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #F5F1E8;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 500;
    color: #2C2C2C;
}

.cart-item-variant {
    font-size: 0.875rem;
    color: #666;
}

.cart-item-price {
    font-weight: 600;
    color: #D4735E;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    border: 2px solid #E5E5E5;
    border-radius: 0.5rem;
    overflow: hidden;
}

.cart-qty-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F1E8;
    border: none;
    font-size: 1.25rem;
    font-weight: 500;
    color: #2C2C2C;
    cursor: pointer;
}

.cart-qty-btn:hover {
    background: #FFE5D9;
    color: #D4735E;
}

.cart-qty-value {
    min-width: 2rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.9375rem;
}

.cart-item-service {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

.cart-remove-btn {
    padding: 0.35rem 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #b91c1c;
    cursor: pointer;
}

.cart-remove-btn:hover {
    background: #fee2e2;
    border-color: #f87171;
}

.cart-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #E5E5E5;
    flex-shrink: 0;
    background: #fff;
}

.cart-min-order {
    padding: 0.75rem 1rem;
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #854d0e;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.cart-min-order.hidden {
    display: none !important;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cart-total-label {
    font-weight: 700;
    font-size: 1.125rem;
}

.cart-total-value {
    font-weight: 700;
    font-size: 1.25rem;
    color: #D4735E;
}

.cart-checkout-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #D4735E;
    color: #fff;
    border: none;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.cart-checkout-btn:hover {
    background: #C06550;
}
