/* TN Sacco Products — Frontend Styles */

/* ── Design tokens (matches site palette) ───────────────────────────────── */
:root {
    --tn-navy:        #051939;
    --tn-fosa:        #27ab5c;
    --tn-bosa:        #0e4d8a;
    --tn-micro:       #8a3d0e;
    --tn-gold:        #ffbb16;
    --tn-white:       #ffffff;
    --tn-surface-var: #e1e3e4;
    --tn-body:        #191c1d;
    --tn-muted:       #44474e;
    --tn-border:      #c4c6cf;
    --tn-bg:          #f8f9fa;
    --tn-container:   1280px;
}

/* ── Single Product Hero (matches theme page hero) ───────────────────────── */
.tn-single-hero {
    background: linear-gradient(to right, #27ab5c, #0f97a3);
    color: #ffffff;
    padding: 60px 0;
    overflow: hidden;
}

/* The overlay div is kept in markup but hidden — not needed for this style */
.tn-hero-overlay { display: none; }

.tn-hero-inner {
    max-width: var(--tn-container);
    margin: 0 auto;
    padding: 0 32px;
}

/* Title — with left accent bar identical to the theme */
.tn-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px;
    padding-left: 14px;
    border-left: 4px solid rgba(255, 255, 255, 0.55);
    line-height: 1.2;
}

/* Subtitle hidden on this hero style */
.tn-hero-subtitle { display: none; }

/* Breadcrumb — sits below the title */
.tn-hero-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    flex-wrap: wrap;
    padding-left: 18px;
}

.tn-hero-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.15s ease;
}

.tn-hero-breadcrumb a:hover { color: #ffffff; }

.tn-hero-sep {
    font-size: 12px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .tn-single-hero  { padding: 40px 0; }
    .tn-hero-title   { font-size: 1.5rem; }
}

/* ── Suppress theme's built-in page hero on single product pages ─────────── */
/*    Targets the most common theme hero selectors. Adjust if your theme      */
/*    uses a different class.                                                  */
body.tn-single-product .page-hero,
body.tn-single-product .entry-hero,
body.tn-single-product .site-hero,
body.tn-single-product .hero-section,
body.tn-single-product .page-header,
body.tn-single-product .inner-banner,
body.tn-single-product .breadcrumb-area,
body.tn-single-product .elementor-location-header ~ .page-header {
    display: none !important;
}

/* ── Single Product Banner with gradient overlay ────────────────────────── */
.tn-single-banner {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: linear-gradient(to right, #27ab5c, #0f97a3);
}

/* Featured image behind everything */
.tn-single-banner-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.tn-single-banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Gradient overlay on top of the image */
.tn-single-banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to right,
        rgba(39, 171, 92, 0.88) 0%,
        rgba(15, 151, 163, 0.82) 100%
    );
}

/* No image fallback: pure gradient is already the background */
.tn-single-banner:not(:has(.tn-single-banner-image)) .tn-single-banner-overlay {
    display: none;
}

/* Text content */
.tn-single-banner-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--tn-container);
    margin: 0 auto;
    padding: 40px 32px;
}

/* Badge */
.tn-single-banner-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 14px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
}

/* Title */
.tn-single-banner-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 14px;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Breadcrumb */
.tn-single-banner-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    flex-wrap: wrap;
}

.tn-single-banner-breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.15s;
}

.tn-single-banner-breadcrumb a:hover { color: #fff; }

@media (max-width: 768px) {
    .tn-single-banner        { min-height: 200px; }
    .tn-single-banner-title  { font-size: 1.4rem; }
}

/* ── Single Product Content Layout ──────────────────────────────────────── */
.tn-single-wrap {
    max-width: var(--tn-container);
    margin: 48px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .tn-single-wrap { grid-template-columns: 1fr; }
}

/* Featured image */
.tn-single-featured-image {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 28px;
}

.tn-single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 420px;
    object-fit: cover;
}

/* Main content */
.tn-single-content {
    font-size: 16px;
    line-height: 28px;
    color: var(--tn-body);
    margin-bottom: 32px;
}

/* Details panel */
.tn-single-details {
    background: var(--tn-bg);
    border: 1px solid var(--tn-border);
    border-radius: 10px;
    padding: 28px;
}

.tn-details-heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--tn-body);
    margin: 0 0 20px;
}

.tn-details-list { margin: 0; padding: 0; }

.tn-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tn-border);
}

.tn-detail-row:last-child { border-bottom: none; }

.tn-detail-row.tn-detail-block {
    flex-direction: column;
    align-items: flex-start;
}

.tn-details-list dt {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tn-muted);
    white-space: nowrap;
}

.tn-details-list dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--tn-body);
    text-align: right;
}

.tn-detail-block dd { text-align: left; }

/* Sidebar */
.tn-single-sidebar { display: flex; flex-direction: column; gap: 16px; }

.tn-sidebar-cta {
    background: linear-gradient(135deg, #1aa84c 0%, #0f97a3 100%);
    color: var(--tn-white);
    border-radius: 10px;
    padding: 28px 24px;
    position: sticky;
    top: 100px;
}

.tn-sidebar-cta h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
}

.tn-sidebar-cta p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0 0 20px;
    line-height: 1.6;
}

.tn-cta-btn {
    display: block;
    text-align: center;
    background: var(--tn-gold);
    color: var(--tn-navy);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    transition: filter 0.2s ease;
}

.tn-cta-btn:hover { filter: brightness(1.1); color: var(--tn-navy); }

.tn-sidebar-back a {
    font-size: 0.88rem;
    color: var(--tn-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.tn-sidebar-back a:hover { color: var(--tn-body); }


.tn-products-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
    margin: 32px 0;
}

.tn-products-cols-1 { grid-template-columns: 1fr; }
.tn-products-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tn-products-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tn-products-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .tn-products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .tn-products-grid { grid-template-columns: 1fr; }
}

/* Card */
.tn-product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.tn-product-card:hover {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.10);
    transform: translateY(-4px);
}

/* Image + badge wrapper */
.tn-product-thumb-wrap {
    position: relative;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    flex-shrink: 0;
}

/* Thumbnail */
.tn-product-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.tn-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.tn-product-card:hover .tn-product-thumb img {
    transform: scale(1.04);
}

/* Placeholder */
.tn-product-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #e6f7f8 0%, #c8ecee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tn-product-thumb-placeholder svg {
    width: 48px;
    height: 48px;
}

/* Category badge — overlaid on the image, bottom-left */
.tn-product-category {
    position: absolute;
    bottom: 10px;
    left: 12px;
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 4px 10px;
    border-radius: 9999px;
    color: #fff;
    background-color: #0f97a3;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* Body */
.tn-product-body {
    padding: 20px 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title — green, matches screenshot */
.tn-product-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #27ab5c;
    line-height: 1.3;
}

.tn-cat-bosa-products         .tn-product-title { color: #0e7abf; }
.tn-cat-micro-credit-products .tn-product-title { color: #bf5e0e; }

.tn-product-excerpt {
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.65;
    margin: 0 0 20px;
    flex: 1;
}

/* Meta list */
.tn-product-meta {
    list-style: none;
    margin: 0 0 16px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #374151;
}

.tn-product-meta li { margin-bottom: 4px; }
.tn-product-meta li:last-child { margin-bottom: 0; }
.tn-meta-label { font-weight: 600; }

/* "Read More" button */
.tn-product-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 9px 18px;
    background-color: #0f97a3;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    align-self: flex-start;
}

.tn-product-link::after {
    content: '→';
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.tn-product-link:hover {
    background-color: #0c7f8a;
    color: #fff;
    transform: translateY(-1px);
}

.tn-product-link:hover::after {
    transform: translateX(3px);
}

.tn-products-empty,
.tn-services-empty {
    color: #6b7280;
    font-style: italic;
}


/* ── Pagination ─────────────────────────────────────────────────────────── */
.tn-pagination {
    margin: 32px 0 8px;
    display: flex;
    justify-content: center;
}

.tn-pagination-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tn-page-link,
.tn-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #d1d5db;
    color: #374151;
    background: #ffffff;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tn-page-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.tn-page-link.tn-page-active {
    background: #1a6e3c;
    border-color: #1a6e3c;
    color: #ffffff;
    cursor: default;
    pointer-events: none;
}

.tn-page-ellipsis {
    border-color: transparent;
    background: transparent;
    color: #9ca3af;
    pointer-events: none;
}

.tn-page-prev,
.tn-page-next {
    padding: 0 14px;
}
