/* Classic 模版專屬樣式
 * 傳統電商風格 — 頂部資訊欄、置中 logo、密集橫向 menu
 */

.tpl-classic-announce {
    font-size: 13px;
    padding: 8px 12px;
    text-align: center;
    letter-spacing: .3px;
}

/* Top utility bar — 深色底（原設計），文字一律用淺色，確保可讀 */
.tpl-classic-utility {
    background: #1e293b;
    color: #cbd5e1;
    font-size: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.tpl-classic-utility .container {
    max-width: 1280px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.tpl-classic-utility-left, .tpl-classic-utility-right { display:flex; align-items:center; gap: 14px; flex-wrap: wrap; }
.tpl-classic-utility svg { vertical-align: -1px; margin-right: 4px; }
.tpl-classic-utility a { color: inherit; text-decoration: none; transition: color .15s; }
.tpl-classic-utility a:hover, .tpl-classic-utility a.is-active { color: #fff; }
.tpl-classic-utility .sep { opacity: .3; }

/* 語言 / 貨幣選擇器位於深色 utility bar 內：觸發按鈕改用同登入/註冊一致嘅淺色，
   唔好跟全域嘅 --header-text（預設 #1e293b，同 bar 底同色 → 重疊睇唔到）。
   下拉面板本身係白底深字，維持不變。 */
.tpl-classic-utility .i18n-sw-btn,
.tpl-classic-utility .ec-cur-sw-btn { color: #cbd5e1; }
.tpl-classic-utility .i18n-sw-btn:hover,
.tpl-classic-utility .i18n-sw.is-open .i18n-sw-btn,
.tpl-classic-utility .ec-cur-sw-btn:hover,
.tpl-classic-utility .ec-cur-sw.is-open .ec-cur-sw-btn {
    background: rgba(255,255,255,.12);
    color: #fff;
}

@media (max-width: 768px) {
    .tpl-classic-utility-left { display: none; }
    .tpl-classic-utility { padding: 6px 0; }
}

/* Header */
.tpl-classic-header {
    background: var(--header-bg, #fff);
    border-bottom: 1px solid rgba(0,0,0,.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.tpl-classic-header .container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.tpl-classic-mid {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
}
.tpl-classic-burger {
    display: none;
    background: transparent; border: none; padding: 8px; cursor: pointer;
    width: 36px; height: 36px; flex-direction: column; gap: 4px; align-items: center; justify-content: center;
    color: inherit;
}
.tpl-classic-burger span { display:block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }

.tpl-classic-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.tpl-classic-logo a { color: inherit; text-decoration: none; }
.tpl-classic-logo img { max-height: 42px; width: auto; vertical-align: middle; }

.tpl-classic-search {
    justify-self: stretch;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}
.tpl-classic-search form {
    display: flex;
    border: 2px solid var(--primary, #0d9488);
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
}
.tpl-classic-search input {
    flex: 1;
    border: none;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
}
.tpl-classic-search button {
    background: var(--primary, #0d9488);
    color: #fff;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tpl-classic-search button svg { width: 18px; height: 18px; }

.tpl-classic-icons { display: flex; align-items: center; gap: 8px; }
/* 只套用喺 icons 區直接子 <a>（帳戶/收藏/購物車），避免污染語言切換器內部嘅連結 */
.tpl-classic-icons > a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 2px;
    transition: background .15s;
}
.tpl-classic-icons > a:hover { background: rgba(0,0,0,.04); }
.tpl-classic-icons > a svg { width: 22px; height: 22px; }
.tpl-classic-icons .lbl { font-size: 13px; font-weight: 500; }
.tpl-classic-cart {
    background: var(--primary, #0d9488);
    color: #fff !important;
    padding: 8px 14px !important;
}
.tpl-classic-cart:hover { background: var(--hover, #0f766e) !important; }
.tpl-classic-cart .count {
    margin-left: 4px;
    padding: 0 6px;
    background: rgba(255,255,255,.25);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

/* Horizontal Nav */
.tpl-classic-nav {
    background: var(--primary, #0d9488);
    color: #fff;
}
.tpl-classic-nav .container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.tpl-classic-nav ul {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.tpl-classic-nav li { position: relative; }
.tpl-classic-nav li > a {
    display: block;
    padding: 13px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .3px;
    white-space: nowrap;
    transition: background .15s;
}
.tpl-classic-nav li > a:hover,
.tpl-classic-nav li > a.is-active {
    background: rgba(0,0,0,.15);
}
.tpl-classic-nav .caret { font-size: 9px; opacity: .8; margin-left: 2px; }
.tpl-classic-hot { color: #fff !important; }
.tpl-classic-hot::before { content: "★"; margin-right: 4px; color: #fde047; }

.tpl-classic-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    color: #1e293b;
    border: 1px solid rgba(0,0,0,.08);
    border-top: 3px solid var(--primary, #0d9488);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .18s, transform .18s, visibility 0s linear .18s;
    z-index: 50;
}
.tpl-classic-nav li:hover .tpl-classic-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0); transition: opacity .18s, transform .18s;
}
.tpl-classic-dropdown li a {
    display: block;
    padding: 9px 18px;
    color: #1e293b;
    text-decoration: none;
    font-size: 13px;
}
.tpl-classic-dropdown li a:hover { background: rgba(0,0,0,.05); color: var(--primary, #0d9488); }
/* 兩層顯示：子分類縮排 + 「查看全部」連結 */
.tpl-classic-subdropdown { list-style: none; margin: 0; padding: 2px 0 4px; }
.tpl-classic-subdropdown li a { padding: 6px 18px 6px 32px; font-size: 12px; color: #64748b; }
.tpl-classic-dropdown-viewall { border-top: 1px solid rgba(0,0,0,.06); margin-top: 4px; }
.tpl-classic-dropdown-viewall a { font-weight: 600; color: var(--primary, #0d9488); }

@media (max-width: 900px) {
    .tpl-classic-mid {
        grid-template-columns: auto 1fr auto;
        gap: 12px;
        padding: 12px 0;
    }
    .tpl-classic-burger { display: inline-flex; order: 0; }
    .tpl-classic-logo { order: 1; }
    .tpl-classic-icons { order: 2; }
    .tpl-classic-search {
        grid-column: 1 / -1;
        order: 10;
        max-width: none;
        margin-top: 8px;
    }
    /* 漢堡選單位置:right 時放最後 */
    .tpl-classic-header[data-burger="right"] .tpl-classic-burger { order: 9; }
    .tpl-classic-icons .lbl { display: none; }
    .tpl-classic-cart { padding: 8px 10px !important; }
    .tpl-classic-nav { display: none; }
}

/* Back-to-top（傳統樣式：方形 + 微圓角） */
.tpl-classic-backtop {
    position: fixed;
    right: 20px;
    bottom: 88px;
    width: 42px;
    height: 42px;
    border-radius: 4px;
    background: #fff;
    color: var(--primary, #0d9488);
    border: 2px solid var(--primary, #0d9488);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s, transform .2s, background .15s, color .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tpl-classic-backtop.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.tpl-classic-backtop:hover {
    background: var(--primary, #0d9488);
    color: #fff;
}
@media (max-width: 768px) {
    .tpl-classic-backtop { right: 14px; bottom: 76px; }
}

/* Mobile drawer */
.tpl-classic-drawer {
    background: #fff;
    color: #1e293b;
}
.tpl-classic-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary, #0d9488);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
}
.tpl-classic-drawer-head .mobile-close {
    background: rgba(255,255,255,.15); border: none; width: 32px; height: 32px;
    border-radius: 2px; cursor: pointer; color: inherit;
    display: inline-flex; align-items: center; justify-content: center;
}
.tpl-classic-drawer-nav { padding: 8px 0; display:flex; flex-direction:column; }
.tpl-classic-drawer-nav a {
    display: block;
    padding: 13px 20px;
    color: #1e293b !important;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,.05);
}
.tpl-classic-drawer-nav a:hover { background: rgba(0,0,0,.03); }
.tpl-classic-drawer-sep { height: 8px; background: #f5f5f5; }

/* ── 內頁 (list / category / brand / search / flash-sales) 樣式微調 ──
 * 通過 body[data-template="classic"] 加高特異性,蓋過 view 內嵌 <style>
 */
body[data-template="classic"] .product-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px !important;
}
body[data-template="classic"] .product-card {
    border: 1px solid #e5e7eb !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}
body[data-template="classic"] .product-card:hover {
    transform: none !important;
    border-color: var(--primary, #0d9488) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
}
body[data-template="classic"] .product-card .info { padding: 10px !important; }
body[data-template="classic"] .product-card .pname {
    font-size: 13px !important;
    white-space: normal !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}
body[data-template="classic"] .product-card .price { font-size: 15px !important; }
body[data-template="classic"] .section-header h2 {
    font-size: 18px !important;
    padding-left: 12px !important;
    border-left: 4px solid var(--primary, #0d9488) !important;
}
body[data-template="classic"] .section-header h2::before { display: none !important; }

@media (max-width: 1100px) { body[data-template="classic"] .product-grid { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 900px) { body[data-template="classic"] .product-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 600px) { body[data-template="classic"] .product-grid { grid-template-columns: repeat(2, 1fr) !important; } }