/* ==========================================================================
   TEMUGE CMS — Main Theme
   Utility classes for preview renderers.
   Loaded once, cached by browser. Replaces inline styles in PHP renderers.
   ========================================================================== */

/* --- Text truncation ---------------------------------------------------- */
.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* --- Font sizes --------------------------------------------------------- */
.fs-xs   { font-size: 0.65rem; }
.fs-sm   { font-size: 0.75rem; }
.fs-md   { font-size: 0.85rem; }
.fs-base { font-size: 0.9rem; }
.fs-lg   { font-size: 1.125rem; }
.fs-xl   { font-size: 1.5rem; }
.fs-2xl  { font-size: 1.75rem; }

/* --- Cover images ------------------------------------------------------- */
.cover-img {
    background-size: cover;
    background-position: center;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* --- Thumbnail sizes ---------------------------------------------------- */
.thumb-sm  { width:  60px; height:  40px; flex-shrink: 0; }
.thumb-md  { width:  80px; height:  56px; flex-shrink: 0; }
.thumb-lg  { width: 100px; height:  68px; flex-shrink: 0; }
.thumb-xl  { width: 120px; height:  80px; flex-shrink: 0; }

/* --- Image heights (for card-img-top etc.) ------------------------------ */
.img-h-sm  { height: 130px; object-fit: cover; }
.img-h-md  { height: 160px; object-fit: cover; }
.img-h-base{ height: 180px; object-fit: cover; }
.img-h-lg  { height: 200px; object-fit: cover; }
.img-h-xl  { height: 220px; object-fit: cover; }
.img-h-hero{ height: 400px; object-fit: cover; }

/* --- Avatar circles ----------------------------------------------------- */
.avatar      { border-radius: 50%; object-fit: cover; }
.avatar-xs   { width: 24px; height: 24px; }
.avatar-sm   { width: 36px; height: 36px; }
.avatar-md   { width: 48px; height: 48px; }
.avatar-lg   { width: 56px; height: 56px; }
.avatar-xl   { width: 80px; height: 80px; }

/* --- Section title accent bar ------------------------------------------- */
.section-bar {
    width: 4px;
    height: 24px;
    border-radius: 2px;
    margin-right: 10px;
    background: var(--color-primary, #4f46e5);
}

/* --- Gradient overlays -------------------------------------------------- */
.overlay-bottom {
    background: linear-gradient(transparent 30%, rgba(0,0,0,0.85));
}
.overlay-bottom-light {
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.7));
}
.overlay-radial {
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
}

/* --- Trending number ---------------------------------------------------- */
.trending-num {
    font-size: 1.5rem;
    line-height: 1;
    white-space: nowrap;
    min-width: 28px;
    opacity: 0.3;
}

/* --- Video player ------------------------------------------------------- */
.video-dark-bg {
    background: #0f0f1a;
}
.video-playlist-bg {
    background: #1a1a2e;
}
.video-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-play-btn-sm {
    width: 24px;
    height: 24px;
}

/* --- Ticker / Marquee --------------------------------------------------- */
.ticker-bar {
    background: #1a1a2e;
    color: #fff;
    overflow: hidden;
}
.ticker-label {
    flex-shrink: 0;
    z-index: 1;
}
.ticker-track {
    height: 24px;
    overflow: hidden;
}

/* --- Badge style override (fit-content) --------------------------------- */
.badge-fit {
    width: fit-content;
}

/* --- Countdown ---------------------------------------------------------- */
.countdown-unit {
    background: rgba(255,255,255,0.1);
    min-width: 70px;
}

/* --- Classified / Product image placeholder ----------------------------- */
.placeholder-img {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Icon box ----------------------------------------------------------- */
.icon-box-md {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Whitespace --------------------------------------------------------- */
.nowrap { white-space: nowrap; }

/* --- Aspect ratio helpers ----------------------------------------------- */
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-4x3  { aspect-ratio: 4 / 3; }

/* --- Container (tenant-configurable max-width) ------------------------- */
.zetta-container {
    width: 100%;
    max-width: var(--zetta-container-width, 1320px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    min-height: 60px;
}
.zetta-container:empty {
    min-height: 80px;
    border: 1px dashed #cbd5e1;
    background: rgba(203, 213, 225, .08);
    border-radius: 6px;
}
@media (min-width: 576px) {
    .zetta-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* --- Article content typography ----------------------------------------- */
/* .tt-src — эх сайтын CSS-ээр загварчлагдсан tenant (ж: Тавантолгой)-ийн .article-content-д үйлчлэхгүй */
.article-content:not(:where(.tt-src .article-content)) {
    font-size: 1.125rem;
    line-height: 1.8;
}
.article-content:not(:where(.tt-src .article-content)) p {
    margin-bottom: 1.5rem;
}
.article-content:not(:where(.tt-src .article-content)) h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.article-content:not(:where(.tt-src .article-content)) h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.article-content:not(:where(.tt-src .article-content)) img {
    max-width: 100%;
    height: auto;
}
.article-content:not(:where(.tt-src .article-content)) blockquote {
    font-style: italic;
}
.article-content:not(:where(.tt-src .article-content)) ul, .article-content:not(:where(.tt-src .article-content)) ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}
.article-content:not(:where(.tt-src .article-content)) li {
    margin-bottom: 0.5rem;
}

/* --- Header behavior styles --------------------------------------------- */
.header-shrunk {
    transition: all 0.3s ease;
}
.header-shrunk .header-logo span {
    font-size: 1.25rem !important;
}

/* Mega menu */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
}
.nav-item.dropdown:hover .mega-menu {
    display: block;
}

/* Sidebar header */
.header-sidebar nav a:hover {
    background: rgba(255,255,255,0.1);
}

/* Header transition */
[data-gjs-type^="header-"] {
    transition: all 0.3s ease;
}

/* Hamburger menu animation */
.hamburger-btn svg {
    transition: transform 0.3s ease;
}
.hamburger-btn:hover svg {
    transform: scale(1.1);
}

/* --- Topbar responsive -------------------------------------------------- */
@media (max-width: 575.98px) {
    .bg-dark.text-white.py-1 { font-size: 0.7rem !important; }
    .bg-dark.text-white.py-1 .zetta-container { flex-wrap: wrap; gap: 0.25rem; justify-content: center !important; }
    .bg-dark.text-white.py-1 .gap-3 { gap: 0.5rem !important; }
}

/* --- Utility ------------------------------------------------------------ */
.min-w-0 { min-width: 0; }

/* --- Хүргэлтийн бүсийн хайлттай dropdown (CheckoutRenderer) -------------- */
.zs-zone-select { position: relative; }
.zs-zone-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
}
.zs-zone-select.is-open .zs-zone-toggle { border-color: #0d6efd; }
.zs-zone-toggle .zs-zone-info { flex: 1 1 auto; min-width: 0; }
.zs-zone-caret { flex: 0 0 auto; opacity: .55; transition: transform .16s ease; }
.zs-zone-select.is-open .zs-zone-caret { transform: rotate(180deg); }
.zs-zone-dropdown {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
    overflow: hidden;
}
.zs-zone-search-wrap { padding: 10px; border-bottom: 1px solid #eef1f4; }
.zs-zone-search {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-size: .9rem;
    outline: none;
}
.zs-zone-search:focus { border-color: #0d6efd; }
.zs-zone-list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.zs-zone-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
}
.zs-zone-option:hover { background: #f4f7fb; }
.zs-zone-option.is-selected { background: #eef6fb; }
.zs-zone-option .zs-zone-info { flex: 1 1 auto; min-width: 0; }
.zs-zone-empty { padding: 16px; text-align: center; color: #6c757d; font-size: .9rem; margin: 0; }

/* --- Захиалагчийн нэвтрэлт / хувийн хэсэг (shop app API) ------------------ */
.zs-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.zs-auth__side {
    background: #0d6efd;
    color: #fff;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 18px;
    overflow: hidden;
}
.zs-auth__img { width: 100%; border-radius: 12px; display: block; }
.zs-auth__side-text h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; color: inherit; }
.zs-auth__side-text p { margin: 0; opacity: .85; }
.zs-auth__main { background: #fff; border: 1px solid #e9eef3; border-radius: 16px; padding: 28px; }
.zs-auth__tabs { display: flex; gap: 6px; background: #f2f6f9; border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.zs-auth__tab {
    flex: 1 1 0;
    border: 0;
    background: none;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    color: #6c757d;
    cursor: pointer;
}
.zs-auth__tab.is-active { background: #fff; color: #0d6efd; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.zs-auth__heading { font-size: 1.3rem; font-weight: 800; margin: 0 0 16px; }
.zs-auth__field { display: block; margin-bottom: 14px; }
.zs-auth__field > span { display: block; font-size: .82rem; font-weight: 600; color: #6c757d; margin-bottom: 6px; }
.zs-auth__submit {
    display: inline-block;
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff;
    font-weight: 800;
    padding: 14px 24px;
    margin-top: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}
.zs-auth__submit:hover { background: #0b5ed7; color: #fff; }
.zs-auth__submit:disabled { opacity: .6; cursor: not-allowed; }
.zs-auth__submit--sm { width: auto; padding: 10px 22px; font-size: .9rem; }
.zs-auth__link {
    display: inline-block;
    background: none;
    border: 0;
    padding: 6px 0;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: #0d6efd;
    cursor: pointer;
}
.zs-auth__link.is-danger { color: #dc3545; }
.zs-auth__msg { background: #eef6fb; border-radius: 10px; padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; }
.zs-auth__msg.is-error { background: #fdecea; color: #b42318; }

.zs-account { display: flex; flex-direction: column; gap: 18px; }
.zs-account__guest { background: #fff; border: 1px solid #e9eef3; border-radius: 16px; padding: 32px; text-align: center; }
.zs-account__guest .zs-auth__submit { width: auto; padding: 12px 28px; }
.zs-account__body { display: flex; flex-direction: column; gap: 18px; }
.zs-account__card { background: #fff; border: 1px solid #e9eef3; border-radius: 16px; padding: 24px; }
.zs-account__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.zs-account__head h3 { font-size: 1.1rem; font-weight: 800; margin: 0; }
.zs-account__count { font-size: .85rem; color: #6c757d; }
.zs-account__profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.zs-account__profile .zs-auth__submit { grid-column: 1 / -1; justify-self: start; }
.zs-account__orders { display: flex; flex-direction: column; gap: 10px; }
.zs-account__order {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    border: 1px solid #e9eef3;
    border-radius: 12px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
}
.zs-account__order:hover { border-color: #0d6efd; color: inherit; }
.zs-account__order-main { display: flex; flex-direction: column; gap: 2px; }
.zs-account__order-date { font-size: .82rem; color: #6c757d; }
.zs-account__order-meta { display: flex; align-items: center; gap: 10px; }
.zs-account__chip { background: #eef6fb; border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 700; }
.zs-account__addresses { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.zs-account__address {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e9eef3;
    border-radius: 12px;
    padding: 14px 16px;
}
.zs-account__address.is-default { border-color: #0d6efd; background: #f7fbff; }
.zs-account__address p { margin: 4px 0 0; color: #6c757d; font-size: .9rem; }
.zs-account__address-actions { display: flex; gap: 12px; flex-shrink: 0; }
.zs-account__address-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 0 14px; align-items: end; }
.zs-account__empty { color: #6c757d; margin: 0; }

@media (max-width: 900px) {
    .zs-auth { grid-template-columns: 1fr; }
    .zs-auth__side { order: 2; }
    .zs-account__profile,
    .zs-account__address-form { grid-template-columns: 1fr; }
}

/* --- Сагсны хуудас (dynamic-cart-page) ------------------------------------ */
.zs-cart-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.zs-cart-title { font-size: 1.7rem; font-weight: 800; margin: 0 0 18px; }
.zs-cart-items { display: flex; flex-direction: column; gap: 12px; }
.zs-cart-item {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #e9eef3;
    border-radius: 14px;
    padding: 14px 16px;
}
.zs-cart-item-img {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    background: #f4f7fb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zs-cart-item-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.zs-cart-item-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.zs-cart-item-name { font-size: .98rem; font-weight: 700; }
.zs-cart-item-variant { font-size: .82rem; color: #6c757d; }
.zs-cart-item-price { font-size: .88rem; color: #6c757d; }
.zs-cart-item-qty { display: inline-flex; align-items: stretch; height: 40px; border: 1px solid #e9eef3; border-radius: 999px; overflow: hidden; background: #fff; }
.zs-cart-item-total { font-weight: 800; white-space: nowrap; min-width: 90px; text-align: right; }
.zs-cart-item-remove {
    border: 0;
    background: none;
    color: #adb5bd;
    font-size: 1.05rem;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
}
.zs-cart-item-remove:hover { color: #dc3545; background: #fdecea; }
.zs-cart-empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px solid #e9eef3; border-radius: 16px; color: #adb5bd; }
.zs-cart-empty p { margin: 14px 0 18px; color: #6c757d; }
.zs-cart-back-btn,
.zs-cart-checkout {
    display: inline-block;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff !important;
    font-weight: 800;
    padding: 13px 26px;
    text-decoration: none;
    text-align: center;
}
.zs-cart-summary {
    position: sticky;
    top: 20px;
    background: #fff;
    border: 1px solid #e9eef3;
    border-radius: 16px;
    padding: 22px;
}
.zs-cart-summary[hidden] { display: none; }
.zs-cart-summary-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 16px; }
.zs-cart-checkout { width: 100%; margin-top: 16px; }
.zs-cart-continue { display: block; text-align: center; margin-top: 12px; font-size: .88rem; font-weight: 600; }

@media (max-width: 991px) {
    .zs-cart-page { grid-template-columns: 1fr; }
    .zs-cart-summary { position: static; }
}
@media (max-width: 600px) {
    .zs-cart-item { grid-template-columns: 64px minmax(0, 1fr) auto; row-gap: 10px; }
    .zs-cart-item-img { width: 64px; height: 64px; }
    .zs-cart-item-qty { grid-column: 2; }
    .zs-cart-item-total { grid-column: 3; }
    .zs-cart-item-remove { grid-row: 1; grid-column: 3; justify-self: end; }
}

/* ── Инфографик (App\Models\Infographic, public/js/infographic.js) ─────────── */
.zv-infographic { margin: 1.5rem 0; }
.zv-infographic-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.zv-infographic-title { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.zv-infographic-subtitle { font-size: .7rem; text-transform: uppercase; opacity: .7; }
.zv-infographic-canvas { position: relative; width: 100%; }
.zv-infographic-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1.75rem; font-weight: 600; line-height: 1; pointer-events: none; white-space: nowrap; }
.zv-infographic-embed, .zv-poll-embed { padding: 12px 16px; border: 1px dashed #cbd5e1; border-radius: 8px; color: #64748b; font-size: .875rem; }
