/*
 * Grocero storefront additions. style.css is a pre-compiled Tailwind build of the
 * template, so utilities it does not contain are written here by hand.
 */

/* ---- Shop filter sidebar ------------------------------------------------ */

/* Thin visible scrollbar (replaces hide-scrollbar, which hid that the area scrolls). */
.gf-scroll {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.gf-scroll::-webkit-scrollbar { width: 6px; }
.gf-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
.gf-scroll::-webkit-scrollbar-track { background: transparent; }

/* Body of one filter accordion: capped height, scrolls on its own. */
.gf-panel {
    max-height: 15rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Both sides: a scroll container clips at its padding box, so without start
       padding the checkboxes (and their focus ring) are cut in LTR. */
    padding: 0.125rem 0.25rem;
    margin-block-start: 0.625rem;
}
.gf-panel > * + * { margin-block-start: 0.5rem; }
.gf-panel--free { max-height: none; overflow: visible; }

.gf-section { margin-block-end: 1.5rem; }
.gf-section > summary { list-style: none; }
.gf-section > summary::-webkit-details-marker { display: none; }

.gf-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1.25rem;
    color: #111;
}
.gf-option:hover { color: var(--color-primary, #0f6b3a); }
.gf-option-label { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.gf-option-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-count { flex-shrink: 0; color: #9ca3af; font-size: 0.75rem; }

.gf-input,
.gf-select {
    width: 100%;
    height: 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
    padding-inline: 0.75rem;
    font-size: 0.75rem;
    color: #111;
    outline: none;
}
.gf-input:focus,
.gf-select:focus { border-color: var(--color-primary, #0f6b3a); background: #fff; }
.gf-select { cursor: pointer; }
.gf-select[disabled] { opacity: 0.6; cursor: progress; }
.gf-label { display: block; font-size: 0.75rem; color: #6b7280; margin-block-end: 0.25rem; }
.gf-field + .gf-field { margin-block-start: 0.75rem; }
.gf-hint { font-size: 0.6875rem; color: #9ca3af; margin-block-start: 0.25rem; }

/* Searchable dropdown (author / publisher). The popup opens in the flow of the
   sidebar, not absolutely positioned, so the scrolling sidebar cannot clip it. */
.gf-combo-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: start;
}
.gf-combo-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-combo-current.is-placeholder { color: #6b7280; }
.gf-combo-button[aria-expanded="true"] { border-color: var(--color-primary, #fa2b2d); background: #fff; }
.gf-combo-button[aria-expanded="true"] i { rotate: 180deg; }
.gf-combo-popup {
    margin-block-start: 0.375rem;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    padding: 0.5rem;
}
.gf-combo-popup[hidden] { display: none; }
.gf-combo-search { height: 2rem; margin-block-end: 0.375rem; background: #fff; }
.gf-combo-list { max-height: 13rem; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0; list-style: none; }
.gf-combo-list li[role="option"] {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
    color: #111;
    cursor: pointer;
}
.gf-combo-list li[role="option"] > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-combo-list li[role="option"][aria-selected="true"],
.gf-combo-list li[role="option"].is-active { background: var(--color-brand-200, #ffe4e4); color: var(--color-primary, #fa2b2d); }
.gf-combo-list li[role="option"]:hover { background: #f9fafb; }
.gf-combo-status { padding: 0.375rem 0.625rem; font-size: 0.75rem; color: #9ca3af; }

/* Contact page consent checkbox (template's peer-checked styling, in the brand colour). */
.gf-checkbox svg { transform: scale(0); transition: transform 0.15s ease; }
.peer:checked + .gf-checkbox { background: var(--color-primary, #fa2b2d); border-color: var(--color-primary, #fa2b2d); }
.peer:checked + .gf-checkbox svg { transform: scale(1); }
.peer:focus-visible + .gf-checkbox { outline: 2px solid var(--color-primary, #fa2b2d); outline-offset: 2px; }

/* ---- Utilities the compiled template CSS lacks, used by Grocero views ---- */
/* rtl.css already mirrors left/right arrow, chevron, angle and caret icons in RTL;
   flipping those again here would point them back the wrong way. */
[dir="rtl"] .rtl\:rotate-180:not(.fa-arrow-right, .fa-arrow-right-long, .fa-chevron-right, .fa-angle-right, .fa-angles-right, .fa-caret-right, .fa-arrow-left, .fa-arrow-left-long, .fa-chevron-left, .fa-angle-left, .fa-angles-left, .fa-caret-left) { rotate: 180deg; }
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.max-h-60 { max-height: 15rem; }
.max-h-96 { max-height: 24rem; }
.col-span-full { grid-column: 1 / -1; }
.opacity-60 { opacity: 0.6; }
/* Alert tints used by the contact page and account pages. */
.bg-green\/10 { background-color: color-mix(in oklab, var(--color-green, #16a34a) 10%, transparent); }
.border-green\/20 { border-color: color-mix(in oklab, var(--color-green, #16a34a) 20%, transparent); }
.bg-danger-strong\/10 { background-color: color-mix(in oklab, var(--color-danger-strong, #dc2626) 10%, transparent); }
.border-danger-strong\/20 { border-color: color-mix(in oklab, var(--color-danger-strong, #dc2626) 20%, transparent); }


/* Home hero slider */
.gr-hero { padding-block: 16px 0; }
.gr-hero-frame { position: relative; }
.gr-hero-swiper { border-radius: 20px; overflow: hidden; }
.gr-hero-slide { position: relative; height: 260px; overflow: hidden; }
@media (min-width: 640px) { .gr-hero-slide { height: 380px; } }
@media (min-width: 1024px) { .gr-hero-slide { height: 520px; } }
.gr-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gr-hero-overlay { position: absolute; inset: 0; z-index: 1; background: rgba(0, 0, 0, .55); }
.gr-hero-content {
    position: relative; z-index: 2; height: 100%; max-width: 560px;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    padding-block: 20px; padding-inline: 20px 56px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
.gr-hero-badge {
    display: inline-flex; align-items: center; border-radius: 9999px; padding: 4px 16px;
    background: var(--color-primary, #16a34a); color: #fff; font-size: 14px; font-weight: 500; text-shadow: none;
}
.gr-hero-title {
    margin: 12px 0 8px; font-size: 24px; line-height: 1.3; font-weight: 700; color: #fff;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gr-hero-slogan {
    margin: 0; color: rgba(255, 255, 255, .85); font-weight: 500; line-height: 1.5; font-size: 14px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gr-hero-actions { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; text-shadow: none; }
.gr-hero-discount-value { font-size: 24px; line-height: 1; font-weight: 700; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.gr-hero-discount-note { margin: 4px 0 0; font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .85); }
.gr-hero-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    width: 40px; height: 40px; padding: 0;
}
.gr-hero-nav-prev { inset-inline-start: 12px; }
.gr-hero-nav-next { inset-inline-end: 12px; }
@media (min-width: 640px) {
    .gr-hero-overlay { background: linear-gradient(to right, rgba(0, 0, 0, .68) 0%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, 0) 100%); }
    [dir="rtl"] .gr-hero-overlay { background: linear-gradient(to left, rgba(0, 0, 0, .68) 0%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, 0) 100%); }
    .gr-hero-content { padding-inline: 48px 72px; }
    .gr-hero-title { font-size: 32px; }
    .gr-hero-slogan { font-size: 16px; }
    .gr-hero-nav { width: 44px; height: 44px; }
    .gr-hero-nav-prev { inset-inline-start: 16px; }
    .gr-hero-nav-next { inset-inline-end: 16px; }
}
@media (min-width: 1024px) {
    .gr-hero-content { padding-inline: 72px 88px; }
    .gr-hero-title { font-size: 44px; }
    .gr-hero-discount-value { font-size: 30px; }
}

/* Equal-height product cards */
.gr-product-card { height: 100%; display: flex; flex-direction: column; }
.gr-product-card__body { flex: 1 1 auto; display: flex; flex-direction: column; }
.gr-product-card__actions { margin-top: auto; margin-block-start: auto; padding-block-start: 1rem; }
.swiper-slide:has(> .gr-product-card) { height: auto; }
.swiper-wrapper { align-items: stretch; }
