/* ==========================================================================
   Fonte Da Vida - Products Page Styles
   Description: Specific styles for the Products page including the 
   product item grid, thumbnail overlays, and structural overrides.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Structural Layout Overrides & Page Header
   -------------------------------------------------------------------------- */
.page-header {
    padding: 160px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 500px;
    background: radial-gradient(circle at center,
        var(--accent-soft) 0%,
        transparent 55%);
    pointer-events: none;
}

.light-mode .page-header::before {
    background: radial-gradient(circle at center,
        rgba(59, 130, 246, 0.04) 0%,
        transparent 55%);
}

.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 65%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 65%);
    pointer-events: none;
}

.page-header > * {
    position: relative;
    z-index: 1;
}

.page-header .section-desc {
    margin: 0 auto;
}

/* Ensures footer stays at the bottom with no gap if page content is short */
html, body {
    height: 100%;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* Clear gradient backgrounds behind interactive tools for this specific view */
.pricing-section, 
.faq-section {
    background: transparent !important;
}

.contact-section {
    background: transparent !important;
    padding: 120px 0;
    border-top: 1px solid var(--border-subtle);
}

.templates-section:has(.contact-section) {
    padding: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-family: 'JetBrains Mono', monospace;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

.breadcrumb .bc-sep {
    opacity: 0.4;
}

/* --------------------------------------------------------------------------
   02. Product Items Grid
   -------------------------------------------------------------------------- */
.templates-section {
    padding: 0 0 120px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.template-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.template-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.3),
        transparent 40%,
        transparent 60%,
        rgba(59, 130, 246, 0.15));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.template-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.light-mode .template-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-border);
}

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

/* --------------------------------------------------------------------------
   03. Product Thumbnails & Overlays
   -------------------------------------------------------------------------- */
.template-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
}

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

.template-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 16, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.light-mode .template-thumb-overlay {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.template-card:hover .template-thumb-overlay {
    opacity: 1;
}

.template-thumb-overlay .btn {
    font-size: 12.5px;
    padding: 8px 18px;
}

/* --------------------------------------------------------------------------
   04. Product Item Metadata
   -------------------------------------------------------------------------- */
.template-info {
    padding: 20px 22px 22px;
}

.template-number {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.template-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.template-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.template-tags {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.template-tag {
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.browse-more {
    text-align: center;
    margin-top: 56px;
}

/* --------------------------------------------------------------------------
   05. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-header { padding: 130px 0 60px; }
    .templates-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (max-width: 389px) {
    .page-header { padding: 110px 0 50px; }
    .template-info { padding: 16px; }
    .template-name { font-size: 15px; }
    .template-desc { font-size: 12px; }
}