/* ============================================================
   OptovyDvor Catalog — палитра 60-30-10
   60% фон: #FDFBF7 | 30% карточки: #FFFFFF / #EFECE6 / #1A1A1A
   10% акценты: #F4B400
   ============================================================ */

:root {
    --ovd-bg-main: #FDFBF7;
    --ovd-card-bg: #FFFFFF;
    --ovd-surface-alt: #EFECE6;
    --ovd-border-color: #EFECE6;
    --ovd-text-main: #1A1A1A;
    --ovd-text-muted: #6C757D;
    --ovd-accent: #F4B400;
    --ovd-accent-hover: #D99B00;
    --ovd-accent-dark: #1A1A1A;
    --ovd-bg: var(--ovd-bg-main);
    --ovd-surface: var(--ovd-card-bg);
    --ovd-text: var(--ovd-text-main);
    --ovd-muted: var(--ovd-text-muted);
    --ovd-border: var(--ovd-border-color);
    --ovd-radius: 12px;
    --ovd-btn-radius: 8px;
    --ovd-shadow: 0 12px 32px rgba(26, 26, 26, 0.06);
}

/* Скрываем стандартные заголовки темы на странице каталога */
body.ovd-catalog-page .door-catalog-page > section:first-child,
body.ovd-catalog-page .entry-header,
body.ovd-catalog-page .page-header,
body.ovd-catalog-page .wp-block-post-title,
body.ovd-catalog-page main > .wp-block-group:first-child > h1,
body.ovd-catalog-page .page-title {
    display: none !important;
}

body.ovd-modal-open {
    overflow: hidden;
}

body.ovd-catalog-page,
body.ovd-single-product-page {
    background: var(--ovd-bg-main);
}

/* ============================================================
   Обёртка каталога
   ============================================================ */

.ovd-catalog-wrap {
    padding: 24px;
    background: var(--ovd-bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 20px;
    color: var(--ovd-text);
    max-width: 1240px;
    margin: 0 auto;
}

.ovd-catalog-wrap * {
    box-sizing: border-box;
}

.ovd-error {
    padding: 16px 20px;
    border-radius: var(--ovd-radius);
    background: #fff3f3;
    border: 1px solid #f5c2c7;
    color: #842029;
}

/* ============================================================
   Hero-секция
   ============================================================ */

.ovd-hero-container {
    position: relative;
    background-color: var(--ovd-card-bg);
    border-radius: var(--ovd-radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    border: 1px solid var(--ovd-border-color);
    box-shadow: var(--ovd-shadow);
}

.ovd-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ovd-hero-logo {
    flex-shrink: 0;
}

.ovd-main-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
}

.ovd-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--ovd-bg-main);
    border: 1px solid var(--ovd-border-color);
    flex-shrink: 0;
}

.ovd-lang-btn {
    border: none;
    background: transparent;
    color: var(--ovd-text-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease;
}

.ovd-lang-btn:hover {
    color: var(--ovd-text-main);
}

.ovd-lang-btn--active {
    color: var(--ovd-accent-dark);
    background: var(--ovd-accent);
}

.ovd-lang-divider {
    color: var(--ovd-border-color);
    font-size: 12px;
    user-select: none;
}

.ovd-hero-title {
        align-items: center;
        justify-content: space-between;
    margin: 0 0 12px;
    line-height: 1.2;
}

.ovd-hero-features {
    font-size: 1.05rem;
    color: var(--ovd-text-muted);
    line-height: 1.7;
    margin: 0 0 16px;
}

.ovd-hero-contacts {
    background-color: var(--ovd-bg-main);
    padding: 14px 18px;
    border-radius: var(--ovd-btn-radius);
    border-left: 4px solid var(--ovd-accent);
    margin-bottom: 12px;
}

.ovd-showroom-address,
.ovd-phone-links {
    margin: 4px 0;
    font-size: 1.08rem;
    color: var(--ovd-text-main);
}

.ovd-hero-phone-link {
    color: var(--ovd-text-main);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--ovd-accent);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.ovd-hero-phone-link:hover {
    color: #25D366;
    text-decoration-color: #25D366;
}

.ovd-hero-callout {
    font-size: 15px;
    font-weight: 600;
    color: var(--ovd-accent);
    margin: 12px 0 0;
}

/* ============================================================
   Модальное окно заказа
   ============================================================ */

.ovd-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ovd-modal--open {
    opacity: 1;
    visibility: visible;
}

.ovd-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.45);
}

.ovd-modal-window {
    position: relative;
    z-index: 1;
    width: min(460px, 90vw);
    box-sizing: border-box;
    padding: 28px 24px 24px;
    border-radius: 20px;
    background: var(--ovd-surface);
    box-shadow: var(--ovd-shadow);
    border: 1px solid var(--ovd-border);
}

.ovd-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--ovd-text);
}

.ovd-modal-window h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: var(--ovd-text);
}

.ovd-modal-window p {
    margin: 0 0 18px;
    line-height: 1.6;
    color: var(--ovd-muted);
}

.ovd-modal-whatsapp-link {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ============================================================
   Фильтры и layout
   ============================================================ */

.ovd-mobile-filter-bar {
    display: none;
    margin-bottom: 14px;
}

.ovd-mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--ovd-border);
    border-radius: var(--ovd-btn-radius);
    background: var(--ovd-surface);
    color: var(--ovd-text);
    font-weight: 600;
    cursor: pointer;
}

.ovd-catalog-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.ovd-sidebar {
    position: sticky;
    top: 20px;
    padding: 18px;
    border: 1px solid var(--ovd-border);
    border-radius: var(--ovd-radius);
    background: var(--ovd-surface);
    box-shadow: var(--ovd-shadow);
}

.ovd-sidebar-header {
    margin-bottom: 16px;
}

.ovd-filter-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--ovd-text);
}

.ovd-filter-subtitle {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--ovd-muted);
}

.ovd-filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ovd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ovd-filter-group > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ovd-text);
}

.ovd-price-range {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ovd-range-track {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.ovd-range-track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--ovd-border);
}

.ovd-range-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    appearance: none;
    background: transparent;
    pointer-events: none;
}

.ovd-range-input::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ovd-accent);
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.2);
}

.ovd-range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ovd-accent);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.2);
}

.ovd-price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ovd-price-inputs input,
.ovd-filter-group input[type="number"],
.ovd-filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ovd-border);
    border-radius: var(--ovd-btn-radius);
    background: var(--ovd-surface);
    color: var(--ovd-text);
    outline: none;
}

.ovd-price-inputs input:focus,
.ovd-filter-group input[type="number"]:focus,
.ovd-filter-group select:focus {
    border-color: var(--ovd-accent);
}

.ovd-height-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ovd-chip {
    position: relative;
    display: inline-flex;
}

.ovd-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ovd-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid var(--ovd-border);
    border-radius: 999px;
    background: var(--ovd-surface);
    color: var(--ovd-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ovd-chip input:checked + span {
    background: var(--ovd-accent);
    color: var(--ovd-accent-dark);
    border-color: var(--ovd-accent);
    font-weight: 600;
}

.ovd-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   Кнопки
   ============================================================ */

.ovd-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: var(--ovd-btn-radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ovd-button:hover {
    transform: translateY(-1px);
}

.ovd-button-primary {
    background: var(--ovd-accent);
    color: var(--ovd-accent-dark);
}

.ovd-button-primary:hover {
    background: var(--ovd-accent-hover);
}

.ovd-button-secondary {
    background: var(--ovd-surface-alt);
    color: var(--ovd-text);
    border: 1px solid var(--ovd-border);
}

/* ============================================================
   Сетка товаров
   ============================================================ */

.ovd-main-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.ovd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ovd-sort-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ovd-sort-label {
    font-size: 13px;
    color: var(--ovd-muted);
}

.ovd-sort-block select {
    padding: 8px 10px;
    border: 1px solid var(--ovd-border);
    border-radius: var(--ovd-btn-radius);
    background: var(--ovd-surface);
    color: var(--ovd-text);
}

.ovd-loading {
    display: none !important;
}

.ovd-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.ovd-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ovd-border);
    border-radius: var(--ovd-radius);
    background: var(--ovd-surface);
    box-shadow: var(--ovd-shadow);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ovd-card:hover {
    box-shadow: 0 16px 36px rgba(26, 26, 26, 0.08);
    transform: translateY(-2px);
}

.ovd-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: var(--ovd-bg-main);
    padding: 12px;
    text-decoration: none;
}

.ovd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ovd-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    flex: 1;
}

.ovd-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.ovd-card-title a {
    color: var(--ovd-text);
    text-decoration: none;
}

.ovd-card-title a:hover {
    color: var(--ovd-accent-dark);
}

.ovd-card-height {
    margin: 0;
    font-size: 13px;
    color: var(--ovd-muted);
}

.ovd-card-price {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ovd-text);
}

.ovd-card-action {
    margin-top: auto;
    padding-top: 8px;
}

.ovd-card-action .ovd-button {
    width: 100%;
}

.ovd-no-results {
    padding: 24px;
    border-radius: var(--ovd-radius);
    background: var(--ovd-surface);
    border: 1px solid var(--ovd-border);
    color: var(--ovd-muted);
    text-align: center;
}

/* ============================================================
   Страница отдельного товара
   ============================================================ */

.ovd-product-page {
    margin: 0;
    background: var(--ovd-bg-main);
    color: var(--ovd-text);
}

.ovd-product-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.single-product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--ovd-border-color);
    margin-bottom: 24px;
    gap: 16px;
}

.single-product-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    flex-shrink: 0;
}

.single-product-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.single-product-logo {
    max-height: 45px;
    width: auto;
    object-fit: contain;
    display: block;
}

.ovd-product-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--ovd-border);
    border-radius: 999px;
    background: var(--ovd-card-bg);
    text-decoration: none;
    color: var(--ovd-text);
    font-weight: 600;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ovd-product-back:hover {
    border-color: var(--ovd-accent);
    background: var(--ovd-bg-main);
}

.single-product-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 380px) 1fr;
    gap: 40px;
    align-items: start;
}

.product-gallery-column {
    max-width: 380px;
}

.product-gallery-main {
    background: var(--ovd-card-bg);
    border: 1px solid var(--ovd-border);
    border-radius: var(--ovd-radius);
    padding: 20px;
    text-align: center;
}

.product-gallery-main img {
    display: block;
    max-width: 100%;
    max-height: 480px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

.product-gallery-thumbs {
    margin-top: 16px;
}

.product-gallery-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ovd-muted);
    margin-bottom: 8px;
    text-align: left;
}

.product-gallery-thumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.product-gallery-thumb {
    display: block;
    flex: 0 0 72px;
    padding: 0;
    border: 1px solid var(--ovd-border);
    border-radius: 10px;
    background: var(--ovd-card-bg);
    overflow: hidden;
    width: 72px;
    height: 72px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery-thumb.is-active {
    border-color: var(--ovd-accent);
    box-shadow: 0 0 0 2px rgba(244, 180, 0, 0.18);
}

.product-info-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ovd-product-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    line-height: 1.15;
    color: var(--ovd-text);
}

.ovd-product-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ovd-product-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--ovd-text);
}

.ovd-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #0b7a38;
    font-size: 13px;
    font-weight: 600;
}

.ovd-product-summary {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ovd-muted);
}

.ovd-product-attributes {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--ovd-border);
    border-radius: 14px;
    background: var(--ovd-surface-alt);
}

.ovd-attribute-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--ovd-card-bg);
    border-radius: 10px;
}

.ovd-attribute-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ovd-muted);
}

.ovd-attribute-value {
    font-size: 14px;
    color: var(--ovd-text);
    text-align: right;
}

.ovd-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ovd-product-actions .ovd-button {
    width: 100%;
    max-width: 320px;
    padding: 14px 18px;
    box-shadow: 0 8px 20px rgba(244, 180, 0, 0.16);
}

.ovd-product-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ovd-benefit-item {
    padding: 12px 14px;
    border: 1px solid var(--ovd-border);
    border-radius: 14px;
    background: var(--ovd-surface-alt);
    text-align: center;
    font-size: 13px;
    color: var(--ovd-muted);
}

/* ============================================================
   Адаптив
   ============================================================ */

@media (max-width: 1024px) {
    .ovd-catalog-layout {
        grid-template-columns: 1fr;
    }

    .ovd-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, 85vw);
        z-index: 20;
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        border-radius: 0 20px 20px 0;
        box-shadow: 0 16px 60px rgba(26, 26, 26, 0.16);
        overflow-y: auto;
    }

    .ovd-sidebar--open {
        transform: translateX(0);
    }

    .ovd-mobile-filter-bar {
        display: block;
    }

    .single-product-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .product-gallery-column {
        max-width: 100%;
    }

    .ovd-product-benefits {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ovd-catalog-wrap {
        padding: 12px;
        font-size: 21px;
        line-height: 1.5;
    }

    .ovd-hero-container {
        padding: 16px;
    }

    .ovd-hero-title {
        font-size: clamp(2.2rem, 8vw, 3rem);
    }

    .ovd-hero-features,
    .ovd-showroom-address,
    .ovd-phone-links,
    .ovd-filter-subtitle,
    .ovd-sort-label,
    .ovd-card-height,
    .ovd-filter-group > label {
        font-size: 1.16rem;
        line-height: 1.5;
    }

    .ovd-card-title {
        font-size: 1.24rem;
        line-height: 1.3;
    }

    .ovd-card-price {
        font-size: 1.4rem;
    }

    .ovd-chip span,
    .ovd-button,
    .ovd-sort-block select,
    .ovd-price-inputs input,
    .ovd-filter-group input[type="number"] {
        font-size: 1.05rem;
        line-height: 1.4;
    }

    .ovd-hero-top {
        align-items: center;
        justify-content: space-between;
    }

    .ovd-main-logo {
        height: 52px;
    }

    .ovd-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ovd-price-inputs {
        grid-template-columns: 1fr;
    }

    .ovd-filter-actions {
        flex-direction: column;
    }

    .ovd-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .ovd-card-content {
        padding: 12px;
    }

    .ovd-card-title {
        font-size: 1.12rem;
    }

    .ovd-card-price {
        font-size: 1.25rem;
    }

    .ovd-button {
        padding: 12px 16px;
        font-size: 1.08rem;
    }

    .ovd-product-shell {
        padding: 16px 12px 28px;
    }

    .single-product-header {
        flex-wrap: wrap;
    }

    .single-product-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .product-gallery-main {
        padding: 14px;
    }

    .product-gallery-main img {
        max-height: 380px;
    }
}

@media (max-width: 480px) {
    .ovd-products-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   АДАПТИВНЫЕ ШРИФТЫ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================================================ */

@media (max-width: 768px) {
    .ovd-catalog-wrap,
    .door-catalog-page .ovd-catalog-wrap {
        font-size: 14px;
        padding: 12px;
    }

    .ovd-hero-title,
    .door-catalog-page .ovd-hero-title {
        font-size: 1.6rem !important;
        line-height: 1.25;
    }

    .ovd-hero-features,
    .ovd-showroom-address,
    .ovd-phone-links,
    .door-catalog-page .ovd-hero-features {
        font-size: 0.9rem !important;
    }

    .ovd-card-title,
    .door-catalog-page .ovd-card-title {
        font-size: 0.95rem !important;
        line-height: 1.3;
    }

    .ovd-card-price,
    .door-catalog-page .ovd-card-price {
        font-size: 1.05rem !important;
        font-weight: 700;
    }

    .ovd-card-height,
    .door-catalog-page .ovd-card-height {
        font-size: 0.85rem !important;
    }

    .ovd-button,
    .door-catalog-page .ovd-card-action .ovd-button {
        font-size: 0.875rem !important;
        min-height: 40px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .ovd-hero-title,
    .door-catalog-page .ovd-hero-title {
        font-size: 1.4rem !important;
    }

    .ovd-products-grid,
    .door-catalog-page .ovd-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }
}
