/* ─────────────────────────────────────────────────────────────────────────────
   AmGoodEquip — Catalog Styles
   Tailwind handles most layout; this file covers:
   - Custom scrollbar suppression
   - Grid view card layout
   - Price slider customization
   - Shipping calc animations
   - Spec modal transitions
   - Misc overrides
───────────────────────────────────────────────────────────────────────────── */

/* ─── Navigation Bar Links ───────────────────────────────────────────────── */
.amge-nav-link {
    color: #1f2937;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.amge-nav-link:hover {
    color: #111827;
    border-bottom-color: #4ade80;
}
.amge-nav-link.active {
    color: #111827;
    font-weight: 600;
    border-bottom-color: #4ade80;
}

/* ── Reset / Base ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0B1E36;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F8FAFC;
    color: #333333;
}

/* ── Container ─────────────────────────────────────────────────────────────── */
.container {
    max-width: 1400px;
}

/* ── Sidebar scrollbar hide ────────────────────────────────────────────────── */
#site-header nav,
#amge-sidebar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ── Category active state ─────────────────────────────────────────────────── */
.amge-cat-item[aria-current="true"] {
    background-color: #EFF6FF;
    color: #0B1E36;
    font-weight: 600;
}

/* ── Chevron rotation ──────────────────────────────────────────────────────── */
.rotate-90  { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }

/* ── Product list: list view ────────────────────────────────────────────────── */
#amge-product-list.amge-list-view .amge-product-card {
    flex-direction: row;
}
#amge-product-list.amge-list-view .amge-product-card > div:first-child {
    width: 100%;
    min-width: 256px;
}

/* ── Product list: grid view ────────────────────────────────────────────────── */
#amge-product-list.amge-grid-view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
#amge-product-list.amge-grid-view .amge-product-card {
    flex-direction: column;
}
#amge-product-list.amge-grid-view .amge-product-card > div:first-child {
    width: 100%;
    min-width: unset;
}

/* ── Product card hover ────────────────────────────────────────────────────── */
.amge-product-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.amge-product-card:hover {
    box-shadow: 0 4px 20px rgba(11, 30, 54, 0.08);
    transform: translateY(-1px);
}

/* ── Shipping calc chevron ─────────────────────────────────────────────────── */
.amge-ship-chevron {
    transition: transform 0.25s ease;
}
.amge-ship-body {
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Certification buttons active ──────────────────────────────────────────── */
.amge-cert-btn[aria-pressed="true"] {
    background-color: #0B1E36;
    color: #ffffff;
    border-color: #0B1E36;
}

/* ── noUiSlider customization ──────────────────────────────────────────────── */
.noUi-connect {
    background: #0B1E36;
}
.noUi-handle {
    border-radius: 50%;
    background: #0B1E36;
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.25);
    cursor: pointer;
    width: 18px  !important;
    height: 18px !important;
    top: -7px    !important;
    right: -9px  !important;
}
.noUi-handle::before,
.noUi-handle::after {
    display: none;
}
.noUi-target {
    background: #e5e7eb;
    border: none;
    box-shadow: none;
    border-radius: 4px;
    height: 4px;
}
.noUi-horizontal .noUi-handle {
    width: 18px !important;
    height: 18px !important;
    right: -9px !important;
    top: -7px !important;
}

/* ── Spec Modal ────────────────────────────────────────────────────────────── */
#amge-spec-modal {
    animation: fadeIn 0.2s ease;
}
#amge-spec-modal > div:last-child {
    animation: slideUp 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Spec table alternating rows */
#amge-spec-table tr:nth-child(even) td {
    background-color: #F9FAFB;
}
#amge-spec-table td {
    border-bottom: 1px solid #F3F4F6;
}
#amge-spec-table td:first-child {
    font-weight: 500;
    color: #374151;
    width: 180px;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
#amge-pagination {
    gap: 4px;
}
.amge-page-btn {
    transition: all 0.15s ease;
}

/* ── Loading skeleton animation ────────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
.animate-pulse > * {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Breadcrumb ────────────────────────────────────────────────────────────── */
nav[aria-label="Breadcrumb"] a:hover {
    color: #0B1E36;
}

/* ── Text line clamp (3 lines) ─────────────────────────────────────────────── */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Custom checkbox for filters ────────────────────────────────────────────── */
.amge-filter-brand:checked {
    accent-color: #0B1E36;
}

/* ── Responsive: hide sidebar on mobile, toggle needed ─────────────────────── */
@media (max-width: 1023px) {
    #amge-sidebar {
        width: 100%;
    }
    #amge-product-list.amge-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 767px) {
    .amge-product-card {
        flex-direction: column !important;
    }
    .amge-product-card > div:first-child {
        width: 100% !important;
        min-width: unset !important;
    }
    .amge-price-col {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid #DBEAFE;
    }
    #amge-spec-modal > div:last-child {
        max-height: 95vh;
    }
}

/* ── WooCommerce notice reset ───────────────────────────────────────────────── */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.woocommerce-message { background: #ecfdf5; color: #065f46; border-left: 4px solid #10b981; }
.woocommerce-error   { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
.woocommerce-info    { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ── SKU Badge (Pantone 7694 C inspired — muted blue) ───────────────────────── */
.amge-sku-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #2E5FA3;
    background: #EEF4FF;
    border: 1px solid #C2D5F5;
    border-radius: 4px;
    padding: 1px 7px;
    letter-spacing: 0.02em;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
}

/* ── UPC Badge ──────────────────────────────────────────────────────────────── */
.amge-upc-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #4B5563;
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    padding: 1px 7px;
    letter-spacing: 0.02em;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
}
.amge-upc-badge::before {
    content: 'UPC: ';
    font-weight: 400;
    color: #9CA3AF;
}

/* ── Discount badge ─────────────────────────────────────────────────────────── */
.amge-discount-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #B45309;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 4px;
    padding: 1px 6px;
}

/* ── Specification button on card (legacy square) ───────────────────────────── */
.amge-spec-card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    background: #F9FAFB;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 90px;
    text-align: center;
}
.amge-spec-card-btn:hover {
    border-color: #0B1E36;
    background: #EFF6FF;
}

/* ── Specification button flat (horizontal rectangle) ───────────────────────── */
.amge-spec-card-btn-flat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid #E5E7EB;
    border-radius: 6px;
    background: #F9FAFB;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.amge-spec-card-btn-flat:hover {
    border-color: #0B1E36;
    background: #EFF6FF;
}

/* ── Price panel (legacy, kept for compat) ──────────────────────────────────── */
.amge-price-panel {
    background: linear-gradient(135deg, #F0F7FF 0%, #EBF4FF 100%);
    border: 1px solid #DBEAFE;
    border-radius: 8px;
    padding: 12px;
}

/* ── Price column (right column of list-view card) ──────────────────────────── */
.amge-price-col {
    background: linear-gradient(160deg, #F0F7FF 0%, #EBF4FF 100%);
    border-left: 1px solid #DBEAFE;
}

/* ── Spec table — alternating rows with clear contrast ─────────────────────── */
.amge-spec-row-even {
    background: #FFFFFF;
}
.amge-spec-row-odd {
    background: #DBEAFE;
}
.amge-spec-cell-label {
    padding: 9px 16px;
    font-weight: 600;
    color: #1E3A5F;
    width: 200px;
    border-bottom: 1px solid #DBEAFE;
    font-size: 13px;
}
.amge-spec-cell-value {
    padding: 9px 16px;
    color: #374151;
    border-bottom: 1px solid #DBEAFE;
    font-size: 13px;
}
#amge-spec-table {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #DBEAFE;
}

/* ── Modal gallery ──────────────────────────────────────────────────────────── */
.amge-gallery-wrap {
    position: relative;
}
.amge-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0B1E36;
    font-size: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    transition: all 0.15s ease;
}
.amge-gallery-arrow:hover {
    background: #0B1E36;
    color: #fff;
    border-color: #0B1E36;
}
.amge-gallery-arrow-left  { left:  -14px; }
.amge-gallery-arrow-right { right: -14px; }
.amge-gallery-arrow.invisible { visibility: hidden; pointer-events: none; }

.amge-gallery-thumb {
    border-radius: 6px;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.65;
    transition: all 0.15s ease;
}
.amge-gallery-thumb:hover { opacity: 1; border-color: #9CA3AF; }
.amge-gallery-thumb.active,
.amge-gallery-thumb[style*="border-primary"] { opacity: 1; border-color: #0B1E36; box-shadow: 0 0 0 1px #0B1E36; }

/* ── Zoom lightbox ──────────────────────────────────────────────────────────── */
#amge-zoom-lightbox {
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.amge-zoom-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.amge-zoom-nav:hover { background: rgba(255,255,255,0.3); }
.amge-zoom-nav.invisible { visibility: hidden; pointer-events: none; }
.amge-zoom-nav-left  { left:  16px; }
.amge-zoom-nav-right { right: 16px; }

/* ── cursor-zoom-in helper ──────────────────────────────────────────────────── */
.cursor-zoom-in  { cursor: zoom-in; }
.cursor-zoom-out { cursor: zoom-out; }

/* ── Gallery thumbnails: hide webkit scrollbar ──────────────────────────────── */
#amge-spec-thumbnails::-webkit-scrollbar {
    display: none;
}
