/* ==========================================================
   TTGears - shared storefront styles (header, search, toast,
   floating WhatsApp). Page sections live in their own files.
   ========================================================== */

:root {
    --tt-accent: #ff6b35;
    --tt-accent-2: #f7931e;
    --tt-accent-dark: #e2541f;
    --tt-accent-soft: #fff1ea;
    --tt-ink: #1c2733;
    --tt-ink-2: #2c3e50;
    --tt-muted: #6b7a89;
    --tt-bg-soft: #f6f7f9;
    --tt-border: #e7e9ee;
    --tt-success: #1e9e5a;
    --tt-danger: #d64545;
    --tt-whatsapp: #25d366;
    --tt-radius: 12px;
    --tt-shadow: 0 4px 18px rgba(28, 39, 51, 0.08);
    --tt-shadow-lg: 0 12px 32px rgba(28, 39, 51, 0.14);
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Top bar ---------- */
.modern-top-bar {
    background: var(--tt-ink);
    padding: 6px 0;
    font-size: 13px;
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.top-bar-social .social-m {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.top-bar-social .social-m li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.top-bar-social .social-m li a:hover {
    background: var(--tt-accent);
    color: #fff;
}

.top-bar-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-bar-links .top-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.top-bar-links .top-link:hover { color: #fff; }
.top-bar-links .top-link-whatsapp i { color: var(--tt-whatsapp); font-size: 15px; }

/* ---------- Header ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--tt-border);
    position: relative;
    z-index: 900;
}

.site-header-main {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 0;
}

.site-header .logo { flex-shrink: 0; }
.site-header .logo img { height: 56px; width: auto; max-height: none; }

.site-header-search {
    flex: 1;
    max-width: 640px;
    margin-inline: auto;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--tt-accent-soft);
    color: var(--tt-ink-2);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.header-cart:hover {
    background: var(--tt-accent);
    color: #fff;
    text-decoration: none;
}

.header-cart-icon {
    position: relative;
    font-size: 18px;
    color: var(--tt-accent);
    line-height: 1;
}

.header-cart:hover .header-cart-icon { color: #fff; }

.header-cart .cart-count {
    position: absolute;
    top: -9px;
    left: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--tt-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.header-cart .cart-count:empty { display: none; }

.header-menu-toggler {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--tt-border);
    border-radius: 10px;
    background: #fff;
    color: var(--tt-ink-2);
    font-size: 18px;
    cursor: pointer;
}

.site-header-nav {
    border-top: 1px solid var(--tt-border);
    padding: 6px 0;
}

/* ---------- Search ---------- */
.site-search {
    position: relative;
    display: flex;
    margin: 0;
}

.site-search-input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 18px;
    border: 2px solid var(--tt-border);
    border-left: 0;
    border-radius: 0 999px 999px 0;
    background: var(--tt-bg-soft);
    font-size: 15px;
    color: var(--tt-ink);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
}

.site-search-input::placeholder { color: #98a3ae; }

.site-search-input:focus {
    border-color: var(--tt-accent);
    background: #fff;
}

.site-search-btn {
    width: 56px;
    height: 46px;
    border: 0;
    border-radius: 999px 0 0 999px;
    background: var(--tt-accent);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.site-search-btn:hover { background: var(--tt-accent-dark); }

.site-search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 1000;
    background: #fff;
    border-radius: var(--tt-radius);
    box-shadow: var(--tt-shadow-lg);
    border: 1px solid var(--tt-border);
    overflow: hidden;
}

.suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    color: var(--tt-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--tt-border);
}

.suggest-item:hover,
.suggest-item.is-active,
.suggest-all:hover,
.suggest-all.is-active {
    background: var(--tt-accent-soft);
    text-decoration: none;
    color: var(--tt-ink);
}

.suggest-item img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

.suggest-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.suggest-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggest-meta { font-size: 12px; color: var(--tt-muted); }

.suggest-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--tt-accent);
    white-space: nowrap;
}

.suggest-item.is-out { opacity: 0.6; }

.suggest-all {
    display: block;
    padding: 11px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--tt-accent);
}

.suggest-empty {
    padding: 16px;
    font-size: 14px;
    color: var(--tt-muted);
    text-align: center;
}

/* ---------- Floating WhatsApp ---------- */
.whatsapp-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 950;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 54px;
    padding: 0 18px 0 16px;
    border-radius: 999px;
    background: var(--tt-whatsapp);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float i { font-size: 26px; }

.whatsapp-float:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.45);
}

/* ---------- Toast (add to cart etc.) ---------- */
.tt-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px 12px 18px;
    border-radius: var(--tt-radius);
    background: var(--tt-ink);
    color: #fff;
    font-size: 14px;
    box-shadow: var(--tt-shadow-lg);
    transform: translate(-50%, -20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.tt-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.tt-toast .tt-toast-icon { font-size: 18px; color: #4cd68a; }
.tt-toast.is-error .tt-toast-icon { color: #ff8a8a; }

.tt-toast a {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--tt-accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tt-toast a:hover { background: var(--tt-accent-dark); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .site-header {
        position: sticky;
        top: 0;
        box-shadow: 0 2px 10px rgba(28, 39, 51, 0.06);
    }

    .site-header-main {
        flex-wrap: wrap;
        gap: 10px 12px;
        padding: 10px 0;
    }

    .site-header .logo img { height: 44px; }

    .site-header-actions { margin-inline-start: auto; }

    .site-header-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .header-menu-toggler { display: inline-flex; align-items: center; justify-content: center; }

    .site-header-nav {
        border-top: 0;
        padding: 0;
    }

    .site-header-nav .main-navbar .navbar-collapse { margin-bottom: 10px; }

    .site-search-input { height: 42px; font-size: 14px; }
    .site-search-btn { height: 42px; width: 48px; }
}

@media (max-width: 767.98px) {
    .top-bar-links .top-link-whatsapp span { display: none; }

    .header-cart { padding: 8px 12px; }
    .header-cart-text { display: none; }

    .whatsapp-float {
        right: 14px;
        bottom: 14px;
        width: 54px;
        padding: 0;
        justify-content: center;
    }

    .whatsapp-float-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
