/* ============================================================
   products.css  –  Styles for the Products section
   Loaded only on Products pages via _Layout (isProductsContext)
   ============================================================ */

/* ?? Shared brand tokens ???????????????????????????????????? */
/* These are the fallback values; Detail pages add Razor-
   rendered inline rules on .product-detail-avigilon /
   .product-detail-techwin that override them at runtime.     */
:root {
    --brand-grad:    linear-gradient(135deg, #0d1f4e 0%, #1e3a8a 60%, #2563eb 100%);
    --brand-grad-sm: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --brand-solid:   #1e3a8a;
    --brand-hover:   linear-gradient(135deg, #163179 0%, #1d53cc 100%);
    --brand-shadow:  rgba(37,99,235,.35);
    --brand-focus:   rgba(37,99,235,.2);
}

/* ?? Per-brand overrides (set on the page wrapper div) ??????? */
.product-detail-avigilon {
    --brand-grad:    linear-gradient(135deg, #0d1f4e 0%, #1e3a8a 60%, #2563eb 100%);
    --brand-grad-sm: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --brand-solid:   #1e3a8a;
    --brand-hover:   linear-gradient(135deg, #163179 0%, #1d53cc 100%);
    --brand-shadow:  rgba(37,99,235,.35);
    --brand-focus:   rgba(37,99,235,.2);
}
.product-detail-techwin {
    --brand-grad:    linear-gradient(135deg, #1c1917 0%, #44403c 55%, #c45200 100%);
    --brand-grad-sm: linear-gradient(135deg, #c45200 0%, #f97316 100%);
    --brand-solid:   #c45200;
    --brand-hover:   linear-gradient(135deg, #a34400 0%, #ea6a0e 100%);
    --brand-shadow:  rgba(249,115,22,.38);
    --brand-focus:   rgba(249,115,22,.2);
}


/* ================================================================
   INDEX PAGE
   ================================================================ */

/* ?? Page wrapper ?? */
.products-page { background: #f0f2f5; }

/* ?? Hero ?? */
.products-hero {
    background: linear-gradient(135deg, #0d1f4e 0%, #1e3a8a 60%, #2563eb 100%);
    color: white;
    padding: 4rem 0 3.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}
.products-hero h1 { text-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.products-hero .lead { opacity: .88; }

/* ?? Sector sections ?? */
.sector-section { padding: 4rem 0; }
.sector-avigilon { background: #ffffff; }
.sector-techwin  { background: #f0f2f5; }

/* ?? Sector header ?? */
.sector-header {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(0,0,0,0.07);
}
.sector-logo-badge {
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.avigilon-badge { background: linear-gradient(135deg, #0a2a6e 0%, #1e4db7 100%); }
.techwin-badge  { background: linear-gradient(135deg, #b84500 0%, #f97316 100%); }

.sector-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: #6c757d;
    margin-bottom: 0.4rem;
}
.sector-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.sector-description {
    font-size: 0.93rem;
    color: #4a5568;
    line-height: 1.75;
    margin: 0;
    max-width: 860px;
}

/* ?? Empty state ?? */
.sector-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #adb5bd;
    font-style: italic;
    padding: 1.5rem 0;
}
.sector-empty i { font-size: 1.4rem; }

/* ?? Product card ?? */
.product-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s ease;
    border: 1px solid rgba(0,0,0,0.05);
}
.product-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,0.13); }

/* Special highlight for the Techwin Ethernet Gateway product (transversal) */
.product-card--hardware {
    border: 2px solid rgba(37,99,235,.18);
    box-shadow: 0 14px 36px rgba(37,99,235,.14);
}
.product-card--hardware .product-card-image { border-bottom: 3px solid rgba(37,99,235,.12); }
.product-card--hardware .product-card-title { color: var(--brand-solid); }
.product-card--hardware .product-category-badge { background: #0b3a7a; }

.product-card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 3.5s ease;
}
.product-card:hover .product-card-image img { transform: scale(1.05); }

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9ecef 0%, #d0d7de 100%);
    color: #adb5bd;
}
.product-category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(30,58,138,0.92);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}
.product-card-body {
    padding: 1.4rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.product-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0;
}
.product-card-description {
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #6c757d;
}
.product-card-pricing {
    padding: 0.6rem 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ?? Sector CTA button colours ?? */
.btn-sector {
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all .25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.sector-avigilon .btn-sector {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border: none;
    color: #fff;
}
.sector-avigilon .btn-sector:hover {
    background: linear-gradient(135deg, #163179 0%, #1d53cc 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.sector-techwin .btn-sector {
    background: linear-gradient(135deg, #c45200 0%, #f97316 100%);
    border: none;
    color: #fff;
}
.sector-techwin .btn-sector:hover {
    background: linear-gradient(135deg, #a34400 0%, #ea6a0e 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(249,115,22,.4);
}


/* ================================================================
   DETAIL PAGE
   ================================================================ */

.product-detail-page { background: #f5f7fa; }

/* ?? Breadcrumb ?? */
.breadcrumb-nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: .6rem 0;
}
.breadcrumb { margin: 0; padding: 0; background: none; font-size: .85rem; }
.breadcrumb-item { display: inline-flex; align-items: center; }
.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 .6rem;
    color: #d1d5db;
    font-size: .9rem;
}
.breadcrumb-item a {
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: color .15s;
}
.breadcrumb-item a:hover { color: #111827; }
.breadcrumb-item.active { color: #111827; font-weight: 500; }

/* ?? Hero ?? */
.product-header {
    background: var(--brand-grad);
    padding: 3rem 0;
}
.product-image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.28);
    background: white;
}
.product-main-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 3.3s ease;
}
.product-image-wrapper:hover .product-main-image { transform: scale(1.05); }
.product-image-placeholder {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e2e8f0 100%);
    color: #cbd5e0;
    border-radius: 20px;
}
.product-info { display: flex; flex-direction: column; gap: 1.5rem; }

.category-badge {
    display: inline-block;
    background: rgba(255,255,255,.18);
    color: white;
    padding: .5rem 1.25rem;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    width: fit-content;
    border: 1px solid rgba(255,255,255,.35);
}
.product-name {
    font-size: 2.75rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.version-label {
    font-size: 1.5rem;
    color: rgba(255,255,255,.72);
    font-weight: 600;
    margin-left: .75rem;
}
.product-tagline {
    font-size: 1.2rem;
    color: rgba(255,255,255,.9);
    line-height: 1.6;
    margin: 0;
}
.quick-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap: 1rem;
}
.info-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255,255,255,.14);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.22);
    transition: all .3s ease;
    backdrop-filter: blur(10px);
}
.info-card:hover {
    background: rgba(255,255,255,.24);
    border-color: rgba(255,255,255,.45);
}
.info-card i { font-size: 1.75rem; color: rgba(255,255,255,.9); }
.info-card small { display: block; color: rgba(255,255,255,.6); font-size: .8rem; margin-bottom: .25rem; }
.info-card strong { display: block; color: white; font-size: 1.05rem; }

/* ?? Tabs ?? */
.product-content { padding: 3rem 0; }
.product-tabs {
    border: none;
    background: white;
    padding: .4rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: .25rem;
}
.product-tabs::-webkit-scrollbar { display: none; }
.product-tabs .nav-item { flex-shrink: 0; }
.product-tabs .nav-link {
    color: #718096;
    font-weight: 600;
    padding: .7rem 1.1rem;
    border-radius: 8px;
    border: none;
    transition: all .25s ease;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
    font-size: .9rem;
}
.product-tabs .nav-link:hover { color: var(--brand-solid); background: #f7fafc; }
.product-tabs .nav-link.active {
    color: white;
    background: var(--brand-grad-sm);
    box-shadow: 0 4px 12px var(--brand-shadow);
}

.tab-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    min-height: 300px;
}
.rich-content { font-size: 1.05rem; line-height: 1.8; color: #4a5568; }
.rich-content h1,
.rich-content h2,
.rich-content h3 { color: #2d3748; font-weight: 700; margin-top: 1.5rem; margin-bottom: 1rem; }
.rich-content ul,
.rich-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.rich-content p { margin-bottom: 1rem; }

/* ?? Features ?? */
.features-grid-simple {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
    gap: 1.5rem;
}
.feature-box {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all .3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.feature-box:hover {
    border-color: var(--brand-solid);
    box-shadow: 0 8px 20px var(--brand-shadow);
    transform: translateY(-5px);
}
.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--brand-grad-sm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px var(--brand-shadow);
}
.feature-icon i { font-size: 1.5rem; color: white; }
.feature-text { font-size: 1.05rem; color: #2d3748; line-height: 1.6; margin: 0; font-weight: 500; }

/* ?? Requirements ?? */
.requirements-showcase { display: flex; flex-direction: column; gap: 2rem; }
.requirements-header {
    text-align: center;
    padding: 2rem;
    background: var(--brand-grad-sm);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 20px var(--brand-shadow);
}
.requirements-header i { color: white; opacity: .95; margin-bottom: 1rem; }
.requirements-header h3 { margin: 0; font-size: 1.75rem; font-weight: 700; }
.requirements-content {
    padding: 2rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    font-size: 1.1rem;
    line-height: 2;
    color: #4a5568;
}

/* ?? PDF viewer ?? */
.pdf-viewer-wrapper { display: flex; flex-direction: column; gap: 1rem; }
.pdf-controls {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-items: center;
    padding: .75rem 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}
.pdf-nav-row,
.pdf-zoom-row { display: flex; align-items: center; gap: .5rem; }
.pdf-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pdf-btn-download {
    display: inline-flex;
    align-items: center;
    padding: .3rem .75rem;
    font-size: .8rem;
    font-weight: 600;
}
.page-info,
.zoom-info {
    font-weight: 600;
    color: #4a5568;
    font-size: .85rem;
    padding: .3rem .65rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}
.page-sep { margin: 0 .15rem; }
.pdf-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
    background: #525659;
    border-radius: 12px;
    overflow: auto;
    padding: 2rem;
    position: relative;
}
#pdfCanvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    background: white;
}
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
    color: white;
}
.pdf-loading p { margin-top: 1rem; font-size: 1.1rem; }

/* ?? Shared button overrides (scoped to product pages) ?? */
.product-detail-page .btn-outline-primary {
    border: 2px solid var(--brand-solid);
    color: var(--brand-solid);
    background: white;
}
.product-detail-page .btn-outline-primary:hover {
    background: var(--brand-solid);
    color: white;
    border-color: var(--brand-solid);
}

/* ?? CTA section ?? */
.cta-section {
    background: var(--brand-grad);
    color: white;
    padding: 4rem 0;
    margin-top: 3rem;
}
.cta-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.cta-subtitle { font-size: 1.25rem; margin-bottom: 2rem; opacity: .92; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta-section .btn-outline-light {
    border: 2px solid white;
    color: white;
    background: transparent;
    font-weight: 600;
    padding: .85rem 2rem;
    border-radius: 10px;
    transition: all .25s ease;
}
.cta-section .btn-outline-light:hover { background: rgba(255,255,255,.16); }


/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
    /* Index */
    .products-hero { padding: 2.5rem 0 2rem; }
    .products-hero h1 { font-size: 1.9rem; }
    .sector-section { padding: 2.5rem 0; }
    .sector-header { flex-direction: column; gap: 1rem; }
    .sector-logo-badge { width: 52px; height: 52px; font-size: 1.4rem; border-radius: 14px; }
    .product-card-image { height: 180px; }

    /* Detail */
    .product-name { font-size: 1.9rem; }
    .product-tagline { font-size: 1.05rem; }
    .quick-info-grid { grid-template-columns: 1fr; }
    .cta-title { font-size: 1.75rem; }
    .cta-subtitle { font-size: 1rem; }
    .cta-actions { flex-direction: column; }
    .cta-actions .btn { width: 100%; }
    .tab-card { padding: 1.25rem; }
    .features-grid-simple { grid-template-columns: 1fr; gap: 1rem; }
    .feature-box { padding: 1.25rem; }
    .product-tabs .nav-link .tab-label { display: none; }
    .product-tabs .nav-link { padding: .65rem .85rem; }
    .pdf-btn-label { display: none; }
    .pdf-btn-download { padding: .3rem .6rem; }
    .pdf-container { min-height: 350px; padding: .75rem; }
}

@media (max-width: 400px) {
    .product-tabs .nav-link { padding: .6rem .7rem; font-size: .8rem; }
}
