/* ======================================================
   ДЕТАЛЬНА СТОРІНКА ТОВАРУ — products.css
   ====================================================== */

/* ----- Обгортка ----- */
.product-detail {
    margin: 40px 0;
}

.product-detail > .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* ----- Хлібні крихти ----- */
.product-detail .breadcrumbs {
    margin-bottom: 16px;
}

.product-detail .breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--color-text-secondary, #6B6B6B);
}

.product-detail .breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.product-detail .breadcrumbs__item:not(:last-child)::after {
    content: "/";
    color: var(--color-text-muted, #999);
    font-weight: 400;
    pointer-events: none;
}

.product-detail .breadcrumbs__link {
    color: var(--color-brand-primary, #1E6DB4);
    text-decoration: none;
}

.product-detail .breadcrumbs__link:hover {
    text-decoration: underline;
}

.product-detail .breadcrumbs__current {
    color: var(--color-text-primary, #2C2C2C);
    font-weight: 600;
}

/* ======================================================
   ВКЛАДКИ (TABS)
   ====================================================== */
.product-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}

.product-tabs::-webkit-scrollbar {
    display: none;
}

.product-tab {
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--neutral-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.product-tab:hover {
    color: var(--color-brand-primary);
}

.product-tab--active {
    color: var(--color-brand-primary);
    border-bottom-color: var(--color-brand-primary);
    font-weight: 700;
}

/* ----- Панелі ----- */
.product-tab-panel {
    display: none;
}

.product-tab-panel--active {
    display: block;
}

.product-tab-empty {
    color: #888;
    font-size: 15px;
    padding: 24px 0;
}

/* ======================================================
   СІТКА ДЕТАЛІ
   ====================================================== */
.product-detail-grid {
    display: grid;
    grid-template-columns: 54fr 46fr;
    gap: 28px;
    margin-bottom: 40px;
}

/* ======================================================
   ГАЛЕРЕЯ — thumbnails зліва (flex row)
   ====================================================== */
.product-gallery {
    display: flex;
    flex-direction: row;
    gap: 12px;
    position: sticky;
    top: 110px;
    align-self: flex-start;
    align-items: flex-start;
    min-width: 0;
}

.product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 136px;
    flex-shrink: 0;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.product-thumbnails::-webkit-scrollbar {
    width: 4px;
}

.product-thumbnails::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.thumbnail {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--color-brand-primary);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-main-image {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    min-width: 0;
    height: min(520px, 65vh);
    max-height: min(520px, 65vh);
}

.product-main-image img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    min-width: 0;
}

.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

/* ======================================================
   БЛОК ІНФОРМАЦІЇ
   ====================================================== */
.product-info {
    min-width: 0;
    position: relative;
}

.product-info h1 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 14px 0;
    line-height: 1.3;
}

/* ----- Мета-рядок ----- */
.product-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.product-meta__review-link {
    background: none;
    border: none;
    color: var(--color-cta-primary);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
}

.product-meta__review-link:hover {
    opacity: 0.75;
}

.product-meta__status {
    font-size: 13px;
    font-weight: 500;
}

.product-meta__status--available {
    color: #2d8a5c;
}

.product-meta__status--unavailable {
    color: #c0392b;
}

.product-meta__sku {
    color: #999;
    font-size: 13px;
}

/* ----- Ціна + іконки ----- */
.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.product-detail-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.product-detail-price .price-current,
.product-detail-price .price-new {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-brand-primary);
    line-height: 1;
}

.product-detail-price .price-old {
    font-size: 1.2rem;
    font-weight: 400;
    color: #aaa;
    text-decoration: line-through;
}

.product-price-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-wishlist,
.btn-compare {
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-cta-primary);
    background: #fff;
    color: var(--color-cta-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-wishlist svg,
.btn-compare svg {
    width: 20px;
    height: 20px;
}

.btn-wishlist:hover,
.btn-compare:hover {
    background: var(--color-cta-primary);
    color: #fff;
}

.btn-wishlist:hover svg path,
.btn-compare:hover svg path {
    stroke: #fff;
}

.btn-wishlist.active {
    background: var(--color-cta-primary);
    color: #fff;
}

.btn-wishlist.active svg path {
    fill: #fff;
    stroke: #fff;
}

/* ----- CTA кнопки (3 штуки) ----- */
.product-cta-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-cta {
    flex: 1;
    height: 48px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    text-align: center;
}

.btn-cta--primary {
    background: var(--color-cta-primary);
    color: #fff;
    border: 2px solid var(--color-cta-primary);
}

.btn-cta--primary:hover {
    background: var(--color-brand-accent);
    border-color: var(--color-brand-accent);
    transform: translateY(-1px);
}

.btn-cta--outline {
    background: #fff;
    color: var(--color-cta-primary);
    border: 2px solid var(--color-cta-primary);
}

.btn-cta--outline:hover,
.btn-cta--outline.btn-cta--active {
    background: var(--color-cta-primary);
    color: #fff;
}

/* ----- Швидке замовлення (toggle) ----- */
.quick-order-section {
    margin: 0 0 20px 0;
    padding: 16px;
    background: #f0f7f2;
    border-radius: 12px;
    border: 1px solid #dce8df;
}

.quick-order-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

.quick-order-phone {
    flex: 1 1 200px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    color: #333;
}

.quick-order-phone:focus {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 1px;
    border-color: var(--color-brand-primary);
}

.btn-quick-order {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 0 20px;
    background: var(--color-cta-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.btn-quick-order:hover:not(:disabled) {
    background: var(--color-brand-accent);
}

.btn-quick-order:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-quick-order:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.quick-order-hint {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #5a6b5f;
    line-height: 1.4;
}

/* ----- Бейджі ----- */
.product-badges {
    margin-bottom: 16px;
}

/* ======================================================
   БЛОК ДОСТАВКИ
   ====================================================== */
.product-delivery {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.product-delivery__title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.product-delivery__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    gap: 12px;
}

.product-delivery__row + .product-delivery__row {
    border-top: 1px solid #f0f0f0;
}

.product-delivery__name {
    font-size: 14px;
    color: #555;
}

.product-delivery__price {
    font-size: 13px;
    color: #777;
    text-align: right;
    white-space: nowrap;
}

.product-delivery__price--free {
    color: #2d8a5c;
    font-weight: 600;
}

/* ======================================================
   ПОСИЛАННЯ НА КАТЕГОРІЮ
   ====================================================== */
.product-category-link {
    margin-top: 30px;
}

.product-category-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--color-cta-primary);
    color: #fff;
    text-decoration: none;
    border: 1px solid var(--color-cta-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.product-category-link a:hover {
    background: var(--color-brand-accent);
    border-color: var(--color-brand-accent);
    transform: translateX(-2px);
}

/* ======================================================
   СХОЖІ ТОВАРИ
   ====================================================== */
.similar-products {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e9ecef;
}

.similar-products .section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

/* auto-fill лишає порожні колонки — 1–2 схожі товари не розтягуються на всю ширину (на відміну від auto-fit у components) */
.similar-products .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ======================================================
   ХАРАКТЕРИСТИКИ (panel)
   ====================================================== */
.product-specs-section {
    padding: 8px 0;
}

.specs-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.specs-table {
    border: 1px solid #ebebeb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.specs-table .attribute-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
}

.specs-table .attribute-row:nth-child(even) {
    background: #f7f8f8;
}

.specs-table .attribute-name {
    flex: 0 1 auto;
    max-width: 42%;
    font-weight: 400;
    font-size: 15px;
    color: #555;
    line-height: 1.45;
}

.specs-table .attribute-leader {
    flex: 1 1 auto;
    min-width: 1rem;
    margin: 0 0.5rem;
    border-bottom: 1px dotted #c5c5c5;
    height: 0;
    align-self: center;
}

.specs-table .attribute-value {
    flex: 0 0 auto;
    max-width: 52%;
    text-align: right;
    font-size: 15px;
    color: #222;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ======================================================
   ОПИС (panel)
   ====================================================== */
.product-description-body {
    line-height: 1.9;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 15px;
    padding: 8px 0;
}

.product-description-body p {
    line-height: 1.75;
    color: #555;
    margin: 0 0 0.65em 0;
}

.product-description-body p:last-child {
    margin-bottom: 0;
}

.product-description-body h2,
.product-description-body h3,
.product-description-body h4 {
    font-weight: 600;
    color: #333;
    line-height: 1.35;
    margin: 0.65em 0 0.45em 0;
}

.product-description-body p + h2,
.product-description-body p + h3,
.product-description-body p + h4 {
    margin-top: 0.55em;
}

.product-description-body h2:first-child,
.product-description-body h3:first-child,
.product-description-body h4:first-child {
    margin-top: 0;
}

.product-description-body h2 { font-size: 1.25rem; }
.product-description-body h3 { font-size: 1.1rem; }
.product-description-body h4 { font-size: 1.05rem; }

.product-description-body ul,
.product-description-body ol {
    margin: 0.45em 0 0.65em 0;
    padding-left: 1.35em;
    color: #555;
}

.product-description-body li {
    margin: 0.35em 0;
    line-height: 1.65;
    padding-left: 0.15em;
}

.product-description-body ul { list-style-type: disc; }
.product-description-body ol { list-style-type: decimal; }

.product-description-body strong,
.product-description-body b {
    font-weight: 600;
    color: #444;
}

.product-description-body em,
.product-description-body i {
    font-style: italic;
}

.product-description-body a {
    color: var(--color-cta-primary, #2d8a5c);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ======================================================
   ВІДГУКИ (panel)
   ====================================================== */
.product-reviews {
    padding: 8px 0;
}

.product-review {
    padding: 18px 20px;
    border: 1px solid #c9d6e3;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.product-review__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.product-review__author {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.product-review__rating {
    color: var(--color-brand-primary);
    font-size: 16px;
    letter-spacing: 1px;
}

.product-review__date {
    font-size: 13px;
    color: #aaa;
    margin-left: auto;
}

.product-review__text {
    font-size: 14px;
    color: #555;
    line-height: 1.65;
    margin: 0;
}

.product-reviews__notice {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.product-reviews__notice--success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.product-reviews__section {
    margin-bottom: 28px;
}

.product-reviews__section--questions {
    margin-top: 32px;
}

.product-reviews__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-reviews__form-title {
    font-size: 1.1rem;
    margin: 0 0 12px;
    color: #333;
}

.product-review__reply {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border-inline-start: 3px solid var(--color-brand-primary, #2563eb);
}

.product-review__reply-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #666;
    margin-bottom: 6px;
}

.product-review__reply-body {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

.product-question {
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 12px;
}

.product-question__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.product-question__author {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.product-question__date {
    font-size: 13px;
    color: #aaa;
    margin-left: auto;
}

.product-question__text {
    font-size: 14px;
    color: #555;
    line-height: 1.65;
    margin: 0;
}

.review-form-section {
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.review-form__row,
.question-form__row {
    margin-bottom: 14px;
}

.review-form__label,
.question-form__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.review-form__row--rating .review-form__label {
    margin-bottom: 8px;
}

.review-form__rating ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.review-form__rating li {
    margin: 0;
}

.review-form__rating label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.review-form__star-input {
    accent-color: var(--color-brand-primary, #2563eb);
}

.review-form__input,
.question-form__input {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.review-form__textarea,
.question-form__textarea {
    width: 100%;
    max-width: 560px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.btn-review-submit {
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #5a8dee;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-review-submit:hover {
    filter: brightness(1.05);
}

.btn-review-submit:focus-visible {
    outline: 2px solid var(--color-brand-primary, #2563eb);
    outline-offset: 2px;
}

/* ======================================================
   АДАПТИВНІСТЬ
   ====================================================== */
@media (max-width: 992px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

@media (max-width: 768px) {
    .product-detail {
        margin: 20px 0;
        overflow-x: clip;
    }

    /* Breadcrumbs: scrollable row on narrow screens */
    .product-detail .breadcrumbs__list {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .product-detail .breadcrumbs__list::-webkit-scrollbar {
        display: none;
    }

    .product-detail .breadcrumbs__item {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Tabs: compact, no horizontal scroll on mobile */
    .product-tabs {
        overflow-x: visible;
        align-items: stretch;
        flex-wrap: nowrap;
    }

    .product-tab {
        flex: 1 1 0%;
        padding: 10px 6px;
        font-size: 0.75rem;
        font-weight: 600;
        text-align: center;
        white-space: normal;
        line-height: 1.25;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .product-detail-grid {
        gap: 20px;
    }

    /* На мобільних thumbnails горизонтально знизу */
    .product-gallery {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .product-thumbnails {
        flex-direction: row;
        width: auto;
        max-height: none;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
    }

    .thumbnail {
        width: 96px;
        flex-shrink: 0;
    }

    .product-main-image {
        height: auto;
        max-height: min(520px, 72vh);
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .product-main-image img {
        height: auto;
        max-height: min(520px, 72vh);
        object-fit: contain;
        object-position: center center;
    }

    .product-info h1 {
        font-size: 1.35rem;
        text-align: left;
    }

    .product-detail-price .price-current,
    .product-detail-price .price-new {
        font-size: 1.6rem;
    }

    .product-cta-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-cta {
        min-width: calc(50% - 4px);
        font-size: 13px;
    }

    .btn-cta--primary {
        min-width: 100%;
    }

    .quick-order-row {
        flex-direction: column;
        align-items: stretch;
    }

    /* Однакові зовнішні ширина й висота з кнопкою (border-box) */
    .quick-order-phone,
    .btn-quick-order {
        width: 100%;
        box-sizing: border-box;
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        font-size: 15px;
    }

    .quick-order-phone {
        max-width: none;
        align-self: stretch;
        padding: 0 14px;
        margin: 0;
        line-height: normal;
        appearance: none;
        -webkit-appearance: none;
    }

    .btn-quick-order {
        padding: 0 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .specs-title {
        font-size: 1.05rem;
    }

    .product-description-body {
        font-size: 14px;
    }

    .specs-table .attribute-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 10px 12px;
    }

    .specs-table .attribute-name {
        max-width: none;
        font-size: 14px;
    }

    .specs-table .attribute-leader {
        display: none;
    }

    .specs-table .attribute-value {
        max-width: none;
        text-align: left;
        font-size: 14px;
    }

    .product-category-link {
        margin-top: 20px;
    }

    .product-category-link a {
        padding: 10px 16px;
        font-size: 13px;
    }

    .similar-products {
        margin-top: 40px;
        padding-top: 30px;
    }

    .similar-products .section-title {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

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

@media (max-width: 480px) {
    .product-description-body { font-size: 13px; }
    .specs-table .attribute-name { font-size: 13px; }
    .specs-table .attribute-value { font-size: 13px; }

    .btn-cta {
        min-width: 100%;
    }
}

/* ----- Сторінка порівняння ----- */
.compare-page {
    padding: 32px 16px 60px;
}

.compare-page__header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.compare-page__title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
}

.compare-page__back {
    font-size: 14px;
    color: var(--color-cta-primary);
    text-decoration: none;
}

.compare-page__back:hover {
    text-decoration: underline;
}

.compare-page__empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted, #666);
}

.compare-page__empty-btn {
    display: inline-flex;
    margin-top: 20px;
    text-decoration: none;
    height: 48px;
    padding: 0 28px;
    width: auto;
    flex: none;
}

a.compare-page__empty-btn {
    display: inline-flex;
}

.compare-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compare-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 500px;
    table-layout: fixed;
}

.compare-table__label-cell,
.compare-table__product-cell {
    vertical-align: top;
    padding: 12px 16px;
    border: 1px solid #e8ecef;
}

.compare-table__label-cell {
    width: 160px;
    background: #f8f9fa;
}

.compare-table__header-row .compare-table__product-cell {
    background: #fff;
    min-width: 180px;
}

.compare-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    position: relative;
    text-align: center;
}

.compare-product-card__remove {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted, #999);
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.compare-product-card__remove:hover {
    color: #e74c3c;
}

.compare-product-card__img-link {
    display: block;
}

.compare-product-card__img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
}

.compare-product-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary, #222);
    text-decoration: none;
    line-height: 1.3;
}

.compare-product-card__name:hover {
    color: var(--color-cta-primary);
}

.compare-product-card__price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 15px;
    font-weight: 700;
}

.compare-product-card__price--sale {
    color: var(--color-cta-primary);
}

.compare-product-card__price--old {
    font-size: 12px;
    font-weight: 400;
    text-decoration: line-through;
    color: var(--color-text-muted, #999);
}

.compare-product-card__buy {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: calc(100% - 24px);
    max-width: 240px;
    flex: none;
    height: 36px;
    font-size: 13px;
    margin-top: auto;
}

.compare-table__row {
    border-top: 1px solid #e8ecef;
}

.compare-table__row:nth-child(even) {
    background: #f8f9fa;
}

.compare-table__label {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted, #666);
    background: #f8f9fa;
    vertical-align: middle;
    border-right: 1px solid #e8ecef;
}

.compare-table__value {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--color-text-primary, #333);
    vertical-align: middle;
    text-align: center;
    border-right: 1px solid #e8ecef;
}

.compare-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.compare-badge--in-stock {
    background: #e6f7ee;
    color: #1a7a45;
}

.compare-badge--out-of-stock {
    background: #fce8e8;
    color: #c0392b;
}

@media (max-width: 768px) {
    .compare-product-card__name {
        line-height: 1.3;
        min-height: calc(1.3em * 4);
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .compare-product-card__price {
        min-height: calc(1.2em * 2);
    }

    .compare-product-card__buy {
        width: 100%;
        max-width: none;
    }
}

/* ----- a.btn-cta (кнопки-посилання, напр. «В кредит») ----- */
a.btn-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}

a.btn-cta:visited {
    color: var(--color-cta-primary);
}

a.btn-cta--primary:visited {
    color: #fff;
}

a.btn-cta--outline:visited {
    color: var(--color-cta-primary);
}

a.btn-cta--outline:hover {
    color: #fff;
}

/* ----- Порівняти: active state ----- */
.btn-compare--active {
    background: var(--color-cta-primary);
    color: #fff;
    border-color: var(--color-cta-primary);
}

.btn-compare--active svg path {
    stroke: #fff;
}

/* ----- Модальне вікно «Покупка частинами» ----- */
.parts-order-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.parts-order-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.parts-order-dialog__inner {
    padding: 32px 28px 28px;
    position: relative;
}

.parts-order-dialog__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted, #888);
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.parts-order-dialog__close:hover {
    color: var(--color-text-primary, #333);
}

.parts-order-dialog__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--color-text-primary, #222);
}

.parts-order-dialog__hint {
    font-size: 14px;
    color: var(--color-text-muted, #666);
    margin: 0 0 20px;
}

.parts-order-dialog__row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.parts-order-dialog__row .parts-order-phone {
    flex: 1;
    min-width: 160px;
    height: 48px;
    padding: 0 14px;
    border: 2px solid #dce8df;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.parts-order-dialog__row .parts-order-phone:focus {
    outline: none;
    border-color: var(--color-cta-primary);
}

.parts-order-submit {
    flex-shrink: 0;
    flex: 0 0 auto;
    min-width: 130px;
}

/* ----- Модальне вікно «В кредит» ----- */
.credit-order-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.credit-order-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.credit-order-dialog__inner {
    padding: 32px 28px 28px;
    position: relative;
}

.credit-order-dialog__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted, #888);
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.credit-order-dialog__close:hover {
    color: var(--color-text-primary, #333);
}

.credit-order-dialog__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--color-text-primary, #222);
}

.credit-order-dialog__hint {
    font-size: 14px;
    color: var(--color-text-muted, #666);
    margin: 0 0 20px;
}

.credit-order-dialog__row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.credit-order-dialog__row .credit-order-phone {
    flex: 1;
    min-width: 160px;
    height: 48px;
    padding: 0 14px;
    border: 2px solid #dce8df;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.credit-order-dialog__row .credit-order-phone:focus {
    outline: none;
    border-color: var(--color-cta-primary);
}

.credit-order-submit {
    flex-shrink: 0;
    flex: 0 0 auto;
    min-width: 130px;
}
