/*
 * Bio Weinhandel — color overrides on top of o3-theme.
 * The parent ships Bootstrap 5 custom properties; we mostly retune those.
 * For the handful of selectors that hardcoded the old primary, we override
 * the Bootstrap variable they read from.
 */

:root {
    --bs-primary: #8eb61e;
    --bs-primary-rgb: 142, 182, 30;
    --bs-secondary: #f2f8e6;
    --bs-secondary-rgb: 242, 248, 230;
    --bs-light: #f4f8f9;
    --bs-focus-ring-color: rgba(142, 182, 30, 0.25);
}

.btn-primary {
    --bs-btn-bg: #8eb61e;
    --bs-btn-border-color: #8eb61e;
    --bs-btn-hover-bg: #546a16;
    --bs-btn-hover-border-color: #546a16;
    --bs-btn-active-bg: #546a16;
    --bs-btn-active-border-color: #546a16;
    --bs-btn-disabled-bg: #8eb61e;
    --bs-btn-disabled-border-color: #8eb61e;
}

.btn-outline-primary {
    --bs-btn-color: #8eb61e;
    --bs-btn-border-color: #8eb61e;
    --bs-btn-hover-bg: #8eb61e;
    --bs-btn-hover-border-color: #8eb61e;
    --bs-btn-active-bg: #8eb61e;
    --bs-btn-active-border-color: #8eb61e;
    --bs-btn-disabled-color: #8eb61e;
    --bs-btn-disabled-border-color: #8eb61e;
}

.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate {
    background-color: #8eb61e;
    border-color: #8eb61e;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: #8eb61e;
}

.pagination {
    --bs-pagination-active-bg: #8eb61e;
    --bs-pagination-active-border-color: #8eb61e;
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(142, 182, 30, 0.25);
}

.dropdown-menu {
    --bs-dropdown-link-active-bg: #8eb61e;
}

/* ---------- start-page / list product tiles ---------- */
/* Bottle photos in prod sit in compact 4-up tiles; cap height + use contain so
 * landscape and portrait crops both fit without dominating the page. */
.component__productbox-picture {
    max-height: 220px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.component__productbox-picture img {
    max-height: 220px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.component__productbox {
    padding: 0.75rem;
}
.component__productbox-title {
    font-size: 0.95rem;
    min-height: 2.4em;
}
.component__productbox-price {
    font-size: 1.05rem;
}

/* ---------- hide the header phone bar ---------- */
/* Prod doesn't surface the phone in the header; keep oxshops.OXTELEFON
 * set for emails/imprint but suppress the visible top bar.
 * Covers both layouts the parent emits: with and without search. */
.header__phone,
.header__topinfo > .d-none.d-lg-flex.align-items-center.gap-2,
.header__topinfo > div:first-of-type:not(.header__topinfo-cms):not(.header__topinfo-lang) {
    display: none !important;
}
/* belt-and-braces: any <a href="tel:"> inside <header> and its closest wrapper */
header a[href^="tel:"] { display: none !important; }
header :has(> a[href^="tel:"]) { display: none !important; }

/* With .header__topinfo removed, the search input would sit at y=0 and show its
 * gray #f4f8f9 background as a thin band at the top. Restore a bit of breathing
 * room above the header content. */
header > .container-xxl {
    padding-top: 1rem;
}

/* ---------- main nav: one row, no wrap, "Mehr" dropdown for overflow ---------- */
.header__mainnav {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.header__mainnav .navbar {
    min-width: 0;
    width: 100%;
}
.header__mainnav .navbar-collapse {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}
.bio-mainnav {
    flex-wrap: nowrap;
    /* Priority-plus classification is done at template-render time
     * (categorylist.tpl renders the first 10 items here and folds the
     * rest into the Mehr dropdown), so no JS measurement is needed and
     * nothing needs to be hidden on first paint. `overflow-x: clip` on
     * the parent .header__mainnav still belts-and-braces against any
     * accidental row overflow. */
    width: 100%;
    min-width: 0;
    gap: 0.25rem;
}
.header__mainnav { overflow-x: clip; overflow-y: visible; }
.bio-mainnav > .nav-item > .nav-link {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}
.bio-mainnav > .nav-mehr { margin-left: auto; }
.bio-mainnav .nav-mehr .dropdown-menu { right: 0; left: auto; }

/* Open dropdowns on hover (desktop only). The Mehr toggle keeps its click
 * behavior since clicking it has no destination. */
@media (hover: hover) and (pointer: fine) {
    .bio-mainnav .nav-item.dropdown:hover > .dropdown-menu,
    .bio-mainnav .nav-item.dropdown:focus-within > .dropdown-menu {
        display: block;
    }
    /* Small bridge above the menu so moving the cursor down doesn't close it. */
    .bio-mainnav .nav-item.dropdown > .dropdown-menu { margin-top: 0; }
}

/* Breathing room above the start-page welcome heading so it doesn't sit
 * right under the navigation row. */
.welcome-teaser { margin-top: 2.5rem; }

/* Footer Informationen list: match the 12px row-gap of the sibling
 * Service / Kategorien columns (those use <div>-margin spacing). */
.footer__box .information li { margin-bottom: 0.625rem; }
.footer__box .information li:last-child { margin-bottom: 0; }

/* ---------- category landing: subcategory tile grid ---------- */
.bio-subcat-grid { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.bio-subcat-card { border: 1px solid #dee2e6; border-radius: 4px; }
.bio-subcat-card .card-header {
    background: #f4f8f9;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
}
.bio-subcat-card-title {
    color: #121212;
    font-weight: 600;
    text-decoration: none;
}
.bio-subcat-card-title:hover { color: #546a16; }
.bio-subcat-card-cta { align-self: stretch; }
.bio-subcat-card-children li { margin-bottom: 0.25rem; }
.bio-subcat-card-children a {
    color: #495057;
    text-decoration: none;
}
.bio-subcat-card-children a:hover { color: #8eb61e; }

/* Suppress the legacy "Top Weine" block (`.topweinbox`) embedded inside
 * category long descriptions. The HTML still references an old bio-theme
 * image path that doesn't resolve in the new theme. */
.topweinbox { display: none !important; }


/* ---------- hide the on-hover secondary product image ---------- */
/* Category/start tiles show oxpic2 on hover; prod doesn't, so suppress it
 * and keep the primary photo stable across the hover. */
.component__productbox-picture img.img-hover,
.component__productbox-picture .img-hover { display: none !important; }

/* ---------- product detail hero image — cap height ---------- */
/* Wine bottle photos are tall and narrow; the splide slider's max-width:100%
 * blows a 156px-wide natural image up to 750px+ wide (and 3000px tall).
 * Constrain the slide image by height and stop the upscale. */
.details__picture-zoom-link .splide__img,
.details__picture-zoom-link img {
    max-height: 300px;
    width: auto !important;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

/* ---------- Bootstrap 5 accordion (missing from o3-theme bundle) ---------- */
/* o3-theme's main.min.css ships a subset of Bootstrap 5 — modal, button,
 * form-check, collapse, etc. are present, but `.accordion-*` got stripped.
 * Collapse JS still works, so we only need the visual rules here. Used
 * by the Netensio cookie-consent modal (per-category accordion). */
.accordion {
    --bio-accordion-border: 1px solid #dee2e6;
    --bio-accordion-btn-padding-y: 0.75rem;
    --bio-accordion-btn-padding-x: 1rem;
    --bio-accordion-body-padding-y: 0.75rem;
    --bio-accordion-body-padding-x: 1rem;
    --bio-accordion-btn-color: #212529;
    --bio-accordion-btn-bg: #fff;
    --bio-accordion-btn-active-color: #546a16;       /* darker bio green */
    --bio-accordion-btn-active-bg: #f2f8e6;          /* bs-secondary in bio palette */
    border: var(--bio-accordion-border);
    border-radius: 0.25rem;
}
.accordion-item {
    background-color: #fff;
    border-bottom: var(--bio-accordion-border);
}
.accordion-item:last-of-type { border-bottom: 0; }
.accordion-header { margin-bottom: 0; }
.accordion-button {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--bio-accordion-btn-padding-y) var(--bio-accordion-btn-padding-x);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bio-accordion-btn-color);
    text-align: left;
    background-color: var(--bio-accordion-btn-bg);
    border: 0;
    border-radius: 0;
    overflow-anchor: none;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.accordion-button:not(.collapsed) {
    color: var(--bio-accordion-btn-active-color);
    background-color: var(--bio-accordion-btn-active-bg);
    box-shadow: inset 0 -1px 0 var(--bio-accordion-border-color, #dee2e6);
}
.accordion-button:focus {
    z-index: 3;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(142, 182, 30, 0.25);
}
/* Chevron — SVG matches Bootstrap 5's default arrow shape. */
.accordion-button::after {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: auto;
    content: "";
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 1.25rem;
    transition: transform 0.2s ease-in-out;
}
.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23546a16'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
}
.accordion-body {
    padding: var(--bio-accordion-body-padding-y) var(--bio-accordion-body-padding-x);
}
