/* ==========================================================================
   FORTILABS.DEV — PRODUCTS PAGE
   High-end editorial layout. Claude.ai-inspired warmth, precise grid.
   ========================================================================== */

/* ─── Page Hero ─────────────────────────────────────────────────────────────── */
.products-hero {
    padding: clamp(48px, 6vw, 80px) 0 clamp(32px, 4vw, 56px);
    border-bottom: 1px solid var(--border-default);
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.products-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(217, 119, 87, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── Products Showcase Grid ────────────────────────────────────────────────── */
.products-showcase {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

/* Each product row alternates layout */
.product-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--border-default);
    min-height: 340px;
}

.product-feature:last-child {
    border-bottom: none;
}

.product-feature:nth-child(even) {
    direction: rtl;
}

.product-feature:nth-child(even) > * {
    direction: ltr;
}

.product-feature__info {
    padding: clamp(40px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border-default);
}

.product-feature:nth-child(even) .product-feature__info {
    border-right: none;
    border-left: 1px solid var(--border-default);
}

.product-feature__visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 4vw, 56px);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.product-feature__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(217, 119, 87, 0.07) 0%, transparent 65%);
}

/* Product Feature Info Elements */
.product-feature__category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-bottom: 16px;
}

.product-feature__name {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.product-feature__desc {
    font-size: clamp(0.9375rem, 1vw, 1.0625rem);
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 28px;
    flex-grow: 1;
}

.product-feature__bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-feature__bullet {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.product-feature__bullet::before {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.product-feature__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Product Visual / Icon Block */
.product-icon-display {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.product-icon-display__logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-icon-display__logo img {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
}

.product-icon-display__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

.product-icon-display__url {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-inset);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-default);
}

/* ─── Simple Card Grid (fallback when no products in DB) ───────────────────── */
.products-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
}

.product-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth), border-color var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.product-card__logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.product-card__logo img {
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
}

.product-card__logo-placeholder {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(217, 119, 87, 0.15);
    white-space: nowrap;
}

.product-card__body {
    flex-grow: 1;
    margin-bottom: 24px;
}

.product-card__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-card__description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.product-card__footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-default);
}

.product-card__btn {
    width: 100%;
    justify-content: center;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .product-feature {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .product-feature:nth-child(even) {
        direction: ltr;
    }

    .product-feature__info {
        border-right: none;
        border-bottom: 1px solid var(--border-default);
    }

    .product-feature:nth-child(even) .product-feature__info {
        border-left: none;
        border-bottom: 1px solid var(--border-default);
    }

    .product-feature__visual {
        min-height: 200px;
    }
}

@media (max-width: 768px) {
    .products-card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .product-feature__info {
        padding: 28px 20px;
    }

    .product-feature__actions {
        flex-direction: column;
    }

    .product-feature__actions .btn {
        width: 100%;
    }
}
