/* ============================================================
   STOREFRONT ADDITIONS (elements that only exist once the
   static templates are backed by real data)
   ============================================================ */

[hidden] { display: none !important; }

.breadcrumb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #6b7280;
  margin-bottom: 12px;
}
.breadcrumb-bar a { color: #374151; text-decoration: none; }
.breadcrumb-bar a:hover { color: #ea580c; }
.breadcrumb-bar strong { color: #111827; font-weight: 600; }

.flash-alert {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13.5px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.flash-alert ul { margin: 0; padding-left: 18px; }
.flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.empty-state { text-align: center; padding: 48px 16px; color: #6b7280; font-size: 14px; }
.cart-empty-note { padding: 18px 12px; text-align: center; color: #6b7280; font-size: 13px; }
.cart-empty-note a { color: #111827; font-weight: 600; text-decoration: underline; }

.btn-primary-link {
  display: inline-block;
  background: #d83a00;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin-top: 8px;
}
.btn-primary-link:hover { background: #b53000; }

/* Buttons that were <button> in the static templates and are now links */
a.btn-cart-update,
a.btn-cart-checkout,
a.btn-mini-view-cart,
a.btn-mini-checkout,
a.btn-cartpage-update,
a.btn-cartpage-checkout,
a.btn-buy-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
a.btn-mini-view-cart, a.btn-mini-checkout { display: block; }

/* Pagination */
a.page-btn { text-decoration: none; }
.page-gap { color: #6b7280; padding: 0 2px; }

/* Category page */
.subcategory-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.subcategory-chips a {
  font-size: 12.5px;
  padding: 5px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  color: #374151;
  text-decoration: none;
  background: #fff;
}
.subcategory-chips a:hover { border-color: #ea580c; color: #ea580c; }
.category-description { margin-top: 28px; font-size: 14px; line-height: 1.7; color: #374151; }

/* Hero icon (font icon replaces the inline svg) */
.fingerprint-icon i { font-size: 34px; }

/* Cart page */
.cart-page-empty { text-align: center; padding: 40px 0; }
a.cart-empty-link { text-decoration: none; }

/* Checkout */
.checkout-container .flash-alert { margin-bottom: 0; }
.checkout-input-wrap.has-error .checkout-input { border-color: #dc2626; }
.btn-submit-order:disabled { opacity: .6; cursor: wait; }

/* Order success page */
.order-done-wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.order-done-card { text-align: center; }
.order-done-table { width: 100%; border-collapse: collapse; margin: 18px 0 12px; font-size: 13.5px; text-align: left; }
.order-done-table td { padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.order-done-money { text-align: right; white-space: nowrap; font-weight: 600; }
.order-done-qty { color: #6b7280; }
.order-done-total td { font-weight: 800; color: #d83a00; border-bottom: 0; }
.order-done-meta { text-align: left; font-size: 13.5px; margin: 4px 0; color: #374151; }
.order-done-bank { text-align: left; background: #f9fafb; border: 1px dashed #d1d5db; border-radius: 6px; padding: 12px 14px; margin: 14px 0; font-size: 13.5px; }
.order-done-bank p { margin: 3px 0; }
.order-done-card .success-actions { margin-top: 22px; }

/* Content pages: news, article, static page, contact */
.content-page { background: #fff; padding: 24px 0 48px; }
.content-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.content-narrow { max-width: 860px; }
.content-heading { font-size: 22px; font-weight: 800; color: #111827; margin: 0 0 20px; }
.post-title { font-size: 26px; line-height: 1.35; margin-bottom: 6px; }
.post-date { display: block; font-size: 12.5px; color: #6b7280; margin-bottom: 20px; }

.rich-content { font-size: 15px; line-height: 1.75; color: #1f2937; }
.rich-content img { max-width: 100%; height: auto; border-radius: 4px; }
.rich-content h2, .rich-content h3 { margin: 22px 0 10px; font-weight: 700; color: #111827; }
.rich-content p { margin: 0 0 12px; }
.rich-content ul, .rich-content ol { padding-left: 22px; margin: 0 0 12px; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.rich-content td, .rich-content th { border: 1px solid #e5e7eb; padding: 8px 10px; }
.rich-content a { color: #ea580c; }

.related-posts { margin-top: 36px; border-top: 1px solid #e5e7eb; padding-top: 18px; }
.related-heading { font-size: 15px; font-weight: 800; margin: 0 0 10px; }
.related-posts ul { list-style: none; padding: 0; margin: 0; }
.related-posts li { padding: 6px 0; font-size: 14px; }
.related-posts a { color: #374151; text-decoration: none; }
.related-posts a:hover { color: #ea580c; }

.news-list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-list-card { border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.news-list-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #f3f4f6; }
.news-list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-list-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.news-list-body h2 { font-size: 15px; line-height: 1.45; margin: 0; font-weight: 700; }
.news-list-body h2 a { color: #111827; text-decoration: none; }
.news-list-body h2 a:hover { color: #ea580c; }
.news-list-body p { margin: 0; font-size: 13px; color: #4b5563; line-height: 1.55; }
.news-list-body time { font-size: 12px; color: #9ca3af; }

.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
.contact-info-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; padding: 20px; font-size: 14px; line-height: 1.7; }
.contact-info-box h2 { font-size: 15px; margin: 0 0 12px; }
.contact-info-box p { margin: 6px 0; }
.contact-info-box i { color: #ea580c; width: 18px; }
.contact-info-box a { color: #111827; }
.contact-form { display: flex; flex-direction: column; gap: 6px; }
.contact-form label { font-size: 13px; font-weight: 600; margin-top: 8px; }
.contact-form input, .contact-form textarea {
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 0; border-color: #ea580c; }
.contact-form .btn-primary-link { align-self: flex-start; margin-top: 14px; }

.footer-copyright {
  text-align: center;
  font-size: 12.5px;
  color: #9ca3af;
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

@media (max-width: 860px) {
  .news-list-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .news-list-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 21px; }
  .content-page { padding-bottom: 80px; }
}

/* Logo images */
.site-logo-img { height: 80px; width: auto; display: block; }
.drawer-logo-img { height: 36px; width: auto; display: block; }
.footer-logo-img { height: 60px; width: auto; display: block; background: #fff; border-radius: 4px; padding: 2px 6px; }
.checkout-brand-title .site-logo-img { height: 40px; }
@media (max-width: 575px) { .site-logo-img { height: 38px; } }

/* Admin-uploaded home banners */
.hero-slide-image img { width: 100%; height: auto; display: block; }
.hero-slide-image a { display: block; }

/* Home: flash sale slider shows 4 cards at a time */
.products-grid.flash-grid {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 4);
}
@media (max-width: 1024px) {
  .products-grid.flash-grid { grid-auto-columns: calc((100% - 24px) / 3); }
}
@media (max-width: 768px) {
  .products-grid.flash-grid { grid-auto-columns: calc((100% - 12px) / 2); }
}
@media (max-width: 575px) {
  .products-grid.flash-grid {
    grid-template-columns: none !important;
    grid-auto-columns: calc((100% - 8px) / 2);
  }
}

/* Home: category blocks, 4 columns x 2 rows, no slider */
.home-category-grid { padding: 0 2px; }

/* Home news: 3 per row, slides horizontally when there are more */
.news-grid {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.news-grid::-webkit-scrollbar { display: none; }
.news-card { scroll-snap-align: start; }
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: none;
    grid-auto-columns: calc((100% - 16px) / 2);
  }
}
@media (min-width: 576px) {
  .news-few .news-nav-buttons { display: none; }
}

/* Customer accounts */
.flash-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.flash-info a { color: inherit; font-weight: 700; }
.header-account-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #374151; text-decoration: none; margin-right: 14px; white-space: nowrap; }
.header-account-link:hover { color: #ea580c; }

.auth-card { max-width: 440px; margin: 0 auto; border: 1px solid #e5e7eb; border-radius: 8px; padding: 26px 24px; background: #fff; }
.auth-card .content-heading { text-align: center; }
.auth-card form { display: flex; flex-direction: column; gap: 6px; }
.auth-card label, .account-form label { font-size: 13px; font-weight: 600; margin-top: 8px; }
.auth-card input, .account-form input, .account-form select {
  border: 1px solid #d1d5db; border-radius: 4px; padding: 10px 12px; font: inherit; font-size: 14px; background: #fff;
}
.auth-card input:focus, .account-form input:focus, .account-form select:focus { outline: 0; border-color: #ea580c; }
.auth-card .btn-primary-link { width: 100%; margin-top: 16px; }
.auth-remember { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.auth-remember input { width: auto; }
.auth-switch { text-align: center; font-size: 13.5px; margin-top: 16px; }
.auth-switch a { color: #ea580c; font-weight: 700; }

.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.account-nav { border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; background: #fff; }
.account-nav-hello { padding: 14px 16px; background: #f9fafb; font-size: 13.5px; border-bottom: 1px solid #e5e7eb; }
.account-nav a, .account-nav button {
  display: block; width: 100%; text-align: left; padding: 11px 16px; font-size: 14px; color: #374151;
  text-decoration: none; background: none; border: 0; border-bottom: 1px solid #f3f4f6; cursor: pointer; font-family: inherit;
}
.account-nav a:hover, .account-nav button:hover { color: #ea580c; background: #fff7ed; }
.account-nav a.active { color: #ea580c; font-weight: 700; background: #fff7ed; }
.account-panel { border: 1px solid #e5e7eb; border-radius: 6px; padding: 22px; background: #fff; }
.account-panel h2 { font-size: 17px; margin: 0 0 14px; }
.account-panel + .account-panel { margin-top: 20px; }
.account-form { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.account-form .btn-primary-link { align-self: flex-start; margin-top: 14px; }
.account-address-box { background: #f9fafb; border: 1px dashed #d1d5db; border-radius: 6px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }

.order-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-table th, .order-table td { padding: 10px 8px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.order-table td.num, .order-table th.num { text-align: right; white-space: nowrap; }
.order-table a { color: #ea580c; font-weight: 700; text-decoration: none; }
.order-status { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #f3f4f6; }
.order-status.pending { background: #fef3c7; color: #92400e; }
.order-status.processing { background: #dbeafe; color: #1d4ed8; }
.order-status.completed { background: #dcfce7; color: #166534; }
.order-status.cancelled { background: #fee2e2; color: #991b1b; }

@media (max-width: 860px) {
  .account-layout { grid-template-columns: 1fr; }
  .order-table .hide-mobile { display: none; }
}

.header-account-link { font-size: 20px; margin-right: 16px; }

/* Tablet widths (576px - 1080px): menu has too many items for one line, so let it wrap instead of being cut off */
@media (min-width: 576px) and (max-width: 1080px) {
  .header-top-container { gap: 12px; }
  .search-box-wrapper { min-width: 0; }
  .header-account-link { margin-right: 10px; }

  .nav-container { justify-content: center; padding: 0; }
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }
  .nav-menu::before { clip-path: none; }
  .nav-divider { display: none; }
  .nav-link { padding: 10px 11px; font-size: 12.5px; }
}

/* 576px - 900px: logo + account/hotline on the first row, search bar on its own full-width row */
@media (min-width: 576px) and (max-width: 900px) {
  .header-top-container { flex-wrap: wrap; row-gap: 10px; }
  .header-right { margin-left: auto; }
  .search-box-wrapper { order: 3; flex: 1 1 100%; max-width: none; }
}

/* Never let off-screen dropdowns / sliders create a horizontal page scroll */
html, body { overflow-x: clip; }

/* Tablet: menu wraps over several rows, so dropdowns anchor to the whole menu bar instead of each item (they used to overflow the right edge) */
@media (min-width: 576px) and (max-width: 1080px) {
  .nav-item.has-dropdown { position: static; }
  .nav-menu { position: relative; }
  .dropdown-menu { left: 0; right: auto; }
}

/* Search suggestions */
.search-box-wrapper, .mobile-search-row { position: relative; }
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1200;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
  overflow: hidden;
  max-height: 70vh;
  overflow-y: auto;
}
.mobile-search-row .search-suggest { left: 12px; right: 12px; }
.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: #111827;
  border-bottom: 1px solid #f3f4f6;
}
.search-suggest-item:hover { background: #fff7ed; }
.search-suggest-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; flex: 0 0 56px; background: #f3f4f6; }
.search-suggest-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.search-suggest-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-suggest-price { font-size: 13.5px; font-weight: 700; color: #d83a00; }
.search-suggest-price s { margin-left: 8px; font-weight: 400; color: #9ca3af; font-size: 12px; }
.search-suggest-all { display: block; text-align: center; padding: 10px; font-size: 13px; font-weight: 700; color: #ea580c; text-decoration: none; background: #f9fafb; }
.search-suggest-empty { padding: 16px; text-align: center; font-size: 13.5px; color: #6b7280; }
