/* ============================================================================
   THINKSTV LED — public products section
   ============================================================================

   Layout only. The column count and card shape come from the CMS at runtime as
   --products-columns and --products-aspect, written by products.js.

   Breakpoints match the rest of the site: 1200 / 1024 / 768 / 480. The column
   count from the CMS is treated as a maximum: a three-column section becomes
   two on a tablet and one on a phone, whatever the setting says, because three
   cards across a 480px screen is unreadable.
   ========================================================================= */

.products-section {
    padding: 96px 32px;
    background: #F5F7FB;
    --products-columns: 3;
    --products-aspect: 4 / 3;
}

.products-section[hidden] { display: none; }

.products-inner {
    max-width: 1320px;
    margin: 0 auto;
}

.products-head {
    margin-bottom: 40px;
    text-align: center;
}

.products-heading {
    margin: 0 0 12px;
    font-size: 36px;
    line-height: 1.2;
    color: #0F172A;
}

.products-intro {
    margin: 0 auto;
    max-width: 68ch;
    color: #475569;
    line-height: 1.7;
}

/* ------------------------------------------------------------------- TABS */

.products-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.products-tab {
    padding: 10px 20px;
    border: 1px solid #D6DEEA;
    border-radius: 999px;
    background: #FFFFFF;
    color: #334155;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease,
                border-color 160ms ease;
}

.products-tab:hover { border-color: #2563EB; color: #2563EB; }

.products-tab.is-active {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
}

/* ------------------------------------------------------------------- GRID */

.products-grid {
    display: grid;
    grid-template-columns: repeat(var(--products-columns), minmax(0, 1fr));
    gap: 24px;
}

.products-grid[hidden] { display: none; }

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    background: #FFFFFF;
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

a.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.product-card__media {
    position: relative;
    aspect-ratio: var(--products-aspect);
    background: #EEF2F7;
    overflow: hidden;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card__image--empty { background: #E2E8F0; }

.product-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #2563EB;
    color: #FFFFFF;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.product-card__body { padding: 20px; }

.product-card__title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
    color: #0F172A;
}

.product-card__summary {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

/* ------------------------------------------------------------ BREAKPOINTS */

@media (max-width: 1200px) {
    .products-section { padding: 80px 28px; }
}

@media (max-width: 1024px) {
    /* The CMS setting is a maximum, not a promise. */
    .products-grid {
        grid-template-columns: repeat(min(var(--products-columns), 2), minmax(0, 1fr));
    }
    .products-heading { font-size: 30px; }
}

@media (max-width: 768px) {
    .products-section { padding: 64px 20px; }
    .products-grid { gap: 18px; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: minmax(0, 1fr); }
    .products-heading { font-size: 26px; }
    .products-tabs { justify-content: flex-start; overflow-x: auto; }
    .products-tab { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
    .product-card { transition: none; }
    a.product-card:hover { transform: none; }
}
