/* ============================================================
 * File:        templates.css
 * Path:        /css/templates.css
 * Project:     TARIFEBI.GE
 * Description: Styles for redesigned header (.th2) + footer (.tf2)
 * Version:     2.0.0
 * Created:     2026-04-21
 * ============================================================ */

/* Override legacy header rules */
.site-header.th2 {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

/* ======================== TOPBAR ======================== */
.th2-topbar {
    background: linear-gradient(135deg, #064e3b 0%, #047857 60%, #059669 100%);
    color: #fff;
    font-size: 12px;
    font-family: var(--font-input);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.th2-topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 8px 16px;
    min-height: 36px;
}
.th2-tag {
    display: inline-flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,.9); font-weight: 500;
}
.th2-tag i { color: #fbbf24; }
.th2-topbar-nav {
    display: flex; align-items: center; gap: 14px;
}
.th2-qlink {
    display: inline-flex; align-items: center; gap: 5px;
    color: rgba(255,255,255,.85); text-decoration: none;
    font-weight: 600; transition: color .2s;
    font-size: 12px;
}
.th2-qlink i { font-size: 10px; opacity: .85; }
.th2-qlink:hover { color: #fff; }
.th2-qlink--muted { color: rgba(255,255,255,.6); font-weight: 500; }
.th2-qlink--muted:hover { color: rgba(255,255,255,.95); }
.th2-qsep { color: rgba(255,255,255,.3); }

/* ======================== MAIN BAR ======================== */
.th2-main {
    background: #fff;
    padding: 12px 0;
}
.th2-main-inner {
    display: flex; align-items: center;
    gap: 20px;
    padding: 0 16px;
}

/* Logo */
.th2-logo {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none; flex-shrink: 0;
}
.th2-logo-mark {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff; font-size: 18px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(5,150,105,.28);
    transition: transform .2s;
}
.th2-logo:hover .th2-logo-mark { transform: rotate(-8deg) scale(1.05); }
.th2-logo-text {
    font-size: 22px; font-weight: 800;
    color: var(--text, #111827);
    letter-spacing: .5px;
    font-family: var(--font-heading, 'BPG Glaho Bold', sans-serif);
}
.th2-logo-dot { color: #059669; }

/* Navigation */
.th2-nav {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0;
}
.th2-link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px;
    background: none; border: none;
    border-radius: 50px;
    font-size: 14px; font-weight: 600;
    font-family: var(--font-nav, 'BPG No9', sans-serif);
    color: var(--text-muted, #6b7280);
    cursor: pointer; transition: all .18s;
    white-space: nowrap;
}
.th2-link i { font-size: 13px; }
.th2-link:hover,
.th2-link.active {
    color: #047857; background: #ecfdf5;
}
.th2-dd-arrow { font-size: 9px; opacity: .5; transition: transform .2s; }
.th2-dd:hover .th2-dd-arrow,
.th2-dd.open .th2-dd-arrow { transform: rotate(180deg); opacity: 1; }

/* Dropdown */
.th2-dd { position: relative; }
.th2-dd-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 280px;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.05);
    opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 1000;
}
.th2-dd-menu::before {
    content: '';
    position: absolute; top: -6px; left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px; height: 12px;
    background: #fff;
    border-left: 1px solid var(--border, #e5e7eb);
    border-top: 1px solid var(--border, #e5e7eb);
}
.th2-dd:hover .th2-dd-menu,
.th2-dd.open .th2-dd-menu {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.th2-dd-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text, #111827);
    transition: background .15s;
}
.th2-dd-item:hover,
.th2-dd-item.active { background: #f9fafb; }
.th2-dd-item.active { background: #ecfdf5; }

.th2-dd-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    font-size: 15px;
}
.th2-ic-green   { background: #dcfce7; color: #166534; }
.th2-ic-red     { background: #fee2e2; color: #991b1b; }
.th2-ic-blue    { background: #dbeafe; color: #1e40af; }
.th2-ic-emerald { background: #d1fae5; color: #047857; }
.th2-ic-orange  { background: #ffedd5; color: #9a3412; }
.th2-ic-purple  { background: #ede9fe; color: #6b21a8; }

.th2-dd-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.th2-dd-name {
    font-size: 14px; font-weight: 600;
    font-family: var(--font-input);
}
.th2-dd-sub {
    font-size: 11px; color: var(--text-muted, #6b7280);
    font-family: var(--font-input);
}

/* Search */
.th2-search {
    position: relative;
    flex: 1;
    max-width: 520px;
    min-width: 200px;
}
.th2-search-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    pointer-events: none;
}
.th2-search input {
    width: 100%;
    padding: 11px 48px 11px 42px;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 50px;
    font-size: 14px;
    font-family: var(--font-input, 'ALK Sanet', sans-serif);
    background: #f9fafb;
    outline: none;
    transition: all .2s;
}
.th2-search input:focus {
    background: #fff;
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(5,150,105,.1);
}
.th2-search-btn {
    position: absolute;
    right: 5px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 3px 8px rgba(5,150,105,.3);
}
.th2-search-btn:hover { transform: translateY(-50%) scale(1.08); }

/* Tail (stats / back / burger) */
.th2-tail { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.th2-stats { display: flex; gap: 6px; }
.th2-stat {
    background: #ecfdf5; color: #047857;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px; font-weight: 700;
    font-family: 'Inter', monospace;
    white-space: nowrap;
}
.th2-stat.stores { background: #dbeafe; color: #1e40af; }
.th2-stat.red    { background: #fee2e2; color: #991b1b; }

.th2-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: #059669;
    padding: 7px 14px;
    background: #ecfdf5;
    border-radius: 50px;
    font-size: 13px; font-weight: 600;
    font-family: var(--font-input);
    text-decoration: none;
    transition: all .2s;
}
.th2-back:hover { background: #d1fae5; transform: translateX(-2px); }

/* Burger */
.th2-burger {
    display: none;
    width: 40px; height: 40px;
    background: transparent;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 10px;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all .2s;
}
.th2-burger span {
    display: block;
    width: 18px; height: 2px;
    background: var(--text, #111827);
    border-radius: 2px;
    transition: all .25s;
}
.th2-burger:hover { border-color: #059669; }
.th2-burger:hover span { background: #059669; }

/* ======================== MOBILE DRAWER ======================== */
.th2-drawer {
    position: fixed;
    top: 0; right: -100%;
    width: 320px; max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 10000;
    transition: right .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    box-shadow: -20px 0 60px rgba(0,0,0,.15);
}
.th2-drawer.open { right: 0; }
.th2-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: linear-gradient(135deg, #064e3b, #047857);
    color: #fff;
}
.th2-drawer-head .th2-logo-text { color: #fff; font-size: 20px; }
.th2-drawer-head .th2-logo-dot { color: #6ee7b7; }
.th2-drawer-close {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: 10px;
    color: #fff; font-size: 16px;
    cursor: pointer;
    transition: background .2s;
}
.th2-drawer-close:hover { background: rgba(255,255,255,.22); }

.th2-drawer-body {
    flex: 1; overflow-y: auto;
    padding: 16px 10px;
}
.th2-drawer-group { margin-bottom: 14px; }
.th2-drawer-group h4 {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted, #6b7280);
    margin: 0 0 4px;
    padding: 8px 14px;
    font-family: var(--font-input);
    font-weight: 700;
}
.th2-drawer-group a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    color: var(--text, #111827);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 500;
    font-family: var(--font-input);
    transition: background .15s;
}
.th2-drawer-group a i {
    width: 20px; text-align: center; color: #059669;
}
.th2-drawer-group a:hover { background: #f9fafb; }
.th2-drawer-group a.active { background: #ecfdf5; color: #047857; font-weight: 600; }

.th2-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(3px);
    z-index: 9999;
    opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.th2-backdrop.open { opacity: 1; visibility: visible; }

/* ======================== SEARCH RESULTS (keep existing + polish) ======================== */
.th2-search .search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
    max-height: 440px;
    overflow-y: auto;
    z-index: 1100;
    display: none;
}
.th2-search .search-results.active { display: block; }
.search-loading, .search-no-results {
    padding: 20px; text-align: center;
    color: var(--text-muted, #6b7280);
    font-family: var(--font-input);
    font-size: 13px;
}
.search-no-results i { color: var(--text-muted); margin-right: 6px; }

/* ======================================================================
   FOOTER — .tf2
   ====================================================================== */
.site-footer.tf2 {
    position: relative;
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 40%, #064e3b 100%);
    color: #e5e7eb;
    padding: 60px 0 0;
    margin-top: 60px;
    border-top: none;
    overflow: hidden;
}
.tf2-glow {
    position: absolute;
    top: -80px; left: 50%;
    transform: translateX(-50%);
    width: 120%; height: 240px;
    background: radial-gradient(ellipse at center, rgba(16,185,129,.18), transparent 60%);
    pointer-events: none;
}
.tf2-inner { position: relative; z-index: 1; }

.tf2-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Brand column */
.tf2-brand { padding-right: 20px; }
.tf2-brand-logo {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none;
    margin-bottom: 16px;
}
.tf2-brand-mark {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff; font-size: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(16,185,129,.35);
}
.tf2-brand-text {
    font-size: 22px; font-weight: 800;
    color: #fff;
    font-family: var(--font-heading);
    letter-spacing: .5px;
}
.tf2-brand-dot { color: #6ee7b7; }
.tf2-brand-desc {
    font-size: 13px; line-height: 1.6;
    color: rgba(229,231,235,.75);
    font-family: var(--font-input);
    margin: 0 0 18px;
}
.tf2-brand-stats {
    display: flex; gap: 20px;
}
.tf2-bs {
    display: flex; flex-direction: column; gap: 2px;
    padding-right: 20px;
    border-right: 1px solid rgba(255,255,255,.1);
}
.tf2-bs:last-child { border-right: none; padding-right: 0; }
.tf2-bs-num {
    font-size: 20px; font-weight: 700;
    color: #6ee7b7;
    font-family: 'Inter', monospace;
    line-height: 1;
}
.tf2-bs-lbl {
    font-size: 11px; color: rgba(229,231,235,.6);
    font-family: var(--font-input);
    text-transform: uppercase; letter-spacing: .5px;
}

/* Link columns */
.tf2-col h4 {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700;
    font-family: var(--font-input);
    color: #fff;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.tf2-col h4 i {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(16,185,129,.15);
    color: #6ee7b7;
    border-radius: 6px;
    font-size: 10px;
}
.tf2-col a {
    display: flex; align-items: center; gap: 8px;
    color: rgba(229,231,235,.7);
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-input);
    padding: 4px 0;
    transition: color .2s, transform .2s;
}
.tf2-col a i {
    width: 14px; font-size: 11px;
    color: rgba(110,231,183,.7);
}
.tf2-col a:hover {
    color: #6ee7b7;
    transform: translateX(3px);
}
.tf2-col a.tf2-all {
    margin-top: 10px;
    color: #10b981;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.tf2-col a.tf2-all i { color: #10b981; transition: transform .2s; }
.tf2-col a.tf2-all:hover i { transform: translateX(3px); }

/* Bottom row */
.tf2-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 0 24px;
    flex-wrap: wrap;
    gap: 14px;
}
.tf2-copy {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: rgba(229,231,235,.6);
    font-family: var(--font-input);
}
.tf2-copy strong { color: #fff; font-weight: 700; }
.tf2-copy a {
    color: rgba(229,231,235,.7);
    text-decoration: none;
    transition: color .2s;
}
.tf2-copy a:hover { color: #6ee7b7; }
.tf2-dot { color: rgba(229,231,235,.3); }
.tf2-ver {
    padding: 3px 10px;
    background: rgba(16,185,129,.15);
    color: #6ee7b7;
    border-radius: 20px;
    font-family: 'Inter', monospace;
    font-weight: 700;
    font-size: 11px;
}
.tf2-counter { opacity: .85; transition: opacity .2s; }
.tf2-counter:hover { opacity: 1; }

/* ======================================================================
   RESPONSIVE
   ====================================================================== */
@media (max-width: 1100px) {
    .th2-stats { display: none; }
    .tf2-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
    .tf2-grid .tf2-col:nth-child(5) { grid-column: 2 / -1; }
}

@media (max-width: 900px) {
    .th2-topbar { display: none; }
    .th2-nav { display: none; }
    .th2-burger { display: inline-flex; }
    .th2-main-inner { gap: 12px; }
    .tf2-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .tf2-brand {
        grid-column: 1 / -1;
        padding-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        padding-bottom: 20px;
    }
    .tf2-grid .tf2-col:nth-child(5) { grid-column: auto; }
}

@media (max-width: 640px) {
    .th2-logo-text { font-size: 18px; }
    .th2-logo-mark { width: 34px; height: 34px; font-size: 15px; }
    .th2-search input { font-size: 13px; padding: 9px 44px 9px 38px; }
    .th2-back { display: none; }
    .site-footer.tf2 { padding-top: 40px; }
    .tf2-grid { grid-template-columns: 1fr; gap: 20px; }
    .tf2-brand-stats { gap: 14px; }
    .tf2-bs { padding-right: 14px; }
    .tf2-bs-num { font-size: 18px; }
    .tf2-bottom { flex-direction: column; text-align: center; }
    .tf2-copy { justify-content: center; }
}
