/* ============================================================
   GL BIOCHEM — PRODUCTS & PRICE LIST · HERITAGE INSTITUTIONAL
   Formal price schedules · ledger tables · catalog typography
   ============================================================ */

.products-section { padding: 2.25rem 0 4.5rem; background: transparent; }

/* === TOOLBAR === */
.products-toolbar {
    display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem;
    animation: riseIn 0.5s 0.1s cubic-bezier(0.25,0.6,0.3,1) both;
}
.category-filters {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.cat-filter-btn {
    display: inline-flex; align-items: center;
    padding: 0.5rem 1.125rem; font-size: 0.75rem; font-weight: 600;
    border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--gray-600); background: var(--white);
    transition: all var(--transition-fast); white-space: nowrap;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.06em; text-transform: uppercase;
}
.cat-filter-btn:hover { border-color: var(--gold); color: var(--primary); text-decoration: none; }
.cat-filter-btn.active {
    background: var(--primary); color: var(--gold-light); border-color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(203,173,106,0.35), 0 2px 6px rgba(21,34,63,0.22);
}
.search-bar { display: flex; max-width: 480px; }
.search-input {
    flex: 1; padding: 0.75rem 1.125rem; font-size: 14px;
    border: 1px solid var(--gray-300); border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    outline: none; font-family: var(--font-family);
    background: var(--white); color: var(--gray-800);
    box-shadow: inset 0 1px 2px rgba(40,32,12,0.04);
    transition: border-color var(--transition-fast);
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--gray-400); }
.search-btn {
    padding: 0 1.25rem; background: var(--primary); color: var(--gold-light);
    border: 1px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer; transition: background var(--transition-fast);
}
.search-btn:hover { background: var(--primary-light); }

/* === RESULTS INFO === */
.results-info {
    font-size: 13px; color: var(--gray-500);
    margin-bottom: 1.25rem; padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gold-hairline);
    letter-spacing: 0.03em;
    font-style: italic; font-family: var(--font-display);
}
.results-info strong { color: var(--primary); font-style: normal; }

/* === PRODUCTS TABLE (formal price schedule) === */
.products-table-wrap {
    overflow-x: auto; border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300); background: var(--white);
    box-shadow: var(--shadow-md), 0 0 0 4px var(--paper), 0 0 0 5px var(--gold-hairline);
    animation: riseIn 0.55s 0.18s cubic-bezier(0.25,0.6,0.3,1) both;
}
.products-table {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.products-table thead { background: var(--primary); }
.products-table th {
    padding: 0.875rem 1rem; text-align: left; font-weight: 600;
    color: var(--gold-light); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.12em;
    border-bottom: 2px solid var(--gold); white-space: nowrap;
}
.products-table td {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
}
.products-table tbody tr { transition: background var(--transition-fast); }
.products-table tbody tr:hover { background: var(--gold-pale); }
.products-table tbody tr:nth-child(even) { background: var(--gray-50); }
.products-table tbody tr:nth-child(even):hover { background: var(--gold-pale); }
.products-table tbody tr:last-child td { border-bottom: none; }
.products-table .cat-no { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gray-500); white-space: nowrap; letter-spacing: 0.01em; }
.products-table .product-name { font-weight: 600; color: var(--primary-dark); }
.products-table .formula { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gray-500); }
.products-table .price { font-weight: 600; color: var(--primary); white-space: nowrap; font-family: var(--font-mono); }
.purity-badge {
    display: inline-block; padding: 0.15rem 0.55rem;
    font-size: 0.72rem; font-weight: 600; color: var(--success);
    background: #EAF2E6; border-radius: var(--radius-sm);
    border: 1px solid #C4DCC4;
    font-family: var(--font-mono);
}
.table-link {
    font-size: 0.72rem; font-weight: 700; color: var(--gold-dark);
    text-decoration: none; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 0.3rem;
    letter-spacing: 0.08em; text-transform: uppercase;
}
.table-link i { font-size: 0.6rem; transition: transform var(--transition-fast); }
.table-link:hover { color: var(--primary); }
.table-link:hover i { transform: translateX(3px); }

.products-table.compact th { padding: 0.625rem 0.75rem; }
.products-table.compact td { padding: 0.625rem 0.75rem; }

/* === NO RESULTS === */
.no-results {
    text-align: center; padding: 4rem 1.5rem;
    background: var(--white); border-radius: var(--radius-sm);
    border: 1px dashed var(--gray-300);
}
.no-results p { color: var(--gray-500); font-size: 16px; font-family: var(--font-display); font-style: italic; }

/* === PAGINATION === */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 0.375rem;
    margin-top: 2rem; padding: 1rem 0; flex-wrap: wrap;
}
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 0.75rem;
    font-size: 0.875rem; font-weight: 600; color: var(--gray-600);
    background: var(--white); border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm); text-decoration: none;
    transition: all var(--transition-fast); gap: 0.25rem;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-mono);
}
.page-btn:hover { border-color: var(--gold); color: var(--primary); text-decoration: none; }
.page-btn.active {
    background: var(--primary); color: var(--gold-light); border-color: var(--primary-dark);
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(203,173,106,0.35);
}
.page-btn i { font-size: 0.625rem; }
.page-info { font-size: 0.78rem; color: var(--gray-400); margin-left: 0.75rem; font-style: italic; font-family: var(--font-display); }
@media (max-width: 640px) { .page-info { display: none; } }

/* === PRICE LIST CATEGORY === */
.pricelist-category { margin-bottom: 3.25rem; }
.pricelist-category-title {
    font-size: 1.35rem; font-weight: 600; color: var(--primary-dark);
    margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.625rem;
    padding-bottom: 0.7rem;
    font-family: var(--font-display);
    background:
        linear-gradient(var(--gold), var(--gold)) bottom left / 100% 1px no-repeat,
        linear-gradient(var(--gold-hairline), var(--gold-hairline)) bottom 3px left 0 / 40% 1px no-repeat;
}
.pricelist-category-title i { color: var(--gold); font-size: 0.95rem; }

/* === CRYPTO REMINDER === */
.crypto-reminder {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 1.5rem 2rem; border-radius: var(--radius-md);
    margin-bottom: 2rem; color: rgba(245,238,220,0.75);
    border: 1px solid var(--gold-hairline);
    box-shadow: inset 0 0 0 4px rgba(14,23,44,0.45), inset 0 0 0 5px rgba(203,173,106,0.3);
}
.crypto-reminder strong { color: var(--gold-light); display: block; margin-bottom: 0.25rem; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.02em; }
.crypto-reminder p { font-size: 13px; margin: 0; color: rgba(245,238,220,0.6); }
.crypto-reminder .btn { margin-left: auto; flex-shrink: 0; background: var(--gold); color: var(--primary-darker); border-color: var(--gold-dark); box-shadow: none; }
.crypto-reminder .btn:hover { background: var(--gold-light); color: var(--primary-darker); }

/* === PRODUCT DETAIL === */
.product-detail-section { padding: 2.5rem 0 4rem; background: transparent; }
.product-detail-grid {
    display: grid; grid-template-columns: 1fr; gap: 2.5rem;
}
@media (min-width: 768px) { .product-detail-grid { grid-template-columns: 1.5fr 1fr; } }
.product-detail-header {
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.product-detail-name {
    font-size: 2.1rem; font-weight: 500; color: var(--primary-dark); margin-bottom: 1.5rem;
    letter-spacing: 0.005em; font-family: var(--font-display); line-height: 1.2;
}
.product-detail-meta-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
@media (min-width: 640px) { .product-detail-meta-grid { grid-template-columns: repeat(3, 1fr); } }
.meta-item {
    padding: 1.125rem; background: var(--white); border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200); transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    border-top: 2px solid var(--gold-hairline);
}
.meta-item:hover { border-color: var(--gold); box-shadow: var(--shadow-md); }
.meta-label { display: block; font-size: 0.68rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.4rem; }
.meta-value { display: block; font-size: 1rem; font-weight: 600; color: var(--gray-800); font-family: var(--font-mono); }
.meta-value.formula { font-family: var(--font-mono); font-size: 0.875rem; }
.meta-value.price { color: var(--primary); font-size: 1.25rem; }

/* === ORDER SIDEBAR (certificate card) === */
.order-card {
    background: var(--white); border: 1px solid var(--gray-300);
    outline: 1px solid var(--gold-hairline); outline-offset: 4px;
    border-radius: var(--radius-sm); padding: 2rem;
    position: sticky; top: 130px;
    box-shadow: var(--shadow-lg);
}
.order-card h3 {
    font-size: 1.2rem; font-weight: 600; color: var(--primary-dark);
    margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-display);
    padding-bottom: 0.75rem; border-bottom: 1px solid var(--gold-hairline);
}
.order-card h3 i { color: var(--gold); font-size: 0.95rem; }
.order-card-price {
    text-align: center; padding: 1.5rem; background: var(--gray-50);
    border-radius: var(--radius-sm); margin-bottom: 1.25rem;
    border: 1px solid var(--gray-200);
    border-top: 2px solid var(--gold);
}
.order-price-label { display: block; font-size: 0.72rem; color: var(--gray-500); font-weight: 700; margin-bottom: 0.375rem; text-transform: uppercase; letter-spacing: 0.12em; }
.order-price-value { display: block; font-size: 2.6rem; font-weight: 500; color: var(--primary); letter-spacing: 0; font-family: var(--font-display); }
.order-card-crypto {
    padding: 1.25rem; background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm); margin-bottom: 1.5rem; text-align: center;
    box-shadow: inset 0 0 0 3px rgba(14,23,44,0.45), inset 0 0 0 4px rgba(203,173,106,0.3);
}
.crypto-label { font-size: 0.72rem; font-weight: 700; color: var(--gold-light); display: block; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.14em; }
.crypto-coins-row {
    display: flex; gap: 0.375rem; justify-content: center; flex-wrap: wrap;
}
.crypto-coins-row span {
    font-size: 0.72rem; font-weight: 600; color: rgba(245,238,220,0.78);
    background: rgba(203,173,106,0.08); padding: 0.25rem 0.625rem;
    border: 1px solid rgba(203,173,106,0.22);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}
.order-card-actions { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 1rem; }
.order-action-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.875rem 1rem; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 13.5px;
    text-decoration: none; transition: all var(--transition-fast);
    text-align: center; letter-spacing: 0.04em;
}
.order-action-btn:hover { text-decoration: none; transform: translateY(-1px); }
.order-action-btn.tg { background: #E3E8F0; color: #27416F; }
.order-action-btn.tg:hover { background: #D5DCE8; }
.order-action-btn.wa { background: #DFEBDD; color: #2A5F46; }
.order-action-btn.wa:hover { background: #D2E2CF; }
.order-action-btn.email { background: var(--primary); color: var(--gold-light); box-shadow: inset 0 0 0 1px rgba(203,173,106,0.35); }
.order-action-btn.email:hover { background: var(--primary-light); color: #F5EEDC; }
.order-card-note { font-size: 0.78rem; color: var(--gray-500); line-height: 1.65; }

/* === RELATED === */
.related-section { margin-top: 3rem; padding-top: 2.5rem; border-top: 3px double var(--gold-hairline); }
.related-section .section-heading { font-size: 1.4rem; margin-bottom: 1.5rem; }
.related-section .section-heading::after { display: none; }

/* === PRICELIST SEARCH === */
.pricelist-search-wrap {
    position: relative; margin-bottom: 2rem;
}
.pricelist-search-box {
    display: flex; align-items: center; position: relative;
    background: var(--white); border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm); overflow: hidden;
    transition: border-color var(--transition-fast);
    box-shadow: var(--shadow-sm), inset 0 1px 2px rgba(40,32,12,0.04);
}
.pricelist-search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169,132,46,0.13); }
.pricelist-search-icon { position: absolute; left: 18px; color: var(--gold-dark); font-size: 15px; pointer-events: none; }
.pricelist-search-input {
    flex: 1; padding: 16px 16px 16px 48px; font-size: 15px;
    border: none; outline: none; background: transparent;
    font-family: var(--font-family); color: var(--gray-800);
}
.pricelist-search-input::placeholder { color: var(--gray-400); }
.pricelist-search-count {
    font-size: 12px; font-weight: 700; color: var(--primary);
    padding-right: 12px; white-space: nowrap; font-family: var(--font-mono);
}
.pricelist-search-clear {
    background: none; border: none; cursor: pointer;
    padding: 0 16px; color: var(--gray-400); font-size: 16px;
    transition: color var(--transition-fast);
}
.pricelist-search-clear:hover { color: var(--gray-700); }

/* Dropdown */
.pricelist-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--white); border: 1px solid var(--gray-300);
    border-top: 2px solid var(--gold);
    border-radius: 0 0 var(--radius-md) var(--radius-md); box-shadow: var(--shadow-xl);
    max-height: 420px; overflow-y: auto; z-index: 100;
    display: none;
}
.pricelist-dropdown.active { display: block; }
.pricelist-dd-item {
    display: block; padding: 14px 18px; text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition-fast);
}
.pricelist-dd-item:last-child { border-bottom: none; }
.pricelist-dd-item:hover { background: var(--gold-pale); text-decoration: none; }
.pricelist-dd-item.fuzzy { border-left: 2px solid var(--gold); }
.pricelist-dd-name {
    font-size: 14px; font-weight: 600; color: var(--primary-dark);
    margin-bottom: 4px; line-height: 1.3;
}
.pricelist-dd-name mark { background: var(--gold-pale); color: var(--gray-900); padding: 0 2px; border-radius: 2px; }
.pricelist-dd-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 11.5px; color: var(--gray-500); font-family: var(--font-mono);
}
.pricelist-dd-meta mark { background: var(--gold-pale); color: var(--gray-700); padding: 0 2px; border-radius: 2px; }
.pricelist-dd-price { font-weight: 600; color: var(--primary); font-family: var(--font-mono); }
.pricelist-dd-fuzzy {
    font-size: 10px; font-weight: 700; color: var(--gold-dark);
    background: var(--gold-pale); padding: 2px 8px; border-radius: var(--radius-sm);
    font-family: var(--font-family); letter-spacing: 0.04em;
}
.pricelist-dd-empty {
    padding: 32px 18px; text-align: center;
    font-size: 14px; color: var(--gray-500);
    font-style: italic; font-family: var(--font-display);
}
.pricelist-dd-empty i { margin-right: 6px; color: var(--gold); }

/* === RESPONSIVE — MOBILE === */
@media (max-width: 767px) {
    .products-section { padding: 1.25rem 0 2.5rem; }
    .products-toolbar { gap: 0.75rem; margin-bottom: 1.25rem; }
    .search-bar { max-width: 100%; }
    .search-input { padding: 0.625rem 0.875rem; font-size: 14px; }

    /* Category filters horizontal scroll */
    .category-filters { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; gap: 6px; }
    .category-filters::-webkit-scrollbar { display: none; }
    .cat-filter-btn { padding: 0.4rem 0.875rem; font-size: 0.68rem; flex-shrink: 0; }

    /* Table compact */
    .products-table-wrap { box-shadow: var(--shadow-md), 0 0 0 3px var(--paper), 0 0 0 4px var(--gold-hairline); }
    .products-table { font-size: 0.8125rem; }
    .products-table th { padding: 0.625rem 0.5rem; font-size: 9.5px; }
    .products-table td { padding: 0.5rem; }
    .products-table .cat-no { font-size: 0.65rem; }
    .table-link { font-size: 0.62rem; }
    .purity-badge { font-size: 0.6rem; padding: 0.1rem 0.45rem; }

    /* Pagination */
    .pagination { gap: 4px; margin-top: 1.25rem; }
    .page-btn { min-width: 34px; height: 34px; font-size: 0.8125rem; }

    /* Detail page */
    .product-detail-section { padding: 1.5rem 0 2.5rem; }
    .product-detail-name { font-size: 1.5rem; margin-bottom: 1rem; }
    .product-detail-meta-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .meta-item { padding: 0.875rem; }
    .meta-label { font-size: 0.62rem; margin-bottom: 0.25rem; }
    .meta-value { font-size: 0.85rem; }
    .meta-value.price { font-size: 1.125rem; }

    /* Order card — show at top on mobile */
    .product-detail-sidebar { order: -1; }
    .order-card { padding: 1.25rem; position: static; outline-offset: 3px; }
    .order-card h3 { font-size: 1.05rem; }
    .order-card-price { padding: 1rem; }
    .order-price-value { font-size: 2rem; }
    .order-card-crypto { padding: 1rem; }
    .order-action-btn { padding: 0.75rem; font-size: 13px; }

    /* Crypto reminder */
    .crypto-reminder { flex-direction: column; align-items: flex-start; padding: 1.1rem 1rem; gap: 0.75rem; }
    .crypto-reminder .btn { margin-left: 0; width: 100%; }

    /* Price list */
    .pricelist-category { margin-bottom: 2rem; }
    .pricelist-category-title { font-size: 1.1rem; }

    /* Search */
    .pricelist-search-input { padding: 12px 12px 12px 42px; font-size: 14px; }
    .pricelist-search-icon { left: 14px; font-size: 14px; }
    .pricelist-dropdown { max-height: 340px; }
    .pricelist-dd-item { padding: 10px 14px; }
    .pricelist-dd-name { font-size: 13px; }
    .pricelist-dd-meta { font-size: 10.5px; gap: 8px; }
}

/* ===== Mobile Optimisation (Jul 2026) ===== */
@media (max-width: 767px) {
    /* Product-detail chemistry tables: long SMILES/InChI values must wrap
       inside the card instead of overflowing horizontally */
    .adv-chem-table td:last-child { word-break: break-all; }
    /* Extra specificity: product.ejs's inline <style> declares the same
       selector with white-space:nowrap and comes later in the document */
    .compliance-table tr td:first-child { white-space: normal; width: 42%; }

    /* Catalog table: keep the product name readable inside the scroll wrapper */
    .products-table .product-name { min-width: 150px; }
    .products-table td { vertical-align: top; }

    /* Bigger tap area on tiny "View" links without shifting layout */
    .table-link { padding: 0.45rem 0.25rem; margin: -0.45rem -0.25rem; }

    /* Pagination + filters: comfortable touch targets */
    .page-btn { min-width: 40px; height: 40px; }
    .cat-filter-btn { min-height: 40px; align-items: center; }
    .search-btn { min-width: 48px; }

    /* Order sidebar buttons: 48px touch height */
    .order-action-btn { min-height: 48px; }
}
