/* Shared UI components: catalog cards, accordions, site footer */

/* ===== Buttons ===== */
.button {
    --button-background: #1a1a1a;
    --button-color: #fff;
    --button-border-color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid var(--button-border-color);
    border-radius: 8px;
    background: var(--button-background);
    color: var(--button-color);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
    -webkit-tap-highlight-color: transparent;
}

.button:hover {
    --button-background: #333;
    --button-border-color: #333;
}

.button:active {
    transform: translateY(1px);
}

.button:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

.button--primary {
    --button-background: #1a1a1a;
    --button-color: #fff;
    --button-border-color: #1a1a1a;
}

.button--secondary {
    --button-background: transparent;
    --button-color: #1a1a1a;
    --button-border-color: #1a1a1a;
}

.button--secondary:hover {
    --button-background: #f5f5f5;
    --button-border-color: #1a1a1a;
}

.button--quiet {
    min-height: auto;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.button--quiet:hover {
    background: transparent;
    border-color: transparent;
    color: #555;
}

.button--sm {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 14px;
}

.button--lg {
    min-height: 52px;
    padding: 13px 24px;
    font-size: 16px;
}

.button--full-width {
    display: flex;
    width: 100%;
}

.button[disabled],
.button[aria-disabled="true"],
.button--loading {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.button--success,
.button--success[disabled],
.button--success[aria-disabled="true"] {
    --button-background: #3a3a3a;
    --button-border-color: #3a3a3a;
    --button-color: #fff;
    cursor: default;
    opacity: 1;
    pointer-events: none;
}

.button__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
}

.button__icon > svg,
.button__icon > img {
    width: 100%;
    height: 100%;
}

/* ===== Catalog product cards ===== */
.products {
    display: flex;
    justify-content: left;
    gap: 1rem;
    flex-wrap: wrap;
}

.product {
    width: 300px;
    text-align: left;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    text-decoration: none;
    color: inherit;
}

@media (min-width: 768px) {
    .products {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1rem;
        justify-content: start;
    }

    .product {
        max-width: 350px;
        width: 100%;
    }
}

.product-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image-wrap {
    position: relative;
    width: 100%;
}

.product-badge-order {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 8px;
    font-family: Manrope, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.75px;
    color: #2c2c2c;
    background: #fff;
    border-radius: 4px;
    line-height: 1.25;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 1;
}

.product-badge-order.is-new {
    color: #fff;
    background: #111;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 4px 10px rgba(255, 255, 255, 0.18);
}

.product-badge-order[hidden] {
    display: none !important;
}

.product img,
.product .main-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 5px 5px 0 0;
    display: block;
}

h5.product-name {
    font-size: 1em;
    padding: 0 0.5rem;
    margin: 0.5rem 0 0.75rem;
}

h5.product-title {
    color: #222;
    font-size: 15px;
    font-weight: 500;
    padding: 0 0.6rem;
    margin: 0.5rem 0 0;
}

p.product-subtitle {
    font-size: 12px;
    font-weight: 400;
    transform: scale(0.94);
    transform-origin: left center;
    color: #444;
    padding: 0 0.6rem;
    margin: 0.1rem 0 0.25rem;
    text-transform: uppercase;
}

.home-price-byn {
    color: #000;
    margin: 0 0 0.5rem;
    padding: 0 0.6rem;
    font-size: 14px;
    font-weight: 300;
    line-height: normal;
}

.home-price-rub {
    color: #000;
    margin: -0.2rem 0 0.5rem;
    padding: 0 0.6rem;
    font-size: 1.02em;
    font-weight: 300;
}

.products--static .product {
    background: #fff;
    border-radius: 5px;
}

.products--static .product-inner {
    padding-bottom: 0.75rem;
}

@media (max-width: 767px) {
    .product:hover {
        text-decoration: none;
    }

    .product * {
        text-decoration: none !important;
    }

    h5.product-name {
        font-size: 1.02em;
        padding: 0 0.5rem;
        margin: 0.5rem 0;
        font-weight: 700;
    }

    h5.product-title {
        font-size: 14px;
        font-weight: 500;
        padding: 0 0.6rem;
        margin: 0.5rem 0 0;
    }

    p.product-subtitle {
        font-size: 12px;
        font-weight: 300;
        transform: scale(0.9);
        transform-origin: left center;
        padding: 0 0.6rem;
        margin: 0 0 0.25rem;
        text-transform: uppercase;
    }

    .products,
    .products--static {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: left;
        padding: 0.25rem;
        margin: 0;
        background: rgba(0, 0, 0, 0.04);
        gap: 0.25rem;
        box-sizing: border-box;
    }

    .product {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        background: white;
        border-radius: 5px;
        flex: 1 1 calc(50% - 0.125rem);
        max-width: calc(50% - 0.125rem);
    }
}

/* ===== Info accordions ===== */
.info-accordions {
    margin-top: 0;
}

.info-accordions details.accordion {
    border-bottom: 1px solid #e6e6e6;
}

.info-accordions summary {
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.info-accordions summary::-webkit-details-marker {
    display: none;
}

.accordion__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
}

.accordion__summary:active,
.accordion__summary:focus {
    background: transparent;
    outline: 0;
}

.accordion__summary:focus-visible {
    outline: 2px solid #8ab4f8;
    outline-offset: 2px;
    border-radius: 4px;
}

.accordion__title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 15px;
}

.accordion__plus {
    position: relative;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    transform: rotate(0deg);
    transition: transform 200ms cubic-bezier(.2, .8, .2, 1), color 160ms;
    color: #333;
}

.accordion__plus::before,
.accordion__plus::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 1.2px;
    background: currentColor;
    border-radius: 2px;
    transform-origin: center center;
    transition: transform 180ms ease, opacity 160ms ease;
    transform: translate(-50%, -50%);
}

.accordion__plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 1;
}

.accordion__content {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 160ms ease, opacity 160ms ease;
    will-change: max-height, opacity;
}

.accordion__content-inner {
    padding: 0 0 1rem;
    color: #222;
    line-height: 1.4;
    font-size: 15px;
    font-weight: 400;
}

details[open] .accordion__plus {
    transform: rotate(180deg);
}

details[open] .accordion__plus::after {
    opacity: 0;
    transform: translateY(-50%) rotate(90deg) scaleX(0.6);
}

@media (prefers-reduced-motion: reduce) {
    .accordion__content,
    .accordion__plus::after {
        transition: none;
    }
}

/* ===== Site footer ===== */
.site-footer {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 2rem 1.5rem 1rem;
    margin-top: 0;
}

.site-footer--contacts .footer-contacts {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.site-footer--contacts .footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
}

.footer-nav a:hover {
    color: #fff;
}

.footer-contacts {
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contacts h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 1rem;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer-contact-links .contact-link {
    color: #b0b0b0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-contact-links .contact-link:hover {
    transform: scale(1.1);
}

.footer-contact-links .viber:hover { color: #7360F2; }
.footer-contact-links .telegram:hover { color: #0088cc; }
.footer-contact-links .instagram:hover { color: #e1306c; }
.footer-contact-links .email:hover { color: #d44638; }

.footer-contact-links .svg-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.footer-payment {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-logos {
    max-width: 100%;
    height: auto;
    max-height: 40px;
    opacity: 0.85;
    filter: grayscale(20%);
    transition: opacity 0.2s ease;
}

.payment-logos:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.footer-legal .legal-info,
.footer-legal .legal-contact {
    text-align: center;
}

.footer-legal p {
    font-size: 13px;
    color: #999;
    margin: 0.25rem 0;
    line-height: 1.5;
}

.footer-legal .legal-name {
    font-weight: 500;
    color: #ccc;
    margin-bottom: 0.5rem;
}

.footer-legal a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: #fff;
}

.footer-copyright {
    text-align: center;
    padding-top: 1rem;
}

.footer-copyright p {
    font-size: 12px;
    color: #666;
    margin: 0;
    letter-spacing: 0.5px;
}

@media (max-width: 767px) {
    .site-footer {
        padding: 1.5rem 1rem 1rem;
    }

    .footer-nav {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        padding-bottom: 1rem;
    }

    .footer-nav a {
        font-size: 13px;
    }

    .footer-contacts {
        padding: 1rem 0;
    }

    .footer-contacts h4 {
        font-size: 13px;
        margin-bottom: 0.75rem;
    }

    .footer-contact-links .svg-icon {
        width: 26px;
        height: 26px;
    }

    .footer-payment {
        padding: 1rem 0;
    }

    .payment-logos {
        max-height: 32px;
    }

    .footer-legal {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }

    .footer-legal p {
        font-size: 13px;
    }

    .footer-copyright p {
        font-size: 12px;
    }
}
