/**
 * Donzella SEO Suite — Grape / Region Frontend Styles
 * Path: inc/frontend/assets/css/dse-grape-region.css
 *
 * Targets:
 * - .dse-directory--grape (Shop by Grape grid)
 * - .dse-directory--region (Shop by Region grid)
 * - .dse-grape-card        (grape tiles)
 * - .dse-grape-hero        (single grape hero)
 * - .dse-grape-wines       (product list section)
 * - .dse-filter-bar + children
 *
 * Everything is namespaced with .dse- to avoid fighting the theme/Divi.
 */

/* -------------------------------------------------------------------------
   0) Generic layout helpers
   ------------------------------------------------------------------------- */

.dse-directory {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 2rem 1.5rem 4rem;
}

@media (min-width: 960px) {
    .dse-directory {
        padding: 3rem 1.5rem 5rem;
    }
}

.dse-directory h1,
.dse-grape-landing h1,
.dse-grape-landing h2 {
    letter-spacing: 0.03em;
}

/* Text helpers */

.dse-empty,
.dse-error {
    font-size: 0.95rem;
    color: #777;
    margin: 1.5rem 0;
}

/* -------------------------------------------------------------------------
   1) Filter bar (shared by grape/region)
   ------------------------------------------------------------------------- */

.dse-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0 2rem;
    border-radius: 999px;
    background: #f7f5f2;
    border: 1px solid #e3ded7;
}

.dse-filter-bar__group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dse-filter-bar__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: #555;
}

/* Pills / chips */

.dse-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 0.8rem;
    cursor: pointer;
    background: #fff;
    color: #333;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
        box-shadow 0.15s ease, transform 0.08s ease;
}

.dse-chip--active,
.dse-chip.is-active {
    background: #111;
    color: #fff;
    border-color: #111;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.dse-chip:hover {
    border-color: #111;
}

/* Price range mini-label */

.dse-filter-bar__range-label {
    font-size: 0.8rem;
    color: #555;
}

/* Reset link */

.dse-filter-bar__reset {
    font-size: 0.8rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #555;
}

.dse-filter-bar__reset:hover {
    color: #000;
}

/* Sparkling toggle (if present) */

.dse-filter-bar__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #444;
}

/* -------------------------------------------------------------------------
   2) Grape directory grid
   ------------------------------------------------------------------------- */

.dse-grape-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.75rem;
    margin-top: 1.5rem;
}

@media (min-width: 1200px) {
    .dse-grape-directory-grid {
        gap: 2rem;
    }
}

/* -------------------------------------------------------------------------
   3) Grape cards
   ------------------------------------------------------------------------- */

.dse-grape-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.dse-grape-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.08);
}

.dse-grape-card__image {
    position: relative;
    padding: 1.25rem 1.25rem 0.5rem;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dse-grape-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.18));
}

/* Fallback if no image available (broken URL) */
.dse-grape-card__image img:not([src]),
.dse-grape-card__image img[src=""] {
    display: none;
}

.dse-grape-card__image::before {
    content: "";
    position: absolute;
    inset: auto 20% 12px;
    height: 24px;
    border-radius: 999px;
    background: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.12), transparent);
    opacity: 0.7;
}

/* Card body */

.dse-grape-card__body {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dse-grape-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dse-grape-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.dse-grape-card__meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dse-grape-card__pill {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
}

.dse-grape-card__pill--colour {
    background: #111;
    color: #fff;
    border-color: #111;
}

.dse-grape-card__origin {
    font-size: 0.78rem;
    color: #666;
}

/* Stats row */

.dse-grape-card__stats {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.35rem;
    gap: 0.75rem;
}

.dse-grape-card__count {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

.dse-grape-card__price {
    font-size: 0.85rem;
    color: #444;
}

/* Flavour / pairing */

.dse-grape-card__flavour,
.dse-grape-card__pairing {
    font-size: 0.82rem;
    line-height: 1.4;
    color: #555;
    margin: 0.1rem 0;
}

.dse-grape-card__flavour strong,
.dse-grape-card__pairing strong {
    font-weight: 600;
}

/* Badges */

.dse-grape-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.1rem;
}

.dse-grape-card__popularity {
    font-size: 0.75rem;
    color: #666;
}

.dse-grape-card__badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #f3f0ea;
    color: #555;
}

/* Actions */

.dse-grape-card__actions {
    margin-top: 0.9rem;
}

.dse-grape-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: #111;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.08s ease,
        box-shadow 0.15s ease;
}

.dse-grape-card__button:hover {
    background: #1f1f1f;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

/* -------------------------------------------------------------------------
   4) Grape landing page hero
   ------------------------------------------------------------------------- */

.dse-grape-landing {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 2.5rem 1.5rem 4rem;
}

@media (min-width: 960px) {
    .dse-grape-landing {
        padding-top: 3.5rem;
    }
}

.dse-grape-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .dse-grape-hero {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

.dse-grape-hero__image {
    position: relative;
    padding: 1.5rem;
    border-radius: 26px;
    background: radial-gradient(circle at top, #f9efe6, #f4f0ea);
    overflow: hidden;
}

.dse-grape-hero__image img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.28));
}

.dse-grape-hero__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dse-grape-hero__title {
    font-size: clamp(2.1rem, 3vw, 2.7rem);
    margin: 0;
}

.dse-grape-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.dse-grape-hero__pill {
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #111;
    background: #111;
    color: #fff;
}

.dse-grape-hero__origin {
    font-size: 0.85rem;
    color: #555;
}

.dse-grape-hero__price {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.dse-grape-hero__text p {
    margin: 0.15rem 0;
    font-size: 0.9rem;
    color: #444;
}

.dse-grape-hero__badges-wrap {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    align-items: center;
}

.dse-grape-hero__popularity {
    font-size: 0.8rem;
    color: #555;
}

.dse-grape-hero__badges span {
    font-size: 0.78rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    background: #f0ece5;
    color: #555;
}

.dse-grape-hero__summary {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

/* -------------------------------------------------------------------------
   5) Grape landing — wines grid
   ------------------------------------------------------------------------- */

.dse-grape-wines {
    margin-top: 2rem;
}

.dse-section-title {
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
}

.dse-grape-wines .products {
    margin-top: 0.5rem;
}

/* Debug block styling (when visible for admins) */

.dse-debug-grapes {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* -------------------------------------------------------------------------
   6) Region directory + landing (basic alignment)
   ------------------------------------------------------------------------- */

.dse-directory--region .dse-grape-directory-grid {
    /* Region cards can reuse grape card styling */
}

.dse-region-landing .dse-section-title {
    margin-top: 0;
}

/* =========================================================================
 *  EXTRA: make existing filter markup look like chips/toggle
 * ========================================================================= */

/* Style any buttons inside the filter bar as chips */
.dse-filter-bar button,
.dse-filter-bar input[type="button"],
.dse-filter-bar input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.95rem;
    margin: 0 0.15rem 0.25rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: background 0.15s ease, color 0.15s ease,
        border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

/* Active/selected state – covers several common class names */
.dse-filter-bar button.active,
.dse-filter-bar button.is-active,
.dse-filter-bar button.current,
.dse-filter-bar input[type="button"].active {
    background: #111;
    color: #fff;
    border-color: #111;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

/* Hover state */
.dse-filter-bar button:hover,
.dse-filter-bar input[type="button"]:hover,
.dse-filter-bar input[type="submit"]:hover {
    border-color: #111;
}

/* “Sparkling only” checkbox + label in one line */
.dse-filter-bar input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-right: 0.35rem;
}

.dse-filter-bar label {
    font-size: 0.8rem;
    color: #444;
}

/* Make the “Reset filters” bit feel like a link */
.dse-filter-bar a,
.dse-filter-bar .dse-filter-bar__reset {
    font-size: 0.8rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #555;
}

.dse-filter-bar a:hover,
.dse-filter-bar .dse-filter-bar__reset:hover {
    color: #000;
}