/* Product Portal — Public CSS */
:root {
  --primary:    #1e40af;
  --secondary:  #3b82f6;
  --accent:     #10b981;
  --bg:         #f8fafc;
  --card:       #ffffff;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --muted:      #64748b;
  --radius:     10px;
  --shadow:     0 2px 8px rgba(0,0,0,.07);
  --shadow-md:  0 4px 20px rgba(0,0,0,.1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
/* ── Site Header ── */
.site-header { background: var(--primary); color: #fff; padding: 1rem 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.site-logo img { height: 44px; border-radius: 8px; }
.site-logo-icon { width: 44px; height: 44px; background: rgba(255,255,255,.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.site-brand-name { color: #fff; font-weight: 700; font-size: 1.1rem; }
.site-brand-sub  { color: rgba(255,255,255,.7); font-size: .8rem; }
.site-contact { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-contact a { color: rgba(255,255,255,.85); font-size: .85rem; display: flex; align-items: center; gap: .3rem; }
.site-contact a:hover { color: #fff; text-decoration: none; }
/* ── Nav ── */
.site-nav { background: rgba(0,0,0,.15); }
.site-nav .container { display: flex; align-items: center; gap: 1.5rem; min-height: 44px; }
.site-nav a { color: rgba(255,255,255,.8); font-size: .875rem; font-weight: 500; padding: .5rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.active { color: #fff; border-color: #fff; text-decoration: none; }
/* ── Footer ── */
.site-footer { background: #0f172a; color: #94a3b8; padding: 2.5rem 0 1.5rem; margin-top: 4rem; }
.site-footer .container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-section h3 { color: #e2e8f0; font-size: .95rem; margin-bottom: .75rem; }
.footer-section p, .footer-section a { font-size: .85rem; color: #94a3b8; display: block; margin-bottom: .35rem; }
.footer-section a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; text-align: center; font-size: .8rem; }
/* ── Container ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
/* ── Catalog Page ── */
.catalog-hero { background: var(--primary); color: #fff; padding: 3rem 0 2rem; }
.catalog-hero h1 { font-size: 2rem; margin-bottom: .5rem; }
.catalog-hero p  { opacity: .8; font-size: 1rem; }
.catalog-search-bar { background: var(--card); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin: -1.5rem 0 2rem; display: grid; grid-template-columns: 1fr auto auto auto; gap: .75rem; align-items: end; }
.catalog-search-bar input, .catalog-search-bar select { padding: .65rem .9rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: .9rem; color: var(--text); width: 100%; }
.catalog-search-bar input:focus, .catalog-search-bar select:focus { outline: none; border-color: var(--primary); }
/* ── Product Grid ── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.product-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card-img { aspect-ratio: 4/3; background: #f1f5f9; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-img .no-photo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #cbd5e1; }
.product-card-body { padding: 1rem; }
.product-card-num { font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }
.product-card-name { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: .5rem; line-height: 1.3; }
.product-card-desc { font-size: .875rem; color: var(--muted); margin-bottom: .75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.product-card-tag { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; color: var(--muted); }
.product-card-actions { display: flex; gap: .5rem; }
/* ── Product Table View ── */
.product-table-wrap { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.product-table-wrap table { width: 100%; border-collapse: collapse; }
.product-table-wrap th, .product-table-wrap td { padding: .75rem 1rem; text-align: left; font-size: .875rem; border-bottom: 1px solid var(--border); }
.product-table-wrap th { background: var(--bg); font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.product-table-wrap tbody tr:hover { background: #f8fafc; }
.product-table-wrap td img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
/* ── Product Detail Page ── */
.product-hero { background: #fff; border-bottom: 1px solid var(--border); padding: 2rem 0; }
.product-hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: start; }
.gallery-main { aspect-ratio: 1; background: #f1f5f9; border-radius: var(--radius); overflow: hidden; margin-bottom: .75rem; border: 1px solid var(--border); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .5rem; }
.gallery-thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: .7; transition: .15s; flex-shrink: 0; }
.gallery-thumb:hover, .gallery-thumb.active { border-color: var(--primary); opacity: 1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: .5rem; line-height: 1.2; }
.product-number { font-size: .875rem; color: var(--muted); margin-bottom: 1rem; }
.product-brief { font-size: 1rem; color: var(--muted); margin-bottom: 1.5rem; }
.info-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.info-table td { padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.info-table td:first-child { font-weight: 600; width: 130px; color: var(--muted); }
.qr-barcode-row { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.qr-block { text-align: center; }
.qr-block img { width: 90px; height: 90px; border: 1px solid var(--border); border-radius: 8px; }
.qr-block p { font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.barcode-block img { max-width: 160px; }
.barcode-block p { font-size: .75rem; color: var(--muted); margin-top: .3rem; }
/* ── Content Sections ── */
.content-section { padding: 2.5rem 0; border-bottom: 1px solid var(--border); }
.content-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--primary); display: inline-block; }
.content-body { font-size: .95rem; line-height: 1.8; color: var(--text); }
/* ── Doc Table ── */
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th, .doc-table td { padding: .75rem 1rem; text-align: left; font-size: .875rem; border-bottom: 1px solid var(--border); }
.doc-table th { background: var(--bg); font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; }
.doc-table tbody tr:hover { background: #f8fafc; }
.doc-icon { font-size: 1.1rem; }
/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.2rem; border-radius: 8px; font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all .15s; border: 1.5px solid transparent; }
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--primary);  color: #fff; }
.btn-primary:hover   { background: #1e3a8a; }
.btn-success   { background: var(--accent);   color: #fff; }
.btn-success:hover   { background: #059669; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover   { background: var(--bg); }
.btn-sm        { padding: .35rem .75rem; font-size: .8rem; }
/* ── Badges ── */
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-cat { background: #dbeafe; color: #1e40af; }
.badge-unit { background: #d1fae5; color: #065f46; }
/* ── Pagination ── */
.pagination { display: flex; gap: .3rem; list-style: none; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.page-item .page-link { display: block; padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 6px; font-size: .875rem; color: var(--text); }
.page-item .page-link:hover { background: var(--bg); text-decoration: none; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
/* ── Print ── */
@media print {
  .site-header, .site-nav, .site-footer, .catalog-search-bar, .btn, nav { display: none !important; }
  .product-hero .container { grid-template-columns: 1fr; }
  .gallery-thumbs { display: none; }
}
/* ── Responsive ── */
@media (max-width: 768px) {
  .product-hero .container { grid-template-columns: 1fr; }
  .catalog-search-bar { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; }
  .qr-barcode-row { flex-wrap: wrap; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .catalog-hero h1 { font-size: 1.5rem; }
  .product-info h1 { font-size: 1.35rem; }
}
