/**
 * TypesOfFabric.in - Production Stylesheet
 * Vanilla CSS3 | Modern SaaS & Textile Engineering Interface
 * Target: Hostinger Linux Shared Hosting (No NPM, No Build Steps)
 */

:root {
    --primary: #0f4c81;          /* Classic Textile Navy */
    --primary-hover: #0b375d;
    --primary-light: #eef5fc;
    --accent: #0284c7;           /* Sky Blue Accent */
    --accent-hover: #0369a1;
    --secondary: #475569;        /* Slate Neutral */
    --dark: #0f172a;             /* Deep Slate/Black */
    --light: #f8fafc;            /* Crisp Background Light */
    --surface: #ffffff;          /* Card Background */
    --border: #e2e8f0;           /* Soft Border */
    --border-hover: #cbd5e1;
    --text-main: #1e293b;        /* Readable High-Contrast Body */
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.02);

    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --container-max: 1240px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

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

ul, ol {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; letter-spacing: -0.015em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
    margin-bottom: 1rem;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }

/* Layout Containers */
.tof-container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.tof-main-container {
    flex: 1 0 auto;
}

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 2rem; padding-bottom: 2rem; }
.py-4 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.py-5 { padding-top: 5rem; padding-bottom: 5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Grid Systems */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* Header & Sticky Nav */
.tof-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.tof-header.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.brand-logo span {
    color: var(--accent);
}

.brand-icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.2rem;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    gap: 0.5rem;
    text-align: center;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 76, 129, 0.25);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.btn-secondary:hover {
    background-color: #dbeaf7;
    color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Cards & Surface Components */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-knitted { background: #e0f2fe; color: #0369a1; }
.badge-woven { background: #fef3c7; color: #b45309; }
.badge-natural { background: #dcfce7; color: #15803d; }
.badge-synthetic { background: #f3e8ff; color: #7e22ce; }
.badge-blended { background: #ffedd5; color: #c2410c; }
.badge-sustainable { background: #ccfbf1; color: #0f766e; }

/* Hero Section */
.hero-section {
    background: linear-gradient(180deg, var(--surface) 0%, var(--light) 100%);
    border-bottom: 1px solid var(--border);
    padding: 4.5rem 0 3.5rem;
    text-align: center;
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    max-width: 820px;
    margin: 0 auto 1.25rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 2.25rem;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

/* Global Search Container */
.search-box-wrapper {
    max-width: 650px;
    margin: 0 auto;
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 0.5rem 0.75rem 0.5rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.search-input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--dark);
    background: transparent;
    padding: 0.4rem 0.5rem;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 420px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.search-result-item {
    display: block;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--primary-light);
}

.search-result-item .item-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.search-result-item .item-category {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

/* Category Grid Cards */
.cat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.cat-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
}

/* Fabric Spec Pill Table */
.spec-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.spec-pill {
    font-size: 0.8rem;
    background: var(--light);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--secondary);
}

/* Notice / Disclaimer Card */
.disclaimer-box {
    background-color: #f8fafc;
    border-left: 4px solid var(--secondary);
    padding: 1.2rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 2rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Breadcrumbs */
.tof-breadcrumbs {
    padding: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tof-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tof-breadcrumbs li+li::before {
    content: "/";
    color: var(--border-hover);
    margin-right: 0.5rem;
}

/* Footer */
.tof-footer {
    background-color: #0b1329;
    color: #94a3b8;
    padding: 4.5rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid #1e293b;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

.footer-col h5 {
    color: #f8fafc;
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: #94a3b8;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #ffffff;
    padding-left: 3px;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: var(--transition);
}

#back-to-top:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

/* Mobile Responsiveness Rules */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1.5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.25rem;
    }
}
