/**
 * KS Empty Cart — Frontend CSS
 *
 * IMPORTANT: This file styles ONLY hero, tiles, and CTA-band sections.
 * Product cards inherit ALL styling from theme + CSD custom snippets
 * (.product-main-wrap, .tre-linjers-produktinfo, .custom-stock-msg,
 * .custom-cart-btn, .wcb2b-quantity). We do NOT override product card
 * styling — that would break visual consistency with category pages.
 *
 * Version: 1.0.9
 */

/* =========================================================================
   WRAPPER
   ========================================================================= */
.ksec-wrap {
    margin: 0 auto;
}

/* =========================================================================
   HERO
   ========================================================================= */
.ksec-hero {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    padding: 56px 40px 48px;
    text-align: center;
    margin-bottom: 40px;
}

.ksec-hero-icon-wrap {
    width: 130px;
    height: 130px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(232,93,4,0.28);
    position: relative;
    color: #fff;
}

.ksec-hero-icon-ring {
    position: absolute;
    inset: -8px;
    border: 2px dashed rgba(232,93,4,0.25);
    border-radius: 50%;
    pointer-events: none;
}

.ksec-hero-icon svg,
.ksec-hero-icon img {
    width: 64px;
    height: 64px;
    display: block;
}

.ksec-hero-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.2;
}

.ksec-hero-sub {
    font-size: 16px;
    color: #6b7280;
    margin: 0 auto 32px;
    max-width: 520px;
    line-height: 1.5;
}

.ksec-hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================================================
   BUTTONS (used in hero + band)
   ========================================================================= */
.ksec-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    border: 1.5px solid transparent;
    line-height: 1;
    white-space: nowrap;
}

.ksec-btn:hover,
.ksec-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.1);
    text-decoration: none;
}

.ksec-btn-primary {
    background: #e85d04;
    color: #fff;
    border-color: #e85d04;
}

/* v1.0.9: inline style="color/background/border" must win over hover state.
   Hover only changes box-shadow + transform; colors stay as configured. */
.ksec-btn-primary:hover,
.ksec-btn-primary:focus {
    /* background, border-color, color all inherited from inline style attribute */
    filter: brightness(0.92);
}

.ksec-btn-secondary {
    background: #fff;
    color: #333;
    border-color: #d1d5db;
}

/* v1.0.9: keep inline colors on hover, only apply subtle brightness change */
.ksec-btn-secondary:hover,
.ksec-btn-secondary:focus {
    /* background, border-color, color all inherited from inline style attribute */
    filter: brightness(0.96);
}

.ksec-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* =========================================================================
   QUICK-ACCESS TILES
   ========================================================================= */
.ksec-tiles-heading {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 14px;
}

.ksec-tiles {
    display: grid;
    gap: 16px;
    margin-bottom: 56px;
}

.ksec-tiles-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ksec-tiles-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ksec-tiles-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ksec-tiles-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ksec-tiles-cols-6 { grid-template-columns: repeat(6, 1fr); }

.ksec-tile {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.ksec-tile:hover,
.ksec-tile:focus {
    border-color: #e85d04;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    text-decoration: none;
}

.ksec-tile-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: #fef3eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e85d04;
}

.ksec-tile-icon svg {
    width: 26px;
    height: 26px;
}

.ksec-tile-text {
    min-width: 0;
}

.ksec-tile-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    line-height: 1.3;
}

.ksec-tile-text small {
    display: block;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

/* =========================================================================
   SECTION HEADING (above products)
   ========================================================================= */
.ksec-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 24px;
    border-bottom: 1.5px solid #e5e7eb;
    padding-bottom: 12px;
}

.ksec-section-heading h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.ksec-section-heading a {
    font-size: 13px;
    color: #e85d04;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
}

.ksec-section-heading a:hover {
    text-decoration: underline;
}

/* =========================================================================
   PRODUCTS — we INTENTIONALLY do NOT style .ksec-products children.
   The <ul class="products">, <li class="product">, .product-main-wrap,
   .tre-linjers-produktinfo, .custom-stock-msg, .custom-cart-btn,
   .wcb2b-quantity classes are styled by the theme + CSD snippets, exactly
   matching the live category pages. Adding our own styles here would
   create visual divergence — that is the OPPOSITE of what we want.
   ========================================================================= */
.ksec-products {
    /* Just provide bottom margin to separate from the band */
    margin-bottom: 56px !important;
}

/* v1.0.8: Override KSSC's hardcoded grid-template-columns (which uses KSSC's
   own settings).  We respect the data-columns attribute on our wrapper so the
   admin's "Kolonner" setting on the KS Empty Cart page actually works.

   v1.0.7 BUG: selectors used ".ksec-products.ksec-products-wrap[data-columns]"
   but the wrapper only has class "ksec-products-wrap" (NOT also "ksec-products").
   v1.0.8: use ".kssc-products.ksec-products-wrap[data-columns]" which matches
   the actual DOM (KSSC's class + our marker class + attribute).

   Specificity (0,0,2,1) beats KSSC's (0,0,2,0) plain class chain. */
.kssc-products.ksec-products-wrap[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr) !important;
}
.kssc-products.ksec-products-wrap[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr) !important;
}
.kssc-products.ksec-products-wrap[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Mobile / tablet: respect KSSC's responsive breakpoints — but ensure our
   override doesn't lock layout at desktop sizes. Below 991px / 575px we drop
   to KSSC's tablet / mobile column counts (which are sensible defaults). */
@media (max-width: 991px) {
    .kssc-products.ksec-products-wrap[data-columns="3"],
    .kssc-products.ksec-products-wrap[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 575px) {
    .kssc-products.ksec-products-wrap[data-columns="2"],
    .kssc-products.ksec-products-wrap[data-columns="3"],
    .kssc-products.ksec-products-wrap[data-columns="4"] {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================================
   CTA BAND
   ========================================================================= */
.ksec-band {
    border: 1.5px solid #ffd0a8;
    padding: 32px 36px;
    margin: 56px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.ksec-band-text h3 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #1a1a1a;
    line-height: 1.3;
}

.ksec-band-text p {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.ksec-band-btn {
    white-space: nowrap;
    align-self: center;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 900px) {
    .ksec-tiles-cols-3,
    .ksec-tiles-cols-4,
    .ksec-tiles-cols-5,
    .ksec-tiles-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    .ksec-band {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .ksec-band-btn {
        justify-self: center;
    }
}

@media (max-width: 600px) {
    .ksec-tiles-cols-2,
    .ksec-tiles-cols-3,
    .ksec-tiles-cols-4,
    .ksec-tiles-cols-5,
    .ksec-tiles-cols-6 {
        grid-template-columns: 1fr;
    }
    .ksec-hero {
        padding: 40px 20px 36px;
    }
    .ksec-hero-title {
        font-size: 26px;
    }
    .ksec-hero-icon-wrap {
        width: 100px;
        height: 100px;
    }
    .ksec-hero-icon svg,
    .ksec-hero-icon img {
        width: 50px;
        height: 50px;
    }
    .ksec-band {
        padding: 24px 20px;
    }
    .ksec-band-text h3 {
        font-size: 18px;
    }
}
