:root {
  --brand-500: #28a745;
  --brand-600: #218838;
  --brand-400: #34ce57;
  --danger-500: #dc3545;
  --muted-600: #6c757d;
  --text-900: #212529;
  --text-700: #495057;
  --bg-50: #f8f9fa;
  --bg-75: #f6f7f9;
  --bg-100: #f1f3f5;
  --border-200: #e9ecef;
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

html, body {
  background: var(--bg-75);
  color: var(--text-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-main { margin-top: 100px; }
.page-footer { margin-top: 80px; }

/* Header overrides (only this page) */
#header { background: rgba(255,255,255,0.95) !important; backdrop-filter: blur(10px); box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
#header .nav-menu a { color: #333 !important; text-shadow: none !important; font-weight: 500; }
#header .nav-menu a:hover, #header .nav-menu .menu-active > a { color: var(--brand-500) !important; }
#header #logo img { filter: none; }
#mobile-nav-toggle { color: #333 !important; }
.navbar-mobile { background: rgba(255,255,255,0.98) !important; }
.navbar-mobile .nav-menu a { color: #333 !important; text-shadow: none !important; }
.navbar-mobile .nav-menu a:hover, .navbar-mobile .nav-menu .menu-active > a { color: var(--brand-500) !important; }

/* Search / hero section */
.search-section { background: linear-gradient(135deg, var(--bg-50) 0%, var(--bg-100) 100%); padding: 40px 0; margin-bottom: 40px; border-bottom: 1px solid var(--border-200); }
.stats-badge { background: var(--brand-500); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: .9rem; font-weight: 600; }

/* Sidebar (left) */
.catalog-sidebar { background: #fff; border: 1px solid var(--border-200); border-radius: 12px; padding: 16px; position: sticky; top: 100px; max-height: calc(100vh - 140px); overflow: auto; }
.catalog-sidebar .collection-title { font-weight: 800; letter-spacing: .5px; font-size: 1rem; color: #343a40; margin-bottom: 6px; }
.category-group { border-top: 1px solid #eef0f2; padding-top: 10px; margin-top: 10px; }
.category-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; color: #212529; font-weight: 600; padding: 8px 0; }
.category-header .count { color: var(--muted-600); font-weight: 500; }
.subcategory-list { list-style: none; margin: 6px 0 8px 0; padding-left: 0; }
.subcategory-item a { display: block; padding: 6px 6px; color: #212529; text-decoration: none; border-radius: 6px; }
.subcategory-item a:hover { background: var(--bg-50); }
.subcategory-item a.active { color: var(--brand-600); font-weight: 700; }
.sidebar-total a { color: #212529; text-decoration: none; font-weight: 600; display: inline-block; padding: 6px 0; }

/* Category filters (top) if present */
.category-filter { background: #fff; color: var(--text-700); border: 1px solid var(--border-200); border-radius: 999px; padding: 8px 16px; margin: 6px; font-weight: 600; transition: all .2s ease; cursor: pointer; }
.category-filter:hover, .category-filter.active { background: var(--brand-500); color: #fff; border-color: var(--brand-500); box-shadow: 0 6px 16px rgba(40,167,69,.25); transform: translateY(-1px); }

/* Product cards */
.product-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow-md); transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; border: 1px solid var(--border-200); }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.12); }
.product-img { height: 240px; overflow: hidden; position: relative; background: var(--bg-50); display: flex; align-items: center; justify-content: center; }
.product-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; transition: transform .25s ease; }
.product-card:hover .product-img img { transform: scale(1.05); }
.product-info { padding: 16px; }
.product-code { font-size: .9rem; color: var(--brand-600); font-weight: 700; margin-bottom: 6px; letter-spacing: .3px; }
.product-name { font-size: 1rem; font-weight: 700; color: #222; margin-bottom: 8px; line-height: 1.35; max-height: 2.7em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-details { font-size: .86rem; color: #666; }

/* Quantity + Add to cart */
.quantity-input-group { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.quantity-label { font-size: .9rem; font-weight: 600; color: #333; min-width: 44px; }
.quantity-input { width: 80px; padding: 8px 12px; border: 2px solid var(--border-200); border-radius: 8px; text-align: center; font-size: .9rem; font-weight: 700; }
.quantity-input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(40,167,69,0.12); }
.quantity-buttons { display: flex; flex-direction: column; gap: 2px; }
.quantity-btn { background: var(--brand-500); color: #fff; border: none; border-radius: 4px; width: 26px; height: 20px; cursor: pointer; font-size: .8rem; display: flex; align-items: center; justify-content: center; transition: all .15s ease; }
.quantity-btn:hover { filter: brightness(0.95); }
.quantity-btn:active { transform: scale(0.96); }

.add-to-cart-btn { background: var(--brand-500); color: #fff; border: none; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: .95rem; cursor: pointer; transition: all .2s ease; width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 16px rgba(40,167,69,.2); }
.add-to-cart-btn:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(40,167,69,.25); }
.add-to-cart-btn:active { transform: translateY(0); }
.add-to-cart-btn i { font-size: 1rem; }

/* Image fallbacks */
.no-image { background: linear-gradient(45deg, var(--bg-50) 25%, transparent 25%, transparent 75%, var(--bg-50) 75%, var(--bg-50)), linear-gradient(45deg, var(--bg-50) 25%, transparent 25%, transparent 75%, var(--bg-50) 75%, var(--bg-50)); background-size: 20px 20px; background-position: 0 0, 10px 10px; display: flex; align-items: center; justify-content: center; color: #6c757d; font-size: .9rem; text-align: center; width: 100%; height: 100%; }

/* Pagination */
.pagination-container { display: flex; justify-content: center; align-items: center; margin-top: 28px; flex-wrap: wrap; gap: 4px; }
.page-btn { background: #fff; border: 1px solid var(--border-200); color: var(--muted-600); padding: 8px 14px; border-radius: 8px; cursor: pointer; transition: all .15s ease; text-decoration: none; font-weight: 600; }
.page-btn:hover { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.page-btn.active { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }

/* Loading */
.loading { text-align: center; padding: 60px 0; }
.spinner { border: 4px solid #f3f4f6; border-top: 4px solid var(--brand-500); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }
@keyframes fadeInScale { from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes fadeOutScale { from { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } }

/* Floating language switcher */
.language-switcher-fixed { position: fixed; bottom: 20px; left: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); padding: 12px; border-radius: 15px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.2); }
.language-switcher-fixed .lang-btn { background: transparent; border: 1px solid var(--border-200); color: var(--muted-600); padding: 8px 12px; border-radius: 8px; cursor: pointer; transition: all .2s ease; font-size: .85rem; font-weight: 700; min-width: 80px; text-align: center; }
.language-switcher-fixed .lang-btn:hover { background: var(--bg-50); border-color: var(--brand-500); color: var(--brand-600); transform: translateY(-1px); }
.language-switcher-fixed .lang-btn.active { background: var(--brand-500); border-color: var(--brand-500); color: #fff; box-shadow: 0 6px 16px rgba(40,167,69,.25); }
.language-switcher-fixed .lang-btn i { margin-right: 4px; }

/* Cart modal */
.cart-icon { position: fixed; top: 20px; right: 20px; background: var(--brand-500); color: white; border: none; border-radius: 50%; width: 60px; height: 60px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 6px 18px rgba(40,167,69,.3); transition: all .2s ease; z-index: 1000; }
.cart-icon:hover { transform: scale(1.06); box-shadow: 0 10px 24px rgba(0,123,255,.25); }
.cart-badge { position: absolute; top: -5px; right: -5px; background: var(--danger-500); color: #fff; border-radius: 50%; width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }

.cart-modal { display: none; position: fixed; z-index: 2000; inset: 0; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(5px); }
.cart-modal-content { background: #fff; margin: 2% auto; padding: 0; border-radius: 15px; width: 90%; max-width: 800px; max-height: 90vh; overflow: hidden auto; box-shadow: var(--shadow-lg); animation: modalSlideIn .25s ease-out; }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
.cart-modal-header { background: var(--brand-500); color: #fff; padding: 18px 24px; border-radius: 15px 15px 0 0; display: flex; justify-content: space-between; align-items: center; }
.cart-modal-header h3 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: .2px; }
.close-cart { background: none; border: none; color: white; font-size: 2rem; cursor: pointer; padding: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all .2s ease; }
.close-cart:hover { background: rgba(255,255,255,0.2); transform: rotate(90deg); }
.cart-modal-body { padding: 24px; }
.cart-items { margin-bottom: 20px; }
.cart-item { display: flex; align-items: center; padding: 14px; border: 1px solid var(--border-200); border-radius: 10px; margin-bottom: 12px; background: var(--bg-50); transition: all .2s ease; }
.cart-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cart-item-img { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; margin-right: 12px; background: #fff; display: flex; align-items: center; justify-content: center; }
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; color: #333; margin-bottom: 4px; }
.cart-item-code { font-size: .85rem; color: var(--brand-600); font-weight: 700; }
.remove-item { background: var(--danger-500); color: white; border: none; border-radius: 50%; width: 35px; height: 35px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s ease; }
.remove-item:hover { filter: brightness(0.93); transform: scale(1.05); }
.cart-item-quantity { display: flex; align-items: center; gap: 8px; margin-right: 10px; }
.cart-quantity-input { width: 60px; padding: 6px 8px; border: 1px solid var(--border-200); border-radius: 6px; text-align: center; font-size: .85rem; font-weight: 700; }
.cart-quantity-input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 2px rgba(40,167,69,.12); }
.cart-quantity-buttons { display: flex; flex-direction: column; gap: 2px; }
.cart-quantity-btn { background: var(--muted-600); color: #fff; border: none; border-radius: 3px; width: 20px; height: 16px; cursor: pointer; font-size: .7rem; display: flex; align-items: center; justify-content: center; transition: all .15s ease; }
.cart-quantity-btn:hover { filter: brightness(0.95); }

.cart-summary { background: linear-gradient(135deg, var(--bg-50) 0%, var(--bg-100) 100%); padding: 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--border-200); }
.cart-summary h4 { color: #333; margin-bottom: 12px; font-weight: 800; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .95rem; }
.summary-total { font-weight: 800; font-size: 1.05rem; color: var(--brand-600); border-top: 2px solid var(--border-200); padding-top: 10px; margin-top: 6px; }
.request-quote-btn { background: var(--brand-500); color: #fff; border: none; border-radius: 12px; padding: 14px 18px; font-size: 1.05rem; font-weight: 800; cursor: pointer; transition: all .2s ease; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 8px 20px rgba(40,167,69,.25); }
.request-quote-btn:hover { background: var(--brand-600); transform: translateY(-1px); }
.request-quote-btn:disabled { background: var(--muted-600); cursor: not-allowed; transform: none; box-shadow: none; }

/* Quote form */
.quote-form { display: none; background: #fff; border-radius: 12px; padding: 24px; margin-top: 16px; border: 1px solid var(--border-200); }
.quote-form h4 { color: #333; margin-bottom: 14px; font-weight: 800; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; color: #333; }
.form-group input, .form-group textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--border-200); border-radius: 10px; font-size: 1rem; transition: all .2s ease; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(40,167,69,.12); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-actions { display: flex; gap: 12px; margin-top: 18px; }
.btn-secondary { background: var(--muted-600); color: #fff; border: none; border-radius: 10px; padding: 12px 18px; cursor: pointer; transition: all .2s ease; flex: 1; font-weight: 700; }
.btn-secondary:hover { filter: brightness(0.95); }
.btn-primary { background: var(--brand-500); color: #fff; border: none; border-radius: 10px; padding: 12px 18px; cursor: pointer; transition: all .2s ease; flex: 1; font-weight: 800; }
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:disabled { background: var(--muted-600); cursor: not-allowed; }

/* Responsive */
@media (max-width: 992px) { .product-img { height: 220px; } }
@media (max-width: 768px) {
  .language-switcher-fixed { bottom: 15px; left: 15px; padding: 8px; border-radius: 12px; }
  .language-switcher-fixed .lang-btn { padding: 6px 10px; font-size: .8rem; min-width: 70px; }
  .cart-modal-content { width: 95%; margin: 5% auto; }
  .cart-modal-header { padding: 15px 20px; }
  .cart-modal-body { padding: 18px; }
  .cart-item { flex-direction: column; text-align: center; }
  .cart-item-img { margin-right: 0; margin-bottom: 10px; }
  .cart-icon { width: 50px; height: 50px; font-size: 1.2rem; top: 15px; right: 15px; }
  .form-actions { flex-direction: column; }
  .quantity-input-group { flex-direction: column; gap: 8px; align-items: stretch; }
  .quantity-label { text-align: center; min-width: auto; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

