/* Канон стилей витрины: frontend/public/styles.css (зеркало в корень — sync-public.mjs). */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #2C5F8D;
    --primary-hover: #1e4a6d;
    --secondary-color: #4A90E2;
    --accent-color: #FF6B6B;
    --background-color: #F8F9FA;
    --surface-color: #FFFFFF;
    --surface-hover: #F5F7FA;
    --text-primary: #1A1A1A;
    --text-secondary: #6C757D;
    --text-light: #9CA3AF;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Layout */
    --app-max-width: 520px;
    --app-radius: 22px;
    --app-border: rgba(255, 255, 255, 0.55);
    --app-shadow: 0 18px 60px rgba(16, 24, 40, 0.14);

    --hero-height: 220px;
}

@media (min-width: 900px) {
    :root { --app-max-width: 650px; }
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* Фон как на примере (комната) */
    background:
        linear-gradient(180deg, rgba(11, 16, 23, 0.55) 0%, rgba(11, 16, 23, 0.25) 30%, rgba(11, 16, 23, 0.45) 100%),
        url("assets/bg-portcomfort.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.html, html, body, #root { height: 100%; }

.app-shell {
    min-height: 100vh;
    height: auto;
    max-width: var(--app-max-width);
    margin: 0 auto;
    background: transparent;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 900px) {
    .app-shell {
        border-radius: var(--app-radius);
        overflow: clip;
        box-shadow: var(--app-shadow);
        border: none;
        background: transparent;
    }
}

.page {
    display: none;
    min-height: 100vh;
    padding-bottom: 80px;
}

.page.active {
    display: block;
}

.hub-page.page { padding-bottom: 0; }

/* Личный кабинет: без нижнего "хвоста" */
.account-page.page { padding-bottom: 0; }

/* Header */
.header {
    background: rgba(0, 0, 0, 0.0);
    color: white;
    padding: 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: none;
    backdrop-filter: none;
}

.header h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

/* Тень только на hero-хабе, не на белом баре витрины */
.header--hero h1,
.hub-hero-title {
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.header--bar h1,
.header--bar .header-title {
    text-shadow: none;
}

.header h2 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    letter-spacing: -0.2px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    margin-right: 8px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-weight: 500;
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.95);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: white;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.cart-icon {
    font-size: 20px;
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-color);
    color: white;
    border-radius: 10px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

/* Categories */
.categories-container {
    background: rgba(255, 255, 255, 0.92);
    margin: 12px 14px 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    box-shadow: 0 16px 50px rgba(16, 24, 40, 0.18);
    backdrop-filter: blur(10px);
}

.categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    position: relative;
    border: none;
    border-radius: 16px;
    height: 96px;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    color: white;
    text-align: left;
    box-shadow: 0 14px 36px rgba(16, 24, 40, 0.18);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%),
        linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.category-btn:active {
    transform: scale(0.96);
}

.category-btn.active {
    outline: 3px solid rgba(255, 107, 107, 0.45);
}

/* Search */
.search-container {
    padding: 14px 14px;
    background: transparent;
    border-bottom: none;
}

.search-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 16px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: 0 16px 50px rgba(16, 24, 40, 0.12);
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 95, 141, 0.1);
}

/* Products */
.products-container {
    padding: 14px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
}

/* На большом экране подложка карточек/контента должна быть "внутри белого враппера" */
@media (min-width: 900px) {
    .products-container {
        background: rgba(255, 255, 255, 0.92);
        border: 1px solid rgba(255, 255, 255, 0.55);
        border-radius: 18px;
        margin: 0 14px 18px;
        box-shadow: 0 16px 50px rgba(16, 24, 40, 0.18);
        backdrop-filter: blur(10px);
    }
}

.product-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: transform 0.3s ease;
}

.product-card:active .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 14px;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 8px;
    letter-spacing: -0.3px;
}

.product-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* Product Details */
.product-details {
    padding: 20px;
}

.product-detail-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    box-shadow: var(--shadow-md);
}

.product-detail-name {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.product-detail-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.product-detail-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.7;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding: 16px;
    background: var(--surface-hover);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.quantity-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    font-weight: 600;
}

.quantity-btn:active {
    transform: scale(0.9);
    box-shadow: var(--shadow-sm);
}

.quantity-value {
    font-size: 20px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    color: var(--text-primary);
}

.add-to-cart-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.2px;
}

.add-to-cart-btn:active {
    transform: translateY(1px);
    box-shadow: var(--shadow);
}

.add-to-cart-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    box-shadow: none;
}

/* Cart */
.cart-content {
    padding: 20px;
}

.cart-item {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.cart-item:active {
    transform: scale(0.98);
}

.cart-item-image {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    flex-shrink: 0;
}

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

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    line-height: 1.4;
}

.cart-item-price {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-hover);
    border-radius: var(--radius);
    padding: 6px 10px;
    border: 1px solid var(--border-light);
}

.cart-quantity-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.2s ease;
}

.cart-quantity-btn:active {
    transform: scale(0.9);
}

.cart-item-total {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: auto;
    letter-spacing: -0.3px;
}

.remove-item-btn {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.remove-item-btn:active {
    transform: scale(0.95);
    box-shadow: none;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.cart-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, var(--app-max-width));
    background: var(--surface-color);
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.checkout-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.2px;
}

.checkout-btn:active {
    transform: translateY(1px);
    box-shadow: var(--shadow);
}

/* Checkout */
.checkout-content {
    padding: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 141, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 12px 44px 12px 16px;
    min-height: 48px;
    line-height: 1.2;
    background-color: #fff;
    color: var(--text-primary);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath fill='%236C757D' d='M5.5 7.5a1 1 0 0 1 1.4 0L10 10.6l3.1-3.1a1 1 0 1 1 1.4 1.4l-3.8 3.8a1 1 0 0 1-1.4 0L5.5 8.9a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    cursor: pointer;
}

.order-summary {
    background: var(--surface-hover);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 28px;
    margin-bottom: 28px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.order-summary h3 {
    margin-bottom: 12px;
}

.order-item-summary {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
#order-items-summary > .order-item-summary:last-of-type {
    border-bottom: none;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: bold;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--border-color);
}

.submit-order-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.2px;
}

.submit-order-btn:active {
    transform: translateY(1px);
    box-shadow: var(--shadow);
}

/* Success Page — экран «Заказ оформлен»: белый фон, тёмный текст */
#success-page.page.active {
    background: #fff;
    color: #0f172a;
}

/* Success Page */
.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    text-align: center;
    background: #fff;
    box-sizing: border-box;
}

.success-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
}

.success-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #0f172a;
}

.success-content p {
    color: #475569;
    margin-bottom: 32px;
}

.continue-btn {
    padding: 16px 36px;
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    letter-spacing: 0.2px;
}

.continue-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.continue-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-results p {
    font-size: 16px;
    color: var(--text-light);
}

/* Responsive */
@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .products-container {
        padding: 24px;
    }
    
    .product-card {
        border-radius: var(--radius-lg);
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.3s ease-out;
}

/* Booking Details Page */
.booking-details {
    padding: 20px;
}

.booking-info-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.booking-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.booking-field:last-child {
    border-bottom: none;
}

.booking-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.booking-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
    text-align: right;
}

.booking-status {
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
}

.booking-status-confirmed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.booking-status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.booking-status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.booking-services {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.booking-services h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 700;
}

.booking-service {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.booking-service:last-child {
    border-bottom: none;
}

.booking-total {
    background: var(--surface-hover);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.booking-total-price {
    color: var(--primary-color);
    font-size: 24px;
}

/* Admin Panel */
.admin-content {
    padding: 20px;
}

.admin-section {
    margin-bottom: 30px;
}

.admin-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.admin-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.admin-btn:active {
    transform: translateY(1px);
    box-shadow: var(--shadow);
}

.admin-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 3000;
    backdrop-filter: blur(6px);
}

.modal {
    width: min(520px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(16, 24, 40, 0.24);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.modal-title {
    font-weight: 800;
    letter-spacing: -0.2px;
}

.modal-close {
    border: none;
    background: rgba(0,0,0,0.06);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-weight: 700;
}

.modal-body {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.modal-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    background: white;
    font-size: 14px;
    font-family: inherit;
}

.modal-preview {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0,0,0,0.04);
}

.modal-preview img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.modal-hint {
    padding: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.modal-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.admin-product-item {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.admin-product-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.admin-product-info p {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

.admin-product-actions {
    display: flex;
    gap: 8px;
}

.admin-action-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-action-btn:active {
    transform: scale(0.95);
}

.admin-delete-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Улучшенная прокрутка */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-light);
}

/* Хаб: /portcomfort{slug} */
.hub-page .header.header--hero,
.hub-page #hub-hero.header--hero {
    flex-shrink: 0;
    position: relative;
    top: auto;
    min-height: var(--hero-height);
    padding: 18px 18px 0;
    align-items: flex-start;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 100%);
}
.hub-hero-top { display: flex; justify-content: space-between; align-items: center; }
.hub-hero-title { font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.page.active.hub-page,
.hub-page.page.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.hub-content {
    flex: 1 0 auto;
    background: #fff;
    margin: 0;
    border-radius: 0;
    padding: 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    min-height: auto;
    overflow: visible;
}
.hub-section-title { font-size: 11px; font-weight: 800; color: #9aa1ad; letter-spacing: 0.1em; margin: 0 0 10px; }
.hub-divider {
    height: 4px;
    width: 100%;
    background: #9aa1ad;
    opacity: 0.35;
    border-radius: 999px;
    margin: 18px 0;
}
.hub-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hub-cat-grid--scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.hub-cat-grid--scroll > .hub-cat-tile {
    flex: 0 0 42%;
    min-width: 150px;
    max-width: 200px;
}
.hub-cat-grid--scroll > .hub-cat-tile:last-child:nth-child(odd) {
    grid-column: auto;
}
.hub-cat-tile {
    position: relative;
    border: none;
    border-radius: 16px;
    min-height: 180px;
    padding: 12px;
    text-align: left;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(120deg, #0f172a, #2c3e50) center/cover no-repeat;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    isolation: isolate;
}
.hub-cat-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    transition: transform 200ms ease;
    will-change: transform;
}
.hub-cat-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.55));
    pointer-events: none;
}
.hub-cat-tile-text {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    font-size: 18px;
}
.hub-cat-tile[style*='--tile-img'] {
    background-image: var(--tile-img), linear-gradient(120deg, #0f172a, #2c3e50) !important;
    background-size: cover, auto;
}

@media (hover: hover) and (pointer: fine) {
    .hub-cat-tile {
        transition: box-shadow 200ms ease;
    }
    .hub-cat-tile:hover {
        box-shadow: 0 14px 36px rgba(16, 24, 40, 0.16);
    }
    .hub-cat-tile:hover::before {
        transform: scale(1.06);
    }
}

/* Товары: всегда 3 в ряд */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }

/* Если плиток нечётное количество — последняя на всю ширину (2 колонки) */
.hub-cat-grid > .hub-cat-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.hub-hero-icon { color: #fff; padding: 8px; }

/* Хаб: hero как header */
.header--hero {
    position: relative;
    min-height: var(--hero-height);
    padding: 18px 18px 0;
    align-items: flex-start;
}
.header--hero .header-title {
    padding-top: 6px;
    text-align: left;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.3px;
    text-shadow: none;
    position: absolute;
    left: 18px;
    right: max(18px, env(safe-area-inset-right));
    bottom: 18px;
    margin: 0;
    max-width: none;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}
@media (max-width: 420px) {
    .header--hero .header-title {
        font-size: 24px;
        left: max(14px, env(safe-area-inset-left));
        right: max(14px, env(safe-area-inset-right));
    }
}

/* Контролы количества под товаром */
.product-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    padding: 10px 10px;
    transition: transform 180ms ease, opacity 180ms ease;
}
.product-qty-btn {
    border: none;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 900;
    width: 34px;
    height: 30px;
}
.product-qty-val { font-weight: 900; color: #0f172a; min-width: 18px; text-align: center; }
.header--hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 24px;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.18));
    pointer-events: none;
}

/* Полноэкранный поиск поверх хаба */
.search-sheet {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: none;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: rgba(11, 16, 23, 0.55);
    backdrop-filter: blur(10px);
}
.search-sheet.active { display: block; }
.search-sheet-top {
    display: flex;
    gap: 8px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2;
    min-width: 0;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
    background: rgba(11, 16, 23, 0.72);
    backdrop-filter: blur(10px);
}
.search-sheet-top .back-btn {
    flex: 0 0 auto;
    margin-right: 0;
}
.search-sheet-input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 44px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    padding: 0 12px;
    outline: none;
    box-shadow: 0 16px 50px rgba(16, 24, 40, 0.12);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    font-size: 16px; /* уменьшает авто-зум iOS при фокусе */
}
.search-sheet-body {
    padding: 0 max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    min-width: 0;
}
.search-sheet-results-title {
    padding: 4px 2px 12px;
    font-size: 15px;
    font-weight: 800;
    color: #e2e8f0;
}
.search-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (min-width: 420px) {
    .search-sheet-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (min-width: 640px) {
    .search-sheet-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.search-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}
.search-card-media {
    display: block;
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
    overflow: hidden;
}
.search-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.search-card-title {
    padding: 8px 10px 4px;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-card-pill {
    margin: 0 10px 10px;
    align-self: flex-start;
    font-size: 12px;
    font-weight: 900;
    color: #0f172a;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 4px 10px;
}
.search-sheet-block {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    box-shadow: 0 16px 50px rgba(16, 24, 40, 0.18);
    backdrop-filter: blur(10px);
    padding: 14px;
    margin-bottom: 12px;
}
.search-sheet-block-title {
    font-size: 11px;
    font-weight: 800;
    color: #9aa1ad;
    letter-spacing: 0.1em;
    margin: 0 0 10px;
}
.search-sheet-list { display: grid; gap: 8px; }
.search-sheet-row {
    width: 100%;
    text-align: left;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
}
.search-sheet-row-title { font-weight: 800; color: #0f172a; }
.search-sheet-row-sub { color: #6b7280; font-weight: 700; }
.search-sheet-empty { padding: 16px; color: #e5e7eb; opacity: 0.9; }

.header-search-input { display: none; } /* теперь поиск на хабе в отдельной панели */

/* Личный кабинет */
.account-content { padding: 16px; }
.account-page .account-content {
    background: #fff;
    border-radius: 18px;
    margin: 16px;
}
.account-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    box-shadow: 0 16px 50px rgba(16, 24, 40, 0.12);
    backdrop-filter: blur(10px);
    padding: 14px;
    margin-bottom: 0;
}
.account-title { font-weight: 800; color: #0f172a; }
.account-sub { font-size: 12px; color: #6b7280; margin-top: 4px; }
.account-empty { padding: 18px 8px; color: #6b7280; text-align: center; }
.account-card .account-empty,
.account-card .account-orders { margin-top: 12px; }
.account-orders { display: flex; flex-direction: column; gap: 10px; }
.account-order {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
}
.account-order-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.account-order-date { font-weight: 800; color: #0f172a; font-size: 13px; }
.account-order-total { font-weight: 900; color: #0f172a; }
.account-order-items { margin-top: 8px; display: grid; gap: 6px; }
.account-order-item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #111827; }
.account-order-item-qty { color: #6b7280; font-weight: 700; }

.header--bar { background: #fff; color: #0f172a; border-bottom: 1px solid #e5e7eb; }
.header--bar .back-btn,
.header--bar .icon-btn {
    color: #0f172a;
    background: rgba(0,0,0,0.06);
    box-shadow: none;
    backdrop-filter: none;
}
.header--bar .icon-btn:active {
    box-shadow: none;
}
.header-left { min-width: 40px; flex-shrink: 0; }
.header-title { flex: 1; text-align: center; font-size: 17px; font-weight: 800; margin: 0; min-width: 0; }
.header--bar .header-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 6px;
}
.header--bar .header-actions {
    flex-shrink: 0;
}
.header--hero .header-left,
.header--hero .header-actions {
    flex-shrink: 0;
    position: relative;
    z-index: 3;
}
.categories-container--pills { background: #fff; margin: 0; padding: 0 0 0 4px; border: none; box-shadow: none; }
.categories--pills { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; padding: 10px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.category-pill { flex: 0 0 auto; border: 1px solid #e5e7eb; background: #fff; color: #0f172a; font-weight: 800; font-size: 12px; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.category-pill.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.products-container--shop { background: #fff; margin: 0; padding: 8px; min-height: 200px; }
.inner-page.page.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: #fff;
}
.inner-page.page.active > .header--bar { flex-shrink: 0; }
.inner-page.page.active > .products-container--shop,
.inner-page.page.active > .checkout-content,
.inner-page.page.active > .account-content {
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
}
.products-grid--3 { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
.product-tile {
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.1);
}
.product-tile-image-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}
.product-tile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.product-tile-info {
    flex: 1 1 auto;
    padding: 10px 12px 6px;
    min-height: 2.6em;
}
.product-tile-footer {
    margin-top: auto;
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.product-tile-name {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.15;
}
.product-tile-footer .product-tile-price,
.product-tile-footer .product-qty {
    width: 100%;
    margin: 0;
}
.product-tile-price {
    border: none;
    border-radius: 999px;
    background: #0b0f14;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    padding: 14px 0;
    cursor: pointer;
}
.product-tile--info,
.product-tile--subcategory {
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
}

.product-tile-price--info {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}
.product-tile-footer .product-qty {
    margin-top: 0;
}
.category-desc-panel {
    margin: 4px 8px 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
    color: #374151;
    font-size: 13px;
    line-height: 1.4;
}
.formatted-desc p { margin: 0 0 0.5em; }
.formatted-desc p:last-child { margin-bottom: 0; }
.formatted-desc ul { margin: 0.35em 0 0.5em 1.1em; padding: 0; }
.formatted-desc strong { font-weight: 800; }
.formatted-desc em { font-style: italic; }
.text-muted { color: #6b7280; }
.excursions .header-title, #excursions-page .header--bar h1 { font-size: 17px; }

.app-footer {
    padding: 14px 16px 20px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.92);
}

/* Футер не используем */
.app-footer { display: none !important; }

/* Внутренние разделы: белый фон на весь враппер */
.inner-page .products-container--shop { background: #fff; }
.inner-page .categories-container--pills { background: #fff; }

@media (min-width: 900px) {
    .inner-page .products-container.products-container--shop {
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
    }
}

/* Нижняя CTA-кнопка корзины (плавно снизу) */
.bottom-cart-cta {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(220%);
    bottom: 14px;
    width: min(100%, var(--app-max-width));
    padding: 0 14px;
    z-index: 200;
    transition: transform 220ms ease;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}
.bottom-cart-cta.active {
    transform: translateX(-50%) translateY(0%);
    opacity: 1;
    visibility: visible;
}
.bottom-cart-cta button {
    width: 100%;
    border: none;
    border-radius: 999px;
    background: #0b0f14;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    padding: 16px 18px;
    pointer-events: auto;
}

/* Модалка товара */
.product-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.product-modal {
    width: min(100%, var(--app-max-width));
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 14px;
    max-height: 84vh;
    overflow: auto;
}
.product-modal--info {
    min-height: 50vh;
    max-height: 84vh;
    height: auto;
    overflow-y: auto;
}
.product-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.product-modal-title { font-weight: 900; font-size: 16px; margin: 0; }
.product-modal-close {
    border: none;
    background: rgba(0,0,0,0.06);
    color: #0f172a;
    border-radius: 999px;
    padding: 10px 12px;
    font-weight: 900;
}
.product-modal-img {
    width: 100%;
    border-radius: 14px;
    margin-top: 10px;
    object-fit: cover;
    max-height: 240px;
}
.product-modal-desc { margin-top: 10px; color: #4b5563; font-size: 13px; line-height: 1.35; }
.product-modal-divider {
    margin: 14px 0;
}
.tariff-section {
    margin-top: 0;
}
.tariff-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tariff-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    font-weight: 500;
}
.tariff-row--active {
    border-color: #0f172a;
    background: rgba(15, 23, 42, 0.04);
}
.tariff-row-radio {
    flex: 0 0 auto;
    margin: 0;
}
.tariff-row-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tariff-row-label {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
}
.tariff-row-hint {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
}
.tariff-row-price {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
}
.product-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.product-modal-actions button {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 14px 14px;
    font-weight: 900;
}
.product-modal-add { background: #0f172a; color: #fff; }
.product-modal-open-cart { background: rgba(0,0,0,0.06); color: #0f172a; }
