/* ==========================================================================
   Дизайн „онлайн магазин" за модула Оферти
   Зарежда се само когато в Настройки на оферти е избран дизайн
   „Тип продукт в онлайн магазин" или „По 3 оферти на ред – тип онлайн магазин"
   (templates/header.php → $CMS['shop_design']). Ползва променливите на темата
   от style.css, затова скиновете продължават да важат.
   ========================================================================== */

.shop-wrap {
    --shop-line:   var(--border, #e5e7eb);
    --shop-soft:   var(--surface, #f9fafb);
    --shop-muted:  #5b6472;              /* 5.9:1 върху бяло */
    --shop-price:  var(--primary, #111827);
    --shop-sale:   #dc2626;
    --shop-accent: var(--accent, #2563eb);
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

/* ── Breadcrumbs ─────────────────────────────────────────── */
.shop-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--shop-muted);
    margin-bottom: 18px;
}
.shop-crumbs a { color: var(--shop-muted); text-decoration: none; }
.shop-crumbs a:hover { color: var(--shop-accent); text-decoration: underline; }
.shop-crumbs [aria-current] { color: var(--text, #111827); font-weight: 600; }

/* ── Заглавие на списъка ─────────────────────────────────── */
.shop-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--shop-line);
}
.shop-head__title {
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -.01em;
}
.shop-head__desc { margin: 8px 0 0; color: var(--shop-muted); max-width: 720px; }
.shop-head__count {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--shop-muted);
    background: var(--shop-soft);
    border: 1px solid var(--shop-line);
    border-radius: 999px;
    padding: 6px 14px;
}

/* ── Списък: странична колона + мрежа ────────────────────── */
.shop-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}
@media (min-width: 992px) {
    .shop-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
    .shop-layout--full { grid-template-columns: minmax(0, 1fr); }
}

.shop-side__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--shop-muted);
    margin: 0 0 10px;
}
.shop-side__list { list-style: none; margin: 0; padding: 0; }
.shop-side__list a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm, 8px);
    color: var(--text, #111827);
    text-decoration: none;
    font-size: 15px;
    transition: background .15s ease, color .15s ease;
}
.shop-side__list a:hover { background: var(--shop-soft); }
.shop-side__list a.is-active {
    background: var(--shop-price);
    color: #fff;
    font-weight: 600;
}
/* На мобилни категориите стават хоризонтална лента */
@media (max-width: 991px) {
    .shop-side__title { display: none; }
    .shop-side__list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .shop-side__list::-webkit-scrollbar { display: none; }
    .shop-side__list a {
        white-space: nowrap;
        border: 1px solid var(--shop-line);
        border-radius: 999px;
        font-size: 14px;
        padding: 7px 14px;
    }
}

/* ── Мрежа с продукти ────────────────────────────────────── */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
@media (min-width: 768px)  { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; } }
@media (min-width: 1100px) { .shop-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ── Продуктова карта ────────────────────────────────────── */
.shop-card {
    display: flex;
    flex-direction: column;
    background: var(--bg, #fff);
    border: 1px solid var(--shop-line);
    border-radius: var(--radius, 12px);
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.shop-card:hover {
    border-color: transparent;
    box-shadow: 0 12px 28px -12px rgba(15, 23, 42, .25);
    transform: translateY(-2px);
}
.shop-card__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-bottom: 1px solid var(--shop-line);
}
.shop-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8%;
    transition: transform .35s ease;
}
.shop-card:hover .shop-card__media img { transform: scale(1.04); }
.shop-card__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #cbd5e1;
    background: var(--shop-soft);
}
.shop-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    padding: 4px 9px;
    border-radius: 6px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}
.shop-card__badge--sale { background: var(--shop-sale); }

.shop-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
    padding: 14px 14px 16px;
}
.shop-card__cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--shop-muted);
}
.shop-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shop-card__title a { color: var(--text, #111827); text-decoration: none; }
.shop-card__title a:hover { color: var(--shop-accent); }
.shop-card__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--shop-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shop-card__foot {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.shop-card__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.shop-card__price small { font-size: 12px; color: var(--shop-muted); }
.shop-card__price-now { font-size: 19px; font-weight: 800; color: var(--shop-price); }
.shop-card__price-old { font-size: 13px; color: var(--shop-muted); text-decoration: line-through; }
.shop-card__price-note { font-size: 14px; font-weight: 700; color: var(--shop-price); }
.shop-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-sm, 8px);
    background: var(--shop-soft);
    border: 1px solid var(--shop-line);
    color: var(--text, #111827);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.shop-card:hover .shop-card__btn,
.shop-card__btn:focus-visible {
    background: var(--shop-price);
    border-color: var(--shop-price);
    color: #fff;
}
@media (max-width: 480px) {
    .shop-card__body { padding: 10px 10px 12px; }
    .shop-card__title { font-size: 14px; }
    .shop-card__desc { display: none; }
    .shop-card__price-now { font-size: 16px; }
}

.shop-empty {
    text-align: center;
    padding: 64px 16px;
    color: var(--shop-muted);
    border: 1px dashed var(--shop-line);
    border-radius: var(--radius, 12px);
}
.shop-empty svg { color: #cbd5e1; margin-bottom: 8px; }
.shop-desc-after { margin-top: 32px; color: var(--shop-muted); line-height: 1.7; }

/* ── Бутони ──────────────────────────────────────────────── */
.shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 12px 20px;
    border-radius: var(--radius-sm, 8px);
    border: 2px solid var(--shop-price);
    background: #fff;
    color: var(--shop-price);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .1s ease;
}
.shop-btn:hover { background: var(--shop-soft); }
.shop-btn:active { transform: translateY(1px); }
.shop-btn--primary { background: var(--shop-price); color: #fff; }
.shop-btn--primary:hover { background: var(--shop-accent); border-color: var(--shop-accent); }
.shop-btn:focus-visible,
.shop-card__btn:focus-visible,
.shop-side__list a:focus-visible { outline: 3px solid var(--shop-accent); outline-offset: 2px; }

/* ── Страница на продукт ─────────────────────────────────── */
.shop-product__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
@media (min-width: 900px) {
    .shop-product__top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; }
    .shop-buy { position: sticky; top: calc(var(--header-h, 64px) + 16px); }
}

.shop-gallery__main.offer-media-main {
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 1px solid var(--shop-line);
    border-radius: var(--radius-lg, 20px);
}
.shop-gallery__main.offer-media-main img {
    object-fit: contain;
    padding: 6%;
}
.shop-gallery__thumbs.offer-thumbs { margin-top: 12px; }
.shop-gallery__thumbs .offer-thumb { background: #fff; }
.shop-gallery__thumbs .offer-thumb img { object-fit: contain; padding: 4px; }

.shop-buy__title {
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 6px 0 16px;
    letter-spacing: -.01em;
}
.shop-buy__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding: 16px 0;
    border-top: 1px solid var(--shop-line);
    border-bottom: 1px solid var(--shop-line);
    margin-bottom: 18px;
}
.shop-buy__price small { color: var(--shop-muted); font-size: 14px; }
.shop-buy__price-now { font-size: 32px; font-weight: 800; color: var(--shop-price); line-height: 1; }
.shop-buy__price-old { font-size: 17px; color: var(--shop-muted); text-decoration: line-through; }
.shop-buy__price-note { font-size: 22px; font-weight: 800; color: var(--shop-price); }
.shop-buy__sale { position: static; }

.shop-buy__summary {
    color: var(--text, #111827);
    line-height: 1.65;
    margin-bottom: 22px;
}
.shop-buy__summary p { margin: 0 0 10px; }

.shop-buy__actions.offer-contact-apps {
    display: grid;
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}
.shop-buy__apps { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--shop-line);
    background: var(--shop-soft);
    color: var(--text, #111827);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.shop-chip:hover { border-color: var(--shop-price); }

.shop-buy__trust {
    list-style: none;
    margin: 0;
    padding: 16px;
    display: grid;
    gap: 12px;
    background: var(--shop-soft);
    border: 1px solid var(--shop-line);
    border-radius: var(--radius, 12px);
    font-size: 14px;
}
.shop-buy__trust li { display: flex; align-items: center; gap: 10px; }
.shop-buy__trust svg { flex-shrink: 0; color: var(--shop-accent); }

/* ── Описание и технически данни ─────────────────────────── */
.shop-details,
.shop-related { margin-top: 56px; }
.shop-details__title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--shop-price);
    display: inline-block;
}
.shop-details__body {
    line-height: 1.75;
    max-width: 980px;
}
.shop-details__body h2,
.shop-details__body h3 { margin: 28px 0 12px; font-size: 1.15rem; font-weight: 800; }
.shop-details__body ul { padding-left: 20px; }
.shop-details__body li { margin-bottom: 6px; }
/* Таблиците с технически данни — четими и на мобилен (хоризонтален скрол) */
.shop-details__body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--shop-line);
    border-radius: var(--radius, 12px);
    font-size: 14px;
    margin: 12px 0 20px;
}
.shop-details__body table tbody,
.shop-details__body table thead { display: table; width: 100%; border-collapse: collapse; }
.shop-details__body th,
.shop-details__body td {
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--shop-line);
    white-space: nowrap;
}
.shop-details__body th {
    background: var(--shop-soft);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--shop-muted);
}
.shop-details__body tr:last-child td { border-bottom: 0; }
.shop-details__body tr:nth-child(even) td { background: #fbfcfd; }
.shop-details__body td:first-child { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    .shop-card, .shop-card__media img, .shop-btn { transition: none; }
    .shop-card:hover, .shop-card:hover .shop-card__media img { transform: none; }
}
@media (max-width: 480px) {
    .shop-card__btn { padding: 9px 8px; font-size: 13px; white-space: nowrap; gap: 4px; }
}
