/*
 * Fyringsvakta shop.
 *
 * Styles the shop front page and product cards added or kept by
 * includes/shop.php. Selectors are scoped to body classes that only exist
 * while the shop module is active:
 * - .few-shop-cards: product grid and cards (front page and category archives),
 * - .few-shop: hero, purchasing paths, category index and grid headings
 *   (front page).
 *
 * The content panel is GeneratePress's light container (#f2f2f0); the dark
 * elements echo the site header (assets/css/header.css).
 */

.few-shop-cards {
    --few-s-text: #111111;
    --few-s-soft: #3b3c38;
    --few-s-muted: #62645e;
    --few-s-line: #d6d5cf;
    --few-s-dark: #1c1b19;
    --few-s-dark-hover: #2a2926;
    --few-s-on-dark: #ecebe6;
    --few-s-on-dark-muted: #a3a59e;
    --few-s-accent: #6f7f5f;
    --few-s-button: #7a6e4e;
    --few-s-button-hover: #5f553c;
}

/* Hero: the standalone Fyringsvakta product */

.few-shop .woocommerce-products-header {
    margin: 0;
    padding: 0;
}

.few-shop .few-shop-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    margin: 0 0 64px;
}

.few-shop .few-shop-featured--text {
    grid-template-columns: minmax(0, 1fr);
}

.few-shop .few-shop-featured__main {
    display: block;
    line-height: 0;
}

.few-shop .few-shop-featured__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: var(--few-s-dark);
}

.few-shop .few-shop-featured__thumbs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.few-shop .few-shop-featured__thumbs li {
    margin: 0;
}

.few-shop button.few-shop-featured__thumb {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    line-height: 0;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.few-shop button.few-shop-featured__thumb:hover,
.few-shop button.few-shop-featured__thumb[aria-pressed="true"] {
    background: none;
    opacity: 1;
}

.few-shop button.few-shop-featured__thumb[aria-pressed="true"] {
    outline: 2px solid var(--few-s-accent);
    outline-offset: -2px;
}

.few-shop .few-shop-featured__thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.few-shop button.few-shop-featured__thumb:focus-visible {
    outline: 2px solid var(--few-s-text);
    outline-offset: 2px;
}

.few-shop .few-shop-featured__body {
    padding-top: 4px;
}

.few-shop .few-shop-featured__title.page-title {
    margin: 0 0 14px;
    font-size: clamp(36px, 4.2vw, 52px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.few-shop .few-shop-featured__head {
    margin: 0 0 32px;
}

.few-shop .few-shop-intro {
    max-width: 46ch;
    margin: 0;
    color: var(--few-s-soft);
    font-size: 18px;
    line-height: 1.5;
}

.few-shop .few-shop-intro p {
    margin: 0 0 12px;
}

.few-shop .few-shop-intro p:last-child {
    margin-bottom: 0;
}

/* Opening question: leads the intro, below the heading in size. */
.few-shop .few-shop-intro .few-shop-intro__hook {
    margin-bottom: 8px;
    color: var(--few-s-text);
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
}

.few-shop .few-shop-intro .few-shop-intro__note {
    color: var(--few-s-muted);
    font-size: 15px;
}

/* Purchasing paths: the hero's only calls to action, as two rows of equal
   weight. */

.few-shop .few-shop-paths {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--few-s-line);
    list-style: none;
}

.few-shop .few-shop-paths li {
    margin: 0;
    border-bottom: 1px solid var(--few-s-line);
}

.few-shop .inside-article a.few-shop-path {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 2px;
    color: var(--few-s-text);
    text-decoration: none;
}

.few-shop .few-shop-path__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.few-shop .few-shop-path__title {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.few-shop .few-shop-path__sub {
    color: var(--few-s-muted);
    font-size: 15px;
    line-height: 1.35;
}

.few-shop .few-shop-path__arrow {
    flex-shrink: 0;
    color: var(--few-s-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

.few-shop .inside-article a.few-shop-path:hover .few-shop-path__title {
    text-decoration: underline;
    text-decoration-color: var(--few-s-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.few-shop .inside-article a.few-shop-path:hover .few-shop-path__arrow {
    color: var(--few-s-text);
    transform: translateX(3px);
}

.few-shop .inside-article a.few-shop-path:focus-visible {
    outline: 2px solid var(--few-s-text);
    outline-offset: 2px;
}

/* Category index ("Utforsk sortimentet"): type only, so it never reads as a
   product card. Four cells in a row where the names have room, two by two
   in between, a list on narrow screens. */

.few-shop .few-shop-nav {
    margin: 0 0 48px;
    container-type: inline-size;
}

.few-shop .few-shop-nav__title {
    margin: 0 0 16px;
    color: var(--few-s-text);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.few-shop .few-shop-nav__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--few-s-line);
    list-style: none;
}

.few-shop .few-shop-nav__list li {
    margin: 0;
    border-bottom: 1px solid var(--few-s-line);
}

.few-shop .inside-article a.few-shop-nav__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "name arrow"
        "count arrow";
    align-content: start;
    gap: 6px 12px;
    height: 100%;
    box-sizing: border-box;
    padding: 18px 16px 20px;
    color: var(--few-s-text);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.few-shop .few-shop-nav__name {
    grid-area: name;
    min-width: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.few-shop .few-shop-nav__count {
    grid-area: count;
    color: var(--few-s-muted);
    font-size: 14px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.few-shop .few-shop-nav__arrow {
    grid-area: arrow;
    margin-top: 3px;
    color: var(--few-s-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

@container (max-width: 760px) {
    .few-shop .few-shop-nav__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* One row per category, the arrow centred beside name and count. */
@container (max-width: 520px) {
    .few-shop .few-shop-nav__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .few-shop .inside-article a.few-shop-nav__item {
        align-items: center;
        gap: 2px 12px;
        min-height: 56px;
        padding: 12px 4px 12px 2px;
    }

    .few-shop .few-shop-nav__name {
        font-size: 17px;
    }

    .few-shop .few-shop-nav__count {
        font-size: 13px;
    }

    .few-shop .few-shop-nav__arrow {
        margin-top: 0;
    }
}

.few-shop .inside-article a.few-shop-nav__item:hover .few-shop-nav__name {
    text-decoration: underline;
    text-decoration-color: var(--few-s-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.few-shop .inside-article a.few-shop-nav__item:hover .few-shop-nav__arrow {
    color: var(--few-s-text);
    transform: translateX(3px);
}

/* Open: its products are shown below. */
.few-shop .inside-article a.few-shop-nav__item[aria-current] {
    background-color: var(--few-s-dark);
    color: var(--few-s-on-dark);
}

@container (max-width: 520px) {
    .few-shop .inside-article a.few-shop-nav__item[aria-current] {
        padding-left: 12px;
    }
}

.few-shop .inside-article a.few-shop-nav__item[aria-current] .few-shop-nav__name {
    text-decoration: none;
}

.few-shop .inside-article a.few-shop-nav__item[aria-current] .few-shop-nav__count {
    color: var(--few-s-on-dark-muted);
}

.few-shop .inside-article a.few-shop-nav__item[aria-current] .few-shop-nav__arrow {
    color: var(--few-s-on-dark);
    transform: rotate(90deg);
}

.few-shop .inside-article a.few-shop-nav__item:focus-visible {
    outline: 2px solid var(--few-s-text);
    outline-offset: 2px;
}

/* Grid heading: the open category, its product count and "Lukk". */

.few-shop .few-shop-results:not([hidden]) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 24px;
    scroll-margin-top: 24px;
}

.few-shop .few-shop-results__head:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    min-width: 0;
}

.few-shop .few-shop-results__title {
    margin: 0;
    color: var(--few-s-text);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
}

.few-shop .few-shop-results__count {
    color: var(--few-s-muted);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.few-shop button.few-shop-results__close {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    margin: 0 -8px 0 0;
    padding: 10px 8px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--few-s-muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
}

.few-shop button.few-shop-results__close:hover,
.few-shop button.few-shop-results__close:focus {
    background: none;
    color: var(--few-s-text);
}

.few-shop button.few-shop-results__close:hover {
    text-decoration: underline;
    text-decoration-color: var(--few-s-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.few-shop button.few-shop-results__close:focus-visible {
    outline: 2px solid var(--few-s-text);
    outline-offset: 2px;
}

/* Product grid: CSS grid instead of WooCommerce's floats, so cards line up
   whichever of them are hidden. */

.few-shop-cards ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 28px;
    margin: 0 0 24px;
}

.few-shop-cards ul.products::before,
.few-shop-cards ul.products::after {
    display: none;
}

.woocommerce.few-shop-cards ul.products li.product,
.woocommerce.few-shop-cards ul.products[class*="columns-"] li.product {
    display: flex;
    flex-direction: column;
    float: none;
    width: auto;
    margin: 0;
    clear: none;
}

.few-shop-cards ul.products li.product .woocommerce-loop-product__link {
    display: flex;
    flex: 1;
    flex-direction: column;
    color: var(--few-s-text);
    text-decoration: none;
}

.woocommerce.few-shop-cards ul.products li.product a img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 0 16px;
    object-fit: cover;
    background-color: #fff;
    box-shadow: inset 0 0 0 1px var(--few-s-line);
    transition: opacity 0.15s ease;
}

.woocommerce.few-shop-cards ul.products li.product a:hover img {
    opacity: 0.88;
}

.woocommerce.few-shop-cards ul.products li.product .woocommerce-loop-product__title {
    margin: 0 0 6px;
    padding: 0;
    color: var(--few-s-text);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
}

.woocommerce.few-shop-cards ul.products li.product .price {
    margin: 0 0 16px;
    color: var(--few-s-soft);
    font-size: 15px;
    font-weight: 400;
}

.woocommerce.few-shop-cards ul.products li.product .price del {
    color: var(--few-s-muted);
}

.woocommerce.few-shop-cards ul.products li.product .price ins {
    font-weight: 500;
    text-decoration: none;
}

.woocommerce.few-shop-cards ul.products li.product .onsale {
    top: 10px;
    left: 10px;
    right: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 5px 9px;
    border-radius: 0;
    background-color: var(--few-s-dark);
    color: var(--few-s-on-dark);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

/* Buttons: the same olive as the rest of the shop, aligned at the card foot. */
.woocommerce.few-shop-cards ul.products li.product .button {
    align-self: flex-start;
    margin-top: auto;
    padding: 11px 16px;
    border: 0;
    border-radius: 2px;
    background-color: var(--few-s-button);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.woocommerce.few-shop-cards ul.products li.product .button:hover {
    background-color: var(--few-s-button-hover);
    color: #fff;
}

.woocommerce.few-shop-cards ul.products li.product .added_to_cart {
    margin-top: 8px;
    color: var(--few-s-button);
    font-size: 14px;
}

.woocommerce.few-shop-cards ul.products li.product a:focus-visible {
    outline: 2px solid var(--few-s-text);
    outline-offset: 3px;
}

/* Front page: the grid appears once a category is chosen in the index
   (body.few-shop-open, set by shop.js) and shows only that category. */
body.few-shop:not(.few-shop-open) ul.products {
    display: none;
}

body.few-shop ul.products[class] li.product.few-shop-out {
    display: none;
}

@media (max-width: 1024px) {
    .few-shop-cards ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .few-shop .few-shop-featured {
        gap: 32px;
    }
}

@media (max-width: 860px) {
    .few-shop .few-shop-featured {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        margin-bottom: 48px;
    }

    /* Heading and intro first, then the photos, then the paths. */
    .few-shop .few-shop-featured__body {
        display: contents;
    }

    .few-shop .few-shop-featured__head {
        order: -1;
        margin: 0;
    }
}

@media (max-width: 768px) {
    .few-shop .few-shop-intro {
        font-size: 16px;
    }

    .few-shop .few-shop-intro .few-shop-intro__hook {
        font-size: 18px;
    }

    .few-shop .few-shop-intro .few-shop-intro__note {
        font-size: 14px;
    }

    .few-shop .few-shop-featured__thumbs {
        gap: 6px;
        margin-top: 6px;
    }

    .few-shop .inside-article a.few-shop-path {
        padding: 16px 2px;
    }

    .few-shop .few-shop-path__title {
        font-size: 17px;
    }

    .few-shop .few-shop-path__sub {
        font-size: 14px;
    }

    .few-shop .few-shop-nav {
        margin-bottom: 40px;
    }

    .few-shop .few-shop-nav__title {
        margin-bottom: 12px;
        font-size: 20px;
    }

    .few-shop .few-shop-results__title {
        font-size: 22px;
    }

    .few-shop .few-shop-results__count {
        font-size: 14px;
    }

    .few-shop-cards ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 14px;
    }

    .woocommerce.few-shop-cards ul.products li.product a img {
        margin-bottom: 12px;
    }

    .woocommerce.few-shop-cards ul.products li.product .woocommerce-loop-product__title {
        font-size: 15px;
    }

    .woocommerce.few-shop-cards ul.products li.product .price {
        margin-bottom: 12px;
        font-size: 14px;
    }

    .woocommerce.few-shop-cards ul.products li.product .button {
        align-self: stretch;
        padding: 10px 8px;
        font-size: 14px;
    }
}

/* A space as thousands separator ("2 100 kr") must not break a price. */
.few-shop-cards .woocommerce-Price-amount {
    white-space: nowrap;
}
