/* ═══════════════════════════════════════════
   ЦАМХАГ — site.css  (цэвэрлэсэн хувилбар)
   ═══════════════════════════════════════════ */

/* ── ROOT VARIABLES ── */
:root {
    --blue-dark:   #1e40af;
    --blue:        #2563eb;
    --blue-light:  #3b82f6;
    --blue-pale:   #eff6ff;
    --amber:       #f59e0b;
    --amber-light: #fef3c7;
    --text-dark:   #0f172a;
    --text-mid:    #475569;
    --text-light:  #94a3b8;
    --border:      #e2e8f0;
    --bg:          #f8fafc;
    --white:       #ffffff;
    --radius:      12px;
    --shadow:      0 2px 16px rgba(30,64,175,0.08);
    --shadow-hover:0 8px 32px rgba(30,64,175,0.16);
}

/* ── RESET ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text-dark); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ══════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════ */
.topbar { background: #0f172a; }
.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.topbar-left {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}
.topbar-left span {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px;
    border-right: 1px solid #1e293b;
}
.topbar-left span:first-child { padding-left: 0; }
.topbar-left span:last-child  { border-right: none; }
.topbar-sep { display: none; }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.topbar-right a {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.topbar-right a:hover { color: #fff; }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 80px;
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: space-between;
}
/* Лого */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.header-logo img { height: 72px; width: auto; }
.logo-box {
    width: 76px; height: 76px;
    background: var(--blue-dark);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 26px; font-weight: 800;
}
.logo-name {
    display: block;
    font-size: 22px; font-weight: 800;
    color: var(--blue-dark);
    letter-spacing: -0.5px; line-height: 1.1;
}
.logo-sub {
    display: block;
    font-size: 16px;
    color: var(--text-light);
    font-weight: 400;
}
/* Хайлт */
.header-search { flex: 1; max-width: 520px; margin-left: auto; }
.header-search form {
    display: flex; align-items: center;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0 6px 0 16px;
    height: 46px; gap: 10px;
    transition: border-color 0.15s;
}
.header-search form:focus-within {
    border-color: var(--blue);
    background: #fff;
}
.header-search i { color: var(--text-light); font-size: 16px; flex-shrink: 0; }
.header-search input {
    border: none; outline: none;
    background: transparent;
    font-size: 14px; flex: 1; color: var(--text-dark);
}
.header-search button {
    background: var(--blue-dark); color: #fff;
    border: none; padding: 8px 18px;
    border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s;
}
.header-search button:hover { background: var(--blue); }
/* Үйлдлийн товчнууд */
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.header-action-btn {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    color: var(--text-dark);
    font-size: 20px;
    transition: all 0.15s;
    text-decoration: none;
    border: 1.5px solid transparent;
}
.header-action-btn:hover {
    background: var(--bg);
    border-color: var(--border);
    color: var(--blue-dark);
}
.header-action-user {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    color: var(--text-dark);
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.header-action-user i { font-size: 18px; }
.header-action-user:hover {
    border-color: var(--blue);
    color: var(--blue-dark);
    background: var(--blue-pale);
}

/* ══════════════════════════════════════════
   NAVBAR + АНГИЛАЛ DROPDOWN
══════════════════════════════════════════ */
.site-nav {
    background: var(--blue-dark);
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
}
/* Ангилал товч */
.nav-cat-wrap { position: relative; }
.nav-cat-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 0 20px;
    height: 48px;
    background: var(--amber);
    color: #0f172a;
    border: none; cursor: pointer;
    font-size: 13px; font-weight: 700;
    transition: background 0.15s;
    white-space: nowrap;
}
.nav-cat-btn:hover { background: #fbbf24; }
.nav-cat-btn i:first-child { font-size: 16px; }
.nav-cat-arrow { font-size: 10px; transition: transform 0.2s; margin-left: 2px; }
/* Dropdown */
.cat-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 680px;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    z-index: 1000;
    border: 1px solid var(--border);
    border-top: 3px solid var(--amber);
    overflow: hidden;
}
.cat-dropdown.open { display: block; }
.cat-dropdown-inner {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 340px;
}
/* Ангилалын жагсаалт (зүүн) */
.cat-list {
    border-right: 1px solid var(--border);
    overflow-y: auto;
    max-height: 380px;
    padding: 8px 0;
}
.cat-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background 0.1s;
    cursor: pointer;
    color: var(--text-dark);
}
.cat-list-item:hover { background: var(--blue-pale); }
.cat-list-item.cat-all {
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--blue-dark);
}
.cat-list-icon {
    width: 32px; height: 32px;
    background: var(--bg); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--blue); font-size: 15px; flex-shrink: 0;
    transition: all 0.15s;
}
.cat-list-item:hover .cat-list-icon { background: var(--blue); color: #fff; }
.cat-list-item span { flex: 1; font-size: 13px; font-weight: 500; }
.cat-list-count {
    background: var(--bg); color: var(--text-light);
    font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: 999px;
}
/* Preview (баруун) */
.cat-preview {
    padding: 20px;
    display: flex; flex-direction: column;
    background: #fafbff;
}
.cat-preview-empty {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-light); gap: 8px; font-size: 13px;
}
.cat-preview-empty i { font-size: 32px; }
.cat-preview-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 12px;
}
.cat-preview-name { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.cat-preview-link {
    font-size: 12px; font-weight: 600;
    color: var(--blue); text-decoration: none;
    display: flex; align-items: center; gap: 4px;
}
.cat-preview-link:hover { color: var(--blue-dark); }
.cat-preview-img-wrap { margin-bottom: 4px; }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
    background: linear-gradient(135deg, var(--blue-dark) 0%, #1d4ed8 50%, #2563eb 100%);
    position: relative;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: center;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 60px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,158,11,0.2);
    color: var(--amber);
    border: 1px solid rgba(245,158,11,0.3);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    margin-bottom: 16px;
}
.hero h1 {
    font-size: 44px; font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -1px;
}
.hero h1 span { color: var(--amber); }
.hero p {
    font-size: 16px;
    color: rgba(255,255,255,0.75);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 440px;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-hero-primary {
    background: var(--amber);
    color: var(--text-dark);
    font-weight: 700; font-size: 14px;
    padding: 12px 28px;
    border-radius: 999px;
    border: none; cursor: pointer;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-primary:hover {
    background: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(245,158,11,0.4);
}
.btn-hero-secondary {
    background: rgba(255,255,255,0.12);
    color: var(--white);
    font-weight: 600; font-size: 14px;
    padding: 12px 28px;
    border-radius: 999px;
    border: 1.5px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.2); }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; }
.hero-stat-num {
    font-size: 26px; font-weight: 800;
    color: var(--white); line-height: 1;
}
.hero-stat-label {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
}
.hero-image { display: flex; justify-content: center; align-items: center; }
.hero-image img {
    width: 100%; max-width: 460px;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    object-fit: cover; height: 320px;
}
.hero-image-placeholder {
    width: 100%; max-width: 460px; height: 320px;
    background: rgba(255,255,255,0.08);
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 20px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: rgba(255,255,255,0.4);
    font-size: 14px; gap: 8px;
}
.hero-image-placeholder i { font-size: 48px; }

/* ══════════════════════════════════════════
   SECTION LAYOUT
══════════════════════════════════════════ */
.section { padding: 64px 0; }
.section-alt { background: var(--white); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--blue-pale); color: var(--blue);
    font-size: 12px; font-weight: 600;
    padding: 4px 14px; border-radius: 999px;
    margin-bottom: 10px;
}
.section-title {
    font-size: 30px; font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px; letter-spacing: -0.5px;
}
.section-sub { font-size: 15px; color: var(--text-mid); }

/* ══════════════════════════════════════════
   АНГИЛАЛЫН GRID (нүүр хуудас)
══════════════════════════════════════════ */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.cat-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}
.cat-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}
.cat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: var(--blue-pale); color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin: 0 auto 10px;
    transition: all 0.2s;
}
.cat-card:hover .cat-icon { background: var(--blue); color: var(--white); }
.cat-name { font-size: 12px; font-weight: 600; color: var(--text-dark); line-height: 1.3; }
.cat-count { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ══════════════════════════════════════════
   БАРААНЫ КАРТ
══════════════════════════════════════════ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.product-card-site {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
    display: flex; flex-direction: column;
}
.product-card-site:hover {
    border-color: var(--blue-light);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}
.product-card-img {
    position: relative; overflow: hidden;
    height: 180px; background: var(--bg);
}
.product-card-img img {
    width: 100%; height: 100%;
    object-fit: cover; transition: transform 0.3s;
}
.product-card-site:hover .product-card-img img { transform: scale(1.06); }
.product-card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--text-light); font-size: 36px;
}
.badge-discount {
    position: absolute; top: 10px; left: 10px;
    background: #ef4444; color: var(--white);
    font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
}
.badge-new {
    position: absolute; top: 10px; left: 10px;
    background: var(--blue); color: var(--white);
    font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
}
.badge-out {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.6); color: var(--white);
    font-size: 10px; font-weight: 600;
    padding: 3px 8px; border-radius: 999px;
}
.product-card-body {
    padding: 14px; flex: 1;
    display: flex; flex-direction: column;
}
.product-card-cat {
    font-size: 10px; font-weight: 600;
    color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.product-card-name {
    font-size: 14px; font-weight: 700;
    color: var(--text-dark); line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden; flex: 1;
}
.product-card-code { font-size: 10px; color: var(--text-light); margin-bottom: 8px; }
.product-card-price {
    display: flex; align-items: baseline;
    gap: 6px; margin-bottom: 10px;
}
.price-current { font-size: 18px; font-weight: 800; color: var(--blue-dark); }
.price-old { font-size: 12px; text-decoration: line-through; color: var(--text-light); }
.price-unit { font-size: 11px; color: var(--text-light); margin-left: auto; }
.product-card-footer { padding: 0 14px 14px; }
.btn-addcart {
    width: 100%;
    background: var(--blue-dark); color: var(--white);
    border: none; padding: 9px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-addcart:hover { background: var(--blue); transform: translateY(-1px); }
.btn-addcart:disabled { background: var(--text-light); cursor: not-allowed; transform: none; }

/* ══════════════════════════════════════════
   FEATURES
══════════════════════════════════════════ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.feature-card {
    text-align: center; padding: 28px 20px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    transition: all 0.2s;
}
.feature-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.feature-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    background: var(--blue-pale); color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin: 0 auto 14px;
}
.feature-title { font-size: 14px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.feature-desc  { font-size: 12px; color: var(--text-mid); line-height: 1.6; }

/* ══════════════════════════════════════════
   CONTACT
══════════════════════════════════════════ */
.contact-section {
    background: linear-gradient(135deg, var(--blue-dark) 0%, #1d4ed8 100%);
    padding: 64px 0;
}
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 48px; align-items: center;
}
.contact-title { font-size: 28px; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.contact-sub { font-size: 15px; color: rgba(255,255,255,0.7); margin-bottom: 28px; line-height: 1.7; }
.contact-items { display: flex; flex-direction: column; gap: 14px; }
.contact-item { display: flex; align-items: center; gap: 12px; }
.contact-item-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,255,255,0.12); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.contact-item-text { color: rgba(255,255,255,0.85); font-size: 14px; }
.contact-item-label { font-size: 11px; color: rgba(255,255,255,0.5); display: block; margin-bottom: 2px; }
.contact-map {
    border-radius: var(--radius); overflow: hidden;
    height: 280px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.4);
    font-size: 14px; flex-direction: column; gap: 8px;
}
.contact-map i { font-size: 36px; }
.contact-map iframe { width: 100%; height: 100%; border: none; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.site-footer { background: var(--text-dark); padding: 48px 0 24px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 40px;
}
.footer-brand-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand-logo img { height: 36px; }
.footer-brand-name { font-size: 18px; font-weight: 800; color: var(--white); }
.footer-brand-desc { font-size: 13px; color: #64748b; line-height: 1.7; margin-bottom: 20px; }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.06); color: #94a3b8;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: all 0.15s;
}
.footer-social a:hover { background: var(--blue); color: var(--white); }
.footer-col-title {
    font-size: 13px; font-weight: 700; color: var(--white);
    margin-bottom: 16px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 13px; color: #64748b; transition: color 0.15s; }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.footer-copy { font-size: 12px; color: #475569; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid   { grid-template-columns: 1fr 1fr; }
    .cat-dropdown  { width: 480px; }
}
@media (max-width: 768px) {
    .hero-inner   { grid-template-columns: 1fr; }
    .hero h1      { font-size: 30px; }
    .hero-image   { display: none; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid  { grid-template-columns: 1fr; gap: 24px; }
    .topbar-left span:nth-child(3),
    .topbar-left span:nth-child(4) { display: none; }

    /* Header mobile */
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
    }
    .header-logo    { order: 1; flex: 1; min-width: 0; }
    .header-actions { order: 2; flex-shrink: 0; }
    .header-search  {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0;
        flex: none;
    }
    .cat-dropdown { width: 100vw; left: 0; }
}

@media (max-width: 480px) {
    body { overflow-x: hidden; }

    .topbar-left   { display: none; }
    .container     { padding: 0 12px; }
    .section       { padding: 40px 0; }
    .nav-inner     { padding: 0 12px; }
    .nav-cat-btn   { padding: 0 12px; font-size: 12px; }

    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cat-grid      { grid-template-columns: repeat(3, 1fr); }
    .features-grid { grid-template-columns: 1fr; }
    .hero-stats    { gap: 16px; }
    .hero-inner    { padding: 32px 16px; }

    .product-card-img    { height: 140px; }
    .product-card-body   { padding: 10px; }
    .product-card-name   { font-size: 12px; }
    .price-current       { font-size: 15px; }
    .product-card-footer { padding: 0 10px 10px; }
    .btn-addcart         { font-size: 11px; padding: 8px; }

    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}