/*
Theme Name: см
Theme URI: https://cm.in.ua/
Author: Center Mirrors
Author URI: https://cm.in.ua/
Description: Custom Center Mirrors WordPress theme with editable home page and catalog templates.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cm
*/

.cm-skip-link {
    position: absolute;
    left: -9999px;
}

.cm-skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 100000;
    background: #fff;
    color: #100f0e;
    padding: .75rem 1rem;
}

.cm-header {
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0);
    left: 0;
    right: 0;
    z-index: 9999;
    padding: .7rem 0;
    background: transparent;
    isolation: isolate;
    transition: background-color .45s ease, border-color .45s ease, box-shadow .45s ease, backdrop-filter .45s ease;
}

.cm-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(rgba(16, 15, 14, .42), rgba(16, 15, 14, .42)),
        var(--cm-inner-header-image, none) center center / cover no-repeat;
    transition: opacity .45s ease;
}

body:not(.home) .cm-header::before {
    opacity: 1;
}

body:not(.home) .cm-header.cm-header-scrolled::before {
    opacity: 0;
}

.cm-header.cm-header-scrolled {
    background-color: #ffffff63;
    box-shadow: 0 14px 34px rgba(16, 15, 14, .08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.cm-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.cm-logo,
.cm-footer-logo {
    font-family: Fraunces, serif;
    font-size: clamp(1.5rem, 2vw, 2rem);
    color: #1c1b1a;
    text-decoration: none;
}

.cm-header .cm-logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: 171px;
    max-width: 24vw;
    overflow: visible;
}

.cm-header .cm-logo .cm-logo-image {
    display: block;
    width: 171px !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 104px !important;
    object-fit: contain;
    transition: filter .45s ease, opacity .45s ease;
}

.cm-header.cm-header-scrolled .cm-logo .cm-logo-image {
    filter: brightness(0.3) saturate(100%);
}

.cm-footer-logo .cm-logo-image {
    display: block;
    width: 160px !important;
    max-width: 100% !important;
    height: auto !important;
}

.cm-primary-menu,
.cm-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 2vw, 2.5rem);
}

.cm-primary-menu a {
    color: #f2d9a4;
    font-family: Inter, sans-serif;
    font-size: .75rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color .45s ease, background-color .45s ease;
}

.cm-header .cm-primary-navigation {
    min-width: 0;
}

.cm-header .cm-primary-menu {
    flex-wrap: nowrap;
}

.cm-header .cm-primary-menu a {
    font-size: 1rem !important;
    line-height: 1.15;
    white-space: nowrap;
}

.cm-header.cm-header-scrolled .cm-primary-menu a {
    color: rgba(28, 27, 26, .82);
}

.cm-primary-menu > li:last-child > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f2d9a4;
    color: #1c1b1a;
    padding: .95rem 1.5rem;
    white-space: nowrap;
    border-radius: 0;
}

.cm-header.cm-header-scrolled .cm-primary-menu > li:last-child > a {
    background: #1c1b1a;
    color: #f7f3ec;
}

.cm-menu-toggle {
    display: none;
    width: 46px;
    height: 42px;
    border: 0;
    background: #1c1b1a;
    color: #f7f3ec;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.cm-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition: transform .3s ease, opacity .3s ease;
}

.cm-header.cm-mobile-menu-open .cm-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.cm-header.cm-mobile-menu-open .cm-menu-toggle span:nth-child(2) {
    opacity: 0;
}

.cm-header.cm-mobile-menu-open .cm-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.cm-footer {
    background: #100f0e;
    color: #f7f3ec;
    padding: 5rem 4rem 2rem;
}

.cm-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 2rem;
    align-items: start;
}

.cm-footer-logo,
.cm-footer a {
    color: #f7f3ec;
}

.cm-footer-brand p,
.cm-footer-copy {
    color: rgba(247, 243, 236, .6);
}

.cm-footer-menu {
    justify-content: center;
    flex-wrap: wrap;
}

.cm-footer-menu a {
    color: rgba(247, 243, 236, .8);
    text-decoration: none;
}

.cm-wp-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 10rem 1.5rem 5rem;
}

.cm-entry-title {
    font-family: Fraunces, serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.05;
    color: #1c1b1a;
    margin: 0 0 2rem;
}

.cm-entry-content,
.cm-entry-description,
.cm-post-card {
    font-family: Inter, sans-serif;
    color: #1c1b1a;
    line-height: 1.7;
}

.cm-post-list {
    display: grid;
    gap: 2rem;
}

.cm-post-card {
    border-bottom: 1px solid #d9d2c5;
    padding-bottom: 2rem;
}

.cm-post-card a {
    color: #1c1b1a;
    text-decoration: none;
}

.cm-product-archive,
.cm-product-single {
    max-width: 1400px;
    margin: 0 auto;
    padding: 11rem 4rem 6rem;
}

.cm-product-archive-header {
    max-width: 760px;
    margin-bottom: 4rem;
}

.cm-kicker,
.cm-product-card-meta {
    font-family: Inter, sans-serif;
    font-size: .75rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #8a6843;
}

.cm-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
    margin-bottom: 1.2rem;
    font-family: Inter, sans-serif;
    font-size: .75rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #8a6843;
}

.cm-breadcrumbs a {
    color: #8a6843;
    text-decoration: none;
}

.cm-breadcrumbs a:hover {
    color: #1c1b1a;
}

.cm-breadcrumb-separator {
    color: rgba(138, 104, 67, .45);
}

.cm-product-archive-header h1,
.cm-product-summary h1,
.cm-related-products h2,
.cm-product-content h2,
.cm-lead-form h2,
.cm-product-admin-box h2 {
    font-family: Fraunces, serif;
    color: #1c1b1a;
    letter-spacing: -.02em;
}

.cm-product-archive-header h1,
.cm-product-summary h1 {
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 1.02;
    margin: .5rem 0 1.25rem;
}

.cm-product-archive-header h1 {
    max-width: 900px;
}

body[class*="products"] .cm-product-archive-header h1,
.post-type-archive-wporg_product .cm-product-archive-header h1 {
    font-size: clamp(2.75rem, 5vw, 4.5rem);
}

.cm-product-archive-header p,
.cm-term-description,
.cm-product-content,
.cm-product-admin-box,
.cm-lead-form {
    font-family: Inter, sans-serif;
    color: #6b655b;
    line-height: 1.7;
}

.cm-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}

.cm-product-grid-related {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cm-product-card {
    background: #efe9df;
    min-width: 0;
}

.cm-product-card-media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #d9d2c5;
}

.cm-product-card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    background: rgba(16, 15, 14, .86);
    color: #f7f3ec;
    padding: .45rem .7rem;
    font-family: Inter, sans-serif;
    font-size: .68rem;
    line-height: 1;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.cm-product-card-media img,
.cm-product-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-product-card-media img {
    transition: transform .7s cubic-bezier(.22, 1, .36, 1);
}

.cm-product-card:hover .cm-product-card-media img {
    transform: scale(1.04);
}

.cm-product-card-placeholder {
    display: grid;
    place-items: center;
    min-height: 18rem;
    padding: 2rem;
    color: #6b655b;
    font-family: Inter, sans-serif;
}

.cm-product-card-body {
    padding: 1.5rem;
}

.cm-product-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: .75rem;
}

.cm-product-card-meta a {
    color: #8a6843;
    text-decoration: none;
}

.cm-product-card-title {
    font-family: Fraunces, serif;
    font-size: 1.6rem;
    line-height: 1.15;
    margin: 0 0 1rem;
}

.cm-product-card-title a {
    color: #1c1b1a;
    text-decoration: none;
}

.cm-product-specs {
    display: grid;
    gap: .75rem;
    margin: 0 0 1.25rem;
}

.cm-product-specs div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(28, 27, 26, .12);
    padding-bottom: .5rem;
}

.cm-product-specs dt {
    color: #6b655b;
}

.cm-product-specs dd {
    margin: 0;
    color: #1c1b1a;
    text-align: right;
}

.cm-product-price {
    font-family: Fraunces, serif;
    font-size: 1.7rem;
    color: #1c1b1a;
    margin-bottom: 1.25rem;
}

.cm-product-card-button,
.cm-lead-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1c1b1a;
    color: #f7f3ec;
    border: 0;
    padding: 1rem 1.5rem;
    font-family: Inter, sans-serif;
    font-size: .75rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}

.cm-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    gap: 5rem;
    align-items: start;
}

.cm-product-gallery {
    position: sticky;
    top: 8rem;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #efe9df;
}

.cm-product-summary {
    min-width: 0;
}

.cm-product-specs-large {
    margin: 2rem 0;
}

.cm-product-price-large {
    font-size: 2.5rem;
}

.cm-lead-form {
    background: #efe9df;
    padding: 2rem;
    margin-top: 2rem;
}

.cm-lead-form h2 {
    font-size: 2rem;
    margin: 0 0 1.5rem;
}

.cm-lead-form label {
    display: grid;
    gap: .5rem;
    margin-bottom: 1rem;
}

.cm-lead-form span {
    color: #1c1b1a;
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cm-lead-form input,
.cm-lead-form textarea {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #d9d2c5;
    background: transparent;
    color: #1c1b1a;
    padding: .75rem 0;
    outline: none;
}

.cm-lead-form input:focus,
.cm-lead-form textarea:focus {
    border-color: #1c1b1a;
}

.cm-product-admin-box,
.cm-product-content,
.cm-related-products {
    margin-top: 5rem;
}

.cm-product-admin-box {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 2rem;
}

.cm-product-warning {
    color: #b91c1c;
    font-weight: 700;
}

.cm-related-products h2,
.cm-product-content h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 2rem;
}

.cm-term-children {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: -2rem 0 4rem;
}

.cm-term-children a {
    border: 1px solid #d9d2c5;
    color: #1c1b1a;
    padding: .75rem 1rem;
    text-decoration: none;
}

.cm-category-gallery,
.cm-catalog-products {
    margin: 4rem 0 5rem;
}

.cm-category-gallery-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.cm-category-gallery-heading h2 {
    margin: 0;
    font-family: Fraunces, serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    color: #1c1b1a;
}

.cm-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.cm-category-card {
    position: relative;
    display: block;
    min-height: 18rem;
    overflow: hidden;
    background: #1c1b1a;
    color: #f7f3ec;
    text-decoration: none;
}

.cm-category-card-child {
    min-height: 14rem;
}

.cm-category-card-media,
.cm-category-card-media img,
.cm-category-card-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.cm-category-card-media {
    position: absolute;
    inset: 0;
}

.cm-category-card-media img {
    object-fit: cover;
    opacity: .72;
    transition: transform .8s cubic-bezier(.22, 1, .36, 1), opacity .8s cubic-bezier(.22, 1, .36, 1);
}

.cm-category-card-placeholder {
    background:
        linear-gradient(135deg, rgba(176, 136, 104, .35), rgba(16, 15, 14, .9)),
        #6b655b;
}

.cm-category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(16, 15, 14, .84), rgba(16, 15, 14, .18) 58%, rgba(16, 15, 14, .05));
    z-index: 1;
}

.cm-category-card-caption {
    position: absolute;
    left: 1.4rem;
    right: 1.4rem;
    bottom: 1.4rem;
    z-index: 2;
    display: grid;
    gap: .45rem;
}

.cm-category-card-title {
    font-family: Fraunces, serif;
    font-size: clamp(1.7rem, 3vw, 2.7rem);
    line-height: 1.05;
}

.cm-category-card-count {
    font-family: Inter, sans-serif;
    font-size: .75rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(247, 243, 236, .72);
}

.cm-category-card:hover .cm-category-card-media img {
    opacity: .9;
    transform: scale(1.05);
}

.cm-notice {
    font-family: Inter, sans-serif;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
}

.cm-notice-success {
    background: #ecfdf5;
    color: #065f46;
}

.cm-notice-error {
    background: #fef2f2;
    color: #991b1b;
}

.cm-empty-state,
.cm-pagination {
    font-family: Inter, sans-serif;
}

@media (max-width: 1120px) {
    .cm-header-inner {
        padding: 0 2rem;
        gap: 1.5rem;
    }

    .cm-header .cm-logo {
        width: 144px;
        max-width: 22vw;
    }

    .cm-header .cm-logo .cm-logo-image {
        width: 144px !important;
    }

    .cm-primary-menu {
        gap: 1.15rem;
    }

    .cm-header .cm-primary-menu a {
        font-size: .8rem !important;
        letter-spacing: .14em;
    }

    .cm-primary-menu > li:last-child > a {
        padding: .85rem 1.15rem;
    }
}

@media (max-width: 900px) {
    .cm-header {
        padding: .7rem 0;
    }

    .cm-header-inner {
        padding: 0 1.5rem;
        position: relative;
    }

    .cm-header .cm-logo {
        width: 150px;
        max-width: 58vw;
    }

    .cm-header .cm-logo .cm-logo-image {
        width: 150px !important;
        max-height: 82px !important;
    }

    .cm-menu-toggle {
        display: inline-flex;
        position: relative;
        z-index: 2;
    }

    .cm-primary-navigation {
        position: absolute;
        top: calc(100% + .7rem);
        left: 1.5rem;
        right: 1.5rem;
        display: block;
        background: rgba(247, 243, 236, .96);
        box-shadow: 0 18px 40px rgba(16, 15, 14, .14);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .28s ease, visibility .28s ease, transform .28s ease;
        pointer-events: none;
    }

    .cm-header.cm-mobile-menu-open .cm-primary-navigation {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .cm-header .cm-primary-menu {
        display: grid;
        gap: 0;
        padding: .75rem;
    }

    .cm-header .cm-primary-menu a {
        display: flex;
        width: 100%;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        color: rgba(28, 27, 26, .86);
        font-size: .9rem !important;
        letter-spacing: .16em;
    }

    .cm-header .cm-primary-menu > li:last-child > a {
        margin-top: .45rem;
        background: #1c1b1a;
        color: #f7f3ec;
        padding: .9rem 1rem;
    }

    .cm-footer {
        padding: 4rem 1.5rem 2rem;
    }

    .cm-footer-inner {
        grid-template-columns: 1fr;
    }

    .cm-product-archive,
    .cm-product-single {
        padding: 9rem 1.5rem 4rem;
    }

    .cm-product-grid,
    .cm-product-grid-related,
    .cm-category-grid,
    .cm-product-layout {
        grid-template-columns: 1fr;
    }

    .cm-category-gallery-heading {
        display: block;
    }

    .cm-product-gallery {
        position: relative;
        top: auto;
    }
}
