/* =====================================================================
   DlinkShop redesign 2026-11 — home page (template/common/home.twig)
   Uses the variables from dl-header.css.
   ===================================================================== */

/* the old image slideshow is replaced by the hero below
   (to bring it back, delete this rule or turn the module off in admin) */
.dl-home .ds-slideshow { display: none !important; }

/* ---------- hero ---------- */
.dl-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
    margin: 28px 0 40px;
    font-family: var(--dl-font);
}
.dl-hero-main {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 460px;
    padding: 48px;
    border-radius: 28px;
    background: var(--dl-ink);
    color: #ffffff;
}
.dl-hero-ring {
    position: absolute;
    right: -120px;
    top: -120px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    border: 70px solid var(--dl-accent);
    opacity: .18;
    pointer-events: none;
}
.dl-hero-body {
    position: relative;
    flex: 1 1 340px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.dl-hero-tag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    background: #1B232C;
    font-size: 13px;
    font-weight: 700;
}
.dl-hero-tag-bf {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--dl-accent);
    color: var(--dl-ink);
    font-weight: 800;
    letter-spacing: .06em;
}
.dl-hero-title {
    margin: 0;
    color: #ffffff;
    font-family: var(--dl-font);
    font-size: 64px;
    line-height: .98;
    font-weight: 800;
    letter-spacing: -0.05em;
}
.dl-hero-title span { color: var(--dl-accent); white-space: nowrap; }
.dl-hero-text { margin: 0; max-width: 460px; color: #B9C2CC; font-size: 18px; line-height: 1.5; }
.dl-hero-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; }
.dl-hero-price-now { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.dl-hero-price-old { font-size: 18px; color: #8A94A0; }
.dl-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.dl-btn,
.dl-btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    padding: 0 28px;
    border-radius: 14px;
    font-family: var(--dl-font);
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
}
.dl-btn-accent,
.dl-btn-accent:visited { background: var(--dl-accent); color: var(--dl-ink); }
.dl-btn-accent:hover { background: #ffffff; color: var(--dl-ink); }
.dl-btn-ghost,
.dl-btn-ghost:visited { border: 1.5px solid #3A434E; color: #ffffff; font-weight: 700; }
.dl-btn-ghost:hover { border-color: var(--dl-accent); color: #ffffff; }

.dl-hero-media {
    position: relative;
    flex: 1 1 280px;
    min-width: 0;
    height: 360px;
    border-radius: 22px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.dl-hero-media img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.dl-hero-sticker {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: var(--dl-accent);
    color: var(--dl-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transform: rotate(-10deg);
}
.dl-hero-sticker span { font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.dl-hero-sticker b { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }

.dl-hero-side { display: flex; flex-direction: column; gap: 20px; }
.dl-hero-tile,
.dl-hero-tile:visited {
    flex: 1 1 0;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 28px;
    border-radius: 28px;
    color: var(--dl-ink);
    text-decoration: none;
    transition: box-shadow .2s, border-color .2s;
}
.dl-hero-tile-blue { background: var(--dl-accent-soft); }
.dl-hero-tile-white { background: #ffffff; border: 1.5px solid var(--dl-line); }
.dl-hero-tile:hover { color: var(--dl-ink); box-shadow: 0 10px 30px rgba(15, 20, 25, .08); }
.dl-hero-tile-white:hover { border-color: var(--dl-accent); }
.dl-hero-tile-label { color: var(--dl-link); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.dl-hero-tile-title { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.dl-hero-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 600; }
.dl-hero-tile-arrow {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--dl-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dl-hero-tile-arrow-dark { background: var(--dl-ink); }

/* ---------- tablet ---------- */
@media (max-width: 1199.98px) {
    .dl-hero { grid-template-columns: minmax(0, 1fr); }
    .dl-hero-side { flex-direction: row; }
    .dl-hero-tile { min-height: 180px; }
    .dl-hero-title { font-size: 54px; }
}
/* ---------- phones ---------- */
@media (max-width: 767.98px) {
    .dl-hero { gap: 12px; margin: 16px 0 28px; }
    .dl-hero-main { flex-direction: column; align-items: stretch; gap: 18px; min-height: 0; padding: 24px; border-radius: 24px; }
    .dl-hero-ring { right: -90px; top: -90px; width: 260px; height: 260px; border-width: 40px; }
    .dl-hero-body { gap: 14px; flex-basis: auto; }
    .dl-hero-tag { font-size: 12px; }
    .dl-hero-title { font-size: 40px; line-height: 1; }
    .dl-hero-text { font-size: 15px; }
    .dl-hero-price-now { font-size: 30px; }
    .dl-hero-price-old { font-size: 15px; }
    .dl-hero-actions { flex-direction: column; }
    .dl-btn { width: 100%; height: 52px; }
    .dl-hero-media { order: -1; flex: 0 0 auto; height: 220px; border-radius: 18px; padding: 16px; }
    .dl-hero-sticker { width: 78px; height: 78px; top: 12px; right: 12px; }
    .dl-hero-sticker span { font-size: 8px; }
    .dl-hero-sticker b { font-size: 22px; }
    .dl-hero-side { gap: 10px; }
    .dl-hero-tile { min-height: 150px; padding: 16px; border-radius: 20px; }
    .dl-hero-tile-label { font-size: 11px; }
    .dl-hero-tile-title { font-size: 17px; }
    .dl-hero-tile-foot > span:first-child { display: none; }
    .dl-hero-tile-foot { justify-content: flex-end; }
    .dl-hero-tile-arrow { flex-basis: 36px; height: 36px; }
}

/* ---------- service strip ---------- */
.dl-service {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: -20px 0 56px;
    font-family: var(--dl-font);
}
.dl-service-item,
.dl-service-item:visited {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--dl-gray-bg);
    color: var(--dl-ink);
    text-decoration: none;
    transition: background .2s;
}
.dl-service-item:hover { background: var(--dl-accent-soft); color: var(--dl-ink); }
.dl-service-icon {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dl-service-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-service-text b { font-size: 15px; font-weight: 700; }
.dl-service-text span { font-size: 13px; color: var(--dl-ink-2); }

/* ---------- section heading (shared by the next home blocks) ---------- */
.dl-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 24px;
    font-family: var(--dl-font);
}
.dl-section-title {
    margin: 0;
    color: var(--dl-ink);
    font-family: var(--dl-font);
    font-size: 38px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
}
.dl-section-more,
.dl-section-more:visited { color: var(--dl-link); font-size: 15px; font-weight: 700; text-decoration: none; }
.dl-section-more:hover { color: var(--dl-ink); }

/* ---------- categories: centered tiles, 68px icons ---------- */
.dl-cats { margin: 0 0 64px; }
.dl-cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
/* 14 categories = two full rows of 7 on desktop */
@media (min-width: 992px) {
    .dl-cats-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.dl-cat,
.dl-cat:visited {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 156px;
    padding: 22px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--dl-line);
    background: #ffffff;
    color: var(--dl-ink);
    text-align: center;
    text-decoration: none;
    font-family: var(--dl-font);
    transition: border-color .2s, box-shadow .2s;
}
.dl-cat:hover { border-color: var(--dl-accent); box-shadow: 0 8px 24px rgba(0, 168, 232, .14); color: var(--dl-ink); }
.dl-cat-icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: var(--dl-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.dl-cat:hover .dl-cat-icon { background: var(--dl-accent); }
.dl-cat-name { font-size: 16px; font-weight: 700; line-height: 1.25; }

@media (max-width: 1199.98px) {
    .dl-service { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -16px; }
}
@media (max-width: 767.98px) {
    .dl-service { grid-template-columns: minmax(0, 1fr); gap: 8px; margin: -12px 0 36px; }
    .dl-service-item { padding: 14px 16px; }
    .dl-section-head { margin-bottom: 16px; }
    .dl-section-title { font-size: 26px; }
    .dl-section-more { font-size: 14px; }
    .dl-cats { margin-bottom: 40px; }
    .dl-cats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .dl-cat { min-height: 0; gap: 10px; padding: 14px 6px; border: 0; background: var(--dl-gray-bg); border-radius: 16px; }
    .dl-cat-icon { width: 52px; height: 52px; border-radius: 14px; background: #ffffff; }
    .dl-cat-icon svg { width: 28px; height: 28px; }
    .dl-cat-name { font-size: 13px; line-height: 1.2; }
}

/* =====================================================================
   v3 — product modules on the home page ("Лідери продажу" etc.)
   The module template (octemplates/module/oct_products_modules.twig) is
   unchanged: these rules restyle its markup. Discount badge and the
   BLACK FRIDAY sticker are added by a small script in home.twig.
   ===================================================================== */
/* module title (the theme prints it as a plain div before the module) */
.dl-home > .py-3.fw-500.fsz-20 {
    margin: 0 0 8px;
    padding: 0 0 16px !important;
    color: var(--dl-ink) !important;
    font-family: var(--dl-font);
    font-size: 38px !important;
    font-weight: 800 !important;
    line-height: 1.1;
    letter-spacing: -0.035em;
}
/* grid: 5 cards per row on desktop */
.dl-home .ds-module.row {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 64px !important;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}
.dl-home .ds-module.row > .ds-module-item {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* card */
.dl-home .ds-module-item > .content-block {
    position: relative;
    gap: 10px;
    padding: 14px 14px 18px !important;
    border: 1.5px solid var(--dl-line) !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    font-family: var(--dl-font);
    transition: border-color .2s, box-shadow .2s;
}
.dl-home .ds-module-item > .content-block:hover {
    border-color: var(--dl-accent) !important;
    box-shadow: 0 10px 30px rgba(15, 20, 25, .08) !important;
}
/* the theme lays cards out horizontally on phones — keep them vertical */
.dl-home .ds-module-item > .content-block { flex-direction: column !important; }
.dl-home .ds-module-img { flex: none !important; width: 100% !important; max-width: none !important; }
.dl-home .ds-module-caption { flex: 1 1 auto !important; width: 100% !important; }
/* image plate: light gray, white photo background blended into it */
.dl-home .ds-module-img-box {
    height: 220px;
    border-radius: 16px;
    background: var(--dl-gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.dl-home .ds-module-img-box > a { display: flex !important; align-items: center; justify-content: center; width: 100%; height: 100%; }
.dl-home .ds-module-img-box img {
    width: auto !important;
    height: auto !important;
    max-width: 82%;
    max-height: 190px;
    object-fit: contain;
    mix-blend-mode: multiply;
}
/* wishlist / compare: round white buttons, top right */
.dl-home .ds-module-buttons {
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    gap: 6px;
    background: transparent !important;
    z-index: 2;
}
.dl-home .ds-module-button {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 20, 25, .08);
}
.dl-home .ds-module-button:hover { background: var(--dl-accent-soft) !important; }
/* stickers added by home.twig */
.dl-home .dl-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--dl-accent);
    color: var(--dl-ink);
    font-family: var(--dl-font);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}
.dl-home .dl-bf {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--dl-ink);
    color: #ffffff;
    font-family: var(--dl-font);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .06em;
}
.dl-home .dl-bf::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dl-accent); }
/* caption */
.dl-home .ds-module-caption { gap: 8px; padding: 0 !important; }
.dl-home .ds-module-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 63px;
    color: var(--dl-ink) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.3;
    text-decoration: none;
}
.dl-home .ds-module-title:hover { color: var(--dl-link) !important; }
.dl-home .ds-module-stock { font-size: 12px; font-weight: 600; }
.dl-home .ds-module-rating { display: none !important; }
/* price + cart in one row */
.dl-home .ds-module-price { padding-right: 60px; min-height: 52px; display: flex; flex-direction: column; justify-content: flex-end; }
.dl-home .ds-price-old { color: #6B7380 !important; font-size: 14px !important; font-weight: 500 !important; }
.dl-home .ds-price-new,
.dl-home .ds-module-price .ds-price-new { color: var(--dl-ink) !important; font-size: 21px !important; font-weight: 800 !important; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; }
.dl-home .ds-price-old { white-space: nowrap; }
.dl-home .ds-module-cart { position: absolute !important; right: 14px; bottom: 18px; }
.dl-home .ds-module-cart-btn {
    position: static !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: var(--dl-accent) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}
.dl-home .ds-module-cart-btn svg { width: 20px; height: 20px; margin: 0 !important; }
.dl-home .ds-module-cart-btn svg path { fill: var(--dl-ink) !important; }
.dl-home .ds-module-cart-btn .button-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.dl-home .ds-module-cart-btn:hover { background: var(--dl-ink) !important; }
.dl-home .ds-module-cart-btn:hover svg path { fill: #ffffff !important; }

@media (max-width: 1199.98px) {
    .dl-home .ds-module.row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dl-home > .py-3.fw-500.fsz-20 { font-size: 32px !important; }
}
@media (max-width: 991.98px) {
    .dl-home .ds-module.row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .dl-home > .py-3.fw-500.fsz-20 { font-size: 26px !important; padding-bottom: 12px !important; }
    .dl-home .ds-module.row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 40px !important; }
    .dl-home .ds-module-item > .content-block { padding: 8px 8px 12px !important; border-radius: 18px !important; gap: 8px; }
    .dl-home .ds-module-img-box { height: 150px; border-radius: 12px; }
    .dl-home .ds-module-img-box img { max-height: 130px; }
    .dl-home .ds-module-button { width: 32px !important; height: 32px !important; }
    .dl-home .dl-badge { top: 8px; left: 8px; padding: 4px 8px; font-size: 12px; }
    .dl-home .dl-bf { left: 8px; bottom: 8px; padding: 4px 7px; font-size: 9px; gap: 5px; }
    .dl-home .ds-module-title { font-size: 14px !important; min-height: 55px; }
    .dl-home .ds-price-old { font-size: 12px !important; }
    .dl-home .ds-price-new,
    .dl-home .ds-module-price .ds-price-new { font-size: 17px !important; }
    /* narrow cards: cart button goes under the price, full width */
    .dl-home .ds-module-price { padding-right: 0; min-height: 0; }
    .dl-home .ds-module-cart { position: static !important; }
    .dl-home .ds-module-cart-btn { width: 100% !important; height: 42px !important; min-width: 0 !important; border-radius: 12px !important; }
}

/* =====================================================================
   v4 — "Відгуки" (latest reviews module) on the home page, per mockup:
   gray cards, product photo on a white tile, blue rating label
   ===================================================================== */
.dl-home .ds-last-reviews.row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0 !important;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}
.dl-home .ds-last-reviews.row > * {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.dl-home .ds-last-reviews-item > .content-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px !important;
    border: 0 !important;
    border-radius: 22px !important;
    background: var(--dl-gray-bg) !important;
    box-shadow: none !important;
    font-family: var(--dl-font);
}
.dl-home .ds-last-reviews-item-top { margin: 0 !important; padding: 0 !important; border: 0 !important; align-items: flex-start; }
.dl-home .ds-last-reviews-item-img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.dl-home .ds-last-reviews-item-img img { width: 60px !important; height: 60px !important; object-fit: contain; }
.dl-home .ds-last-reviews-item-img-label {
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -10px !important;
    transform: translateX(-50%);
    gap: 3px;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: var(--dl-accent) !important;
    color: var(--dl-ink) !important;
    font-size: 11px !important;
    font-weight: 800;
}
.dl-home .ds-last-reviews-item-img-label svg path { fill: var(--dl-ink) !important; }
.dl-home .ds-last-reviews-item-info { min-width: 0; margin-left: 14px !important; }
.dl-home .ds-last-reviews-item-author { margin-bottom: 2px !important; color: var(--dl-ink) !important; font-size: 15px !important; font-weight: 700 !important; }
.dl-home .ds-last-reviews-item-date { margin-bottom: 8px !important; color: #6B7380 !important; font-size: 12px !important; }
.dl-home .ds-last-reviews-item-info > a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--dl-link) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.35;
    text-decoration: none !important;
}
.dl-home .ds-last-reviews-item-info > a:hover { color: var(--dl-ink) !important; }
.dl-home .ds-last-reviews-item .ds-module-rating { display: none !important; }
.dl-home .ds-last-reviews-item-text {
    color: #2B323C !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.55;
}
@media (max-width: 1199.98px) {
    .dl-home .ds-last-reviews.row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .dl-home .ds-last-reviews.row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .dl-home .ds-last-reviews-item > .content-block { padding: 18px !important; border-radius: 18px !important; }
}

/* ---------- v5: hero without the side tiles — Black Friday card full width ---------- */
.dl-hero { grid-template-columns: minmax(0, 1fr) !important; }
.dl-hero-main { gap: 48px; padding: 56px 64px; }
.dl-hero-body { flex: 1 1 420px; }
.dl-hero-text { max-width: 560px; }
.dl-hero-media { flex: 0 1 560px; height: 380px; }
@media (max-width: 1199.98px) {
    .dl-hero-main { gap: 32px; padding: 48px; }
    .dl-hero-media { flex-basis: 380px; height: 340px; }
}
@media (max-width: 767.98px) {
    .dl-hero-main { gap: 18px; padding: 24px; }
    .dl-hero-media { flex: 0 0 auto; height: 220px; }
}
