/**
 * Zamseed Stats Widget Styles
 *
 * @package Zamseed
 * @since 1.0.0
 */

/* ==========================================================================
   Section Header
   ========================================================================== */

.zs-stats-wrap { position: relative; }

.zs-stats-header {
    display: flex;
    flex-direction: column;
    align-items: var(--zs-header-items, center);
    margin: 0 var(--zs-header-margin-right, auto) 0 var(--zs-header-margin-left, auto);
    text-align: var(--zs-header-text-align, center);
}

.zs-stats__eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--zs-accent-text, #9a6c1f);
}

.zs-stats__heading {
    margin: 0 var(--zs-header-margin-right, auto) 12px var(--zs-header-margin-left, auto);
    font-family: var(--zs-font-serif, 'Cormorant Garamond', serif);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--zs-text, #1c1c1c);
}

.zs-stats__header-description {
    margin: 0 var(--zs-header-margin-right, auto) 0 var(--zs-header-margin-left, auto);
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--zs-muted, #555555);
}

/* ==========================================================================
   Empty State

   Only ever rendered when the editor has typed an Empty State Message; the
   text itself comes from that control, never from this stylesheet, so there
   is deliberately no `content:` declaration here.
   ========================================================================== */

.zs-stats__empty {
    margin: 0;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 1rem;
    line-height: 1.65;
    text-align: var(--zs-header-text-align, center);
    color: var(--zs-muted, #555555);
}

/* ==========================================================================
   Stats Container
   ========================================================================== */

/* The row owns its own measure, the same way category-grid and csr do, so the
   section does not depend on a parent container being boxed to the right width.
   1200 with a 24px gap puts each of the four stats on 282px, which is the
   frame's geometry (Figma 11096:35800: items 282 wide at x 0/306/612/918). */
.zs-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    width: min(var(--zs-container-max, 1200px), calc(100% - var(--zs-container-padding, 20px) * 2));
    margin-inline: auto;
}

/* ==========================================================================
   Stats Item
   ========================================================================== */

.zs-stats__item {
    position: relative;
    text-align: center;
    padding: 20px;
}

/* Icon */
.zs-stats__icon {
    margin-bottom: 12px;
    font-size: 40px;
    line-height: 1;
    color: var(--zs-primary, #2d5a27);
}

.zs-stats__icon svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
}

.zs-stats__icon i {
    display: inline-block;
}

/* Uploaded SVG/image icons render as <img> — keep them at the icon size */
.zs-stats__icon img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Per-stat image (visual type = Image) */
.zs-stats__image {
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zs-stats__image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 56px;
    object-fit: contain;
}

/* Optional per-stat link wraps the whole stat; keep it a plain block so
   the number/label styling is unaffected, and give keyboard users a
   visible focus ring. */
.zs-stats__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.zs-stats__link:focus-visible {
    outline: 2px solid var(--zs-primary, #2d5a27);
    outline-offset: 4px;
    border-radius: 8px;
}

.zs-stats__link:hover .zs-stats__number {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Number */
.zs-stats__number {
    margin-bottom: 8px;
    font-family: var(--zs-font-serif, 'Cormorant Garamond', serif);
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 700;
    line-height: 1;
    color: var(--zs-primary, #2d5a27);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Label */
.zs-stats__label {
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--zs-muted, #555555);
}

/* Sub Label */
.zs-stats__sublabel {
    margin-top: 4px;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 0.6875rem;
    font-weight: 400;
    line-height: 1.4;
    color: #888888;
}

/* ==========================================================================
   Glass / Frost Effect
   ========================================================================== */

.zs-stats__item--glass {
    background-color: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Dividers Variant
   ========================================================================== */

.zs-stats--dividers .zs-stats__item {
    position: relative;
}

.zs-stats--dividers .zs-stats__item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background-color: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
    .zs-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hide dividers on even items when in 2-column layout */
    .zs-stats--dividers .zs-stats__item:nth-child(2n)::after {
        display: none;
    }

    .zs-stats--dividers-hide-tablet .zs-stats__item::after {
        display: none;
    }

    .zs-stats-header { margin-bottom: 32px; }
}

@media (max-width: 760px) {
    .zs-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .zs-stats__item {
        padding: 16px;
    }

    .zs-stats__number {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }

    .zs-stats__label {
        font-size: 0.6875rem;
    }

    .zs-stats--dividers-hide-mobile .zs-stats__item::after {
        display: none;
    }

    .zs-stats__heading { font-size: clamp(1.75rem, 6vw, 2rem); }
}

@media (max-width: 480px) {
    .zs-stats {
        grid-template-columns: 1fr;
    }

    .zs-stats__item {
        padding: 20px 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .zs-stats__item:last-child {
        border-bottom: none;
    }
}

/* ==========================================================================
   Agro Dealers preset — applied by the widget's Design Preset control.
   Figma node 11121:38358.

   The preset holds the approved band and grid as a rendering class rather
   than as control defaults, so selecting it is a rendering change and
   switching to Custom hands the editor an untouched panel.

   Specificity is deliberate and split in two. Elementor emits a control's
   value as `.elementor-element-<id> .zs-stats…`, two classes, and it emits
   defaults as well as saved values:

   - Rules that must beat a control DEFAULT the Figma spec contradicts
     (grid columns, 30px column gap, 8px number spacing, #555555 label
     colour) are written at three classes, so they win regardless of the
     order the stylesheets load in.
   - Rules whose control ships no default (section background, section
     spacing, item padding) stay at two classes, so an editor who sets that
     control still wins on source order.
   ========================================================================== */

.zs-stats-wrap.zs-stats-wrap--preset-agro-dealers {
    padding-top: 92px;
    padding-bottom: 92px;
    background-color: rgba(235, 231, 223, 0.12);
}

.zs-stats--preset-agro-dealers .zs-stats__item {
    padding: 8px 16px;
}

.zs-stats--preset-agro-dealers .zs-stats__number {
    font-family: var(--zs-font-serif, 'Cormorant Garamond', serif);
    font-size: 3.4rem; /* 54.4px */
    font-weight: 700;
    line-height: 1; /* 54.4px */
}

.zs-stats--preset-agro-dealers .zs-stats__label {
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 0.75rem; /* 12px */
    font-weight: 800;
    line-height: 1.6; /* 19.2px */
    letter-spacing: 0.16em; /* 1.92px */
    text-transform: uppercase;
}

/* Three-class rules: each of these overrides a control default. */
.zs-stats-wrap--preset-agro-dealers .zs-stats.zs-stats--preset-agro-dealers {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
}

.zs-stats-wrap--preset-agro-dealers .zs-stats--preset-agro-dealers .zs-stats__number {
    margin-bottom: 12px;
}

.zs-stats-wrap--preset-agro-dealers .zs-stats--preset-agro-dealers .zs-stats__label {
    color: var(--zs-accent, #c48c33);
}

/* Figma specifies the desktop band only; the value size steps down so a
   54.4px number does not overrun a phone column. */
@media (max-width: 768px) {
    .zs-stats-wrap.zs-stats-wrap--preset-agro-dealers {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .zs-stats-wrap--preset-agro-dealers .zs-stats.zs-stats--preset-agro-dealers {
        grid-template-columns: repeat(2, 1fr);
    }

    .zs-stats--preset-agro-dealers .zs-stats__number {
        font-size: 2.75rem;
    }
}

@media (max-width: 560px) {
    .zs-stats-wrap--preset-agro-dealers .zs-stats.zs-stats--preset-agro-dealers {
        grid-template-columns: 1fr;
    }

    .zs-stats--preset-agro-dealers .zs-stats__number {
        font-size: 2.5rem;
    }
}
