/**
 * Product Listing Page Styles
 * Matches the IMS Company design specifications
 * 
 * @package IMS_by_Soul_Country
 */

/* ==========================================================================
   CSS Variables for Product Listing
   ========================================================================== */

:root {
    --ims-text-primary: var(--color-dark, #111827);
    --ims-text-secondary: #6b7280;
    --ims-text-muted: #9ca3af;
    --ims-border-color: var(--color-border, #e5e7eb);
    --ims-border-light: #f3f4f6;
    --ims-bg-white: #ffffff;
    --ims-bg-light: var(--color-bg-light, #f9fafb);
    --ims-accent-blue: var(--color-cta, #2563eb);
    --ims-accent-green: #34d399;
    --ims-button-dark: var(--color-dark, #1f2937);
    --ims-button-hover: var(--color-dark-charcoal, #111827);
    --ims-location-badge-bg: var(--color-border, #e5e7eb);
    --ims-location-badge-text: #374151;
    --ims-filter-sidebar-width: 340px;
}

/* ==========================================================================
   Page Header & Breadcrumbs
   ========================================================================== */

.ims-product-listing-header {
    margin-bottom: 1.5rem;
}

.ims-breadcrumbs {
    font-size: 0.875rem;
    color: var(--ims-text-secondary);
    margin-bottom: 0.75rem;
}

.ims-breadcrumbs a {
    color: var(--ims-text-secondary);
    text-decoration: underline;
}

.ims-breadcrumbs a:hover {
    color: var(--ims-text-primary);
}

.ims-breadcrumbs span {
    color: var(--ims-text-muted);
}

.ims-page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.ims-page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ims-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ims-page-title .info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--ims-text-secondary);
    border-radius: 50%;
    font-size: 0.75rem;
    color: var(--ims-text-secondary);
    cursor: help;
}

.ims-product-count {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--ims-text-secondary);
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    transition: background-color 1.5s ease, color 1.5s ease;
}

.ims-product-count.ims-highlight {
    background-color: var(--color-gold-pale);
    color: #92400e;
    font-weight: 600;
    transition: none;
}

.ims-product-count.ims-highlight-fade {
    background-color: transparent;
    color: var(--ims-text-secondary);
    font-weight: 400;
}

/* Controls Row (Sort & Show) */
.ims-controls-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ims-control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ims-control-label {
    font-size: 0.875rem;
    color: var(--ims-text-secondary);
}

.ims-control-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--ims-border-color);
    border-radius: 4px;
    background: var(--ims-bg-white);
    font-size: 0.875rem;
    color: var(--ims-text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.ims-control-select:focus {
    outline: none;
    border-color: var(--ims-accent-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   Filter Sidebar - Enhanced Accordion Style
   ========================================================================== */

.ims-filter-sidebar {
    background: var(--ims-bg-white);
    border: 1px solid var(--ims-border-color);
    border-radius: 6px;
    overflow: hidden;
    position: sticky;
    top: 2rem;
}

/* Filters Header */
.ims-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: var(--ims-bg-white);
    border-bottom: 1px solid var(--ims-border-color);
}

.ims-filters-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ims-text-primary);
    margin: 0;
}

.ims-filters-reset {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ims-text-secondary);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.ims-filters-reset:hover {
    color: var(--ims-text-primary);
}

/* Filter Section (Accordion Item) */
.ims-filter-section {
    border-bottom: 1px solid var(--ims-border-color);
}

.ims-filter-section:last-child {
    border-bottom: none;
}

/* Filter Header (Accordion Toggle) */
.ims-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--ims-bg-white);
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.ims-filter-header:hover {
    background: var(--ims-bg-light);
}

.ims-filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ims-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}

.ims-filter-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.ims-filter-toggle svg {
    width: 12px;
    height: 12px;
    stroke: var(--ims-text-secondary);
}

.ims-filter-section.expanded .ims-filter-toggle {
    transform: rotate(180deg);
}

/* Filter Content */
.ims-filter-content {
    display: none;
}

.ims-filter-section.expanded .ims-filter-content {
    display: block;
}

.ims-filter-content-inner {
    padding: 0.25rem 1.25rem 0.875rem 1.25rem;
}

/* Checkbox Filters (Availability, Brands) */
.ims-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for filter lists */
.ims-filter-list::-webkit-scrollbar {
    width: 6px;
}

.ims-filter-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.ims-filter-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.ims-filter-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.ims-filter-item {
    margin-bottom: 0.375rem;
}

.ims-filter-item:last-child {
    margin-bottom: 0;
}

.ims-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--ims-text-primary);
    line-height: 1.3;
}

.ims-filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--color-cta);
    cursor: pointer;
}

.ims-filter-checkbox .filter-count {
    color: var(--ims-text-muted);
    margin-left: 0.25rem;
}

/* Disabled filter options (zero count - not applicable with current filters) */
.ims-filter-item--disabled .ims-filter-checkbox,
.ims-filter-checkbox--disabled {
    color: var(--ims-text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.ims-filter-item--disabled .ims-filter-checkbox input[type="checkbox"],
.ims-filter-checkbox--disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.ims-filter-item--disabled .filter-count,
.ims-filter-checkbox--disabled .filter-count {
    color: var(--ims-text-muted);
}

/* Price Filter */
.ims-price-filter {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

.ims-price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ims-price-input-group {
    display: flex;
    align-items: center;
    flex: 1;
}

.ims-price-input-group label {
    font-size: 0.8125rem;
    color: var(--ims-text-secondary);
    margin-right: 0.375rem;
    min-width: 35px;
}

.ims-price-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--ims-border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 0;
}

.ims-price-input:focus {
    outline: none;
    border-color: var(--ims-accent-blue);
}

.ims-price-currency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.625rem;
    background: var(--ims-bg-light);
    border: 1px solid var(--ims-border-color);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.875rem;
    color: var(--ims-text-secondary);
}

.ims-price-input-group .ims-price-input {
    border-radius: 0 4px 4px 0;
}

.ims-price-separator {
    color: var(--ims-text-muted);
    font-size: 0.875rem;
}

.ims-price-apply {
    padding: 0.5rem 0.875rem;
    background: var(--ims-accent-blue);
    color: var(--ims-bg-white);
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    align-self: end;
}

.ims-price-apply:hover {
    background: var(--color-cta-hover);
}

/* ==========================================================================
   Product Cards - Horizontal Layout
   ========================================================================== */

.ims-products-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ims-product-card {
    display: flex;
    align-items: flex-start;
    background: var(--ims-bg-white);
    border: 1px solid var(--ims-border-color);
    border-radius: 8px;
    padding: 1.5rem;
    gap: 1.5rem;
    transition: background-color 0.2s ease;
}

.ims-product-card:first-child {
    border-radius: 8px;
}

.ims-product-card:last-child {
    border-radius: 8px;
}

.ims-product-card:only-child {
    border-radius: 8px;
}

.ims-product-card:hover {
    background: var(--ims-bg-light);
}

/* Product Image */
.ims-product-image {
    flex-shrink: 0;
    width: 180px;
    height: 140px;
}

.ims-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.ims-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.ims-product-image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--ims-bg-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ims-text-muted);
    font-size: 0.75rem;
}

/* Product Info Section */
.ims-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ims-product-title {
    font-size: 1.075rem;
    font-weight: 600;
    color: var(--ims-text-primary);
    margin: 0 0 0.125rem 0;
    line-height: 1.4;
    text-transform: uppercase;
}

.ims-product-title a {
    color: inherit;
    text-decoration: none;
}

.ims-product-title a:hover {
    color: inherit;
}

.ims-product-sku {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--ims-text-primary);
    background: var(--color-gold-light);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
    line-height: 1;
}

.ims-product-sku svg {
    flex-shrink: 0;
    color: var(--ims-text-primary);
}

.ims-product-sku__label {
    font-weight: 400;
    letter-spacing: 0.02em;
}

.ims-product-sku__value {
    font-weight: 400;
    letter-spacing: 0.04em;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

.ims-product-brand {
    font-size: 0.875rem;
    color: var(--ims-accent-blue);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.ims-product-brand a {
    color: inherit;
    text-decoration: none;
}

.ims-product-brand a:hover {
    text-decoration: underline;
}

/* Stock Status & Location */
.ims-product-stock-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.ims-stock-status {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #000;
    text-transform: uppercase;
}

.ims-stock-status.out-of-stock {
    color: #dc2626;
}

.ims-stock-quantity {
    margin-left: 0.25rem;
    font-weight: 500;
    color: var(--ims-text-muted);
}

.ims-returnable-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    color: var(--ims-text-primary);
}

.ims-returnable-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.ims-location-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: var(--ims-location-badge-bg);
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ims-location-badge-text);
    text-transform: uppercase;
}

/* Prop 65 Warning */
.ims-prop65-warning {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.375rem;
    width: fit-content;
    max-width: 100%;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-top: 0.75rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ims-prop65-warning:hover {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
    text-decoration: none;
}

.ims-prop65-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #d97706;
    margin-top: 1px;
}

.ims-prop65-text {
    flex: 1;
    min-width: 0;
}

/* Product Breadcrumb */
.ims-product-breadcrumb {
    font-size: 0.75rem;
    color: var(--ims-text-muted);
    margin-top: 0.625rem;
}

.ims-product-breadcrumb a {
    color: var(--ims-text-primary);
    text-decoration: none;
}

.ims-product-breadcrumb a:hover {
    text-decoration: underline;
}

.ims-product-breadcrumb .separator {
    margin: 0 0.25rem;
    color: var(--ims-text-muted);
}

/* Product Actions (Price & Cart) */
.ims-product-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    min-width: 160px;
}

/* Price Display */
.ims-price-section {
    text-align: right;
}

.ims-price-label {
    font-size: 0.75rem;
    color: var(--ims-text-muted);
    margin-bottom: 0.125rem;
}

.ims-price-main {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    margin-bottom: 0.125rem;
}

.ims-price-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ims-text-primary);
}

.ims-price-unit {
    font-size: 0.8125rem;
    color: var(--ims-text-muted);
}

.ims-price-ex-vat {
    font-size: 0.75rem;
    color: var(--ims-text-muted);
}

/* Quantity & Add to Cart */
.ims-cart-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.ims-quantity-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ims-quantity-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ims-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ims-quantity-wrapper {
    display: flex !important;
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid var(--ims-border-color) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.ims-product-card .ims-quantity-wrapper button.ims-quantity-btn,
button.ims-quantity-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border: none !important;
    background: transparent !important;
    background-image: none !important;
    color: var(--ims-text-primary) !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.ims-product-card .ims-quantity-wrapper button.ims-quantity-btn svg,
button.ims-quantity-btn svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    pointer-events: none;
}

.ims-product-card .ims-quantity-wrapper button.ims-quantity-btn:hover,
button.ims-quantity-btn:hover {
    background: var(--color-cta) !important;
    color: var(--color-dark-charcoal) !important;
}

.ims-product-card .ims-quantity-wrapper button.ims-quantity-btn:active,
button.ims-quantity-btn:active {
    transform: scale(0.95);
}

.ims-product-card .ims-quantity-wrapper button.ims-quantity-btn:disabled,
button.ims-quantity-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.ims-product-card .ims-quantity-wrapper button.ims-quantity-btn:disabled:hover,
button.ims-quantity-btn:disabled:hover {
    background: transparent !important;
    color: var(--ims-text-primary) !important;
}

.ims-quantity-wrapper .ims-quantity-input {
    width: 40px !important;
    padding: 0.25rem !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: var(--ims-text-primary) !important;
    -moz-appearance: textfield !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    min-width: 0 !important;
}

.ims-quantity-wrapper .ims-quantity-input::-webkit-outer-spin-button,
.ims-quantity-wrapper .ims-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.ims-quantity-wrapper .ims-quantity-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.ims-add-to-cart {
    padding: 0.625rem 1.5rem;
    background: var(--ims-button-dark);
    color: #ffffff;
    border: 1px solid var(--ims-button-dark);
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    width: 180px;
}

.ims-add-to-cart:hover {
    background: transparent;
    color: var(--ims-button-dark);
    border-color: var(--ims-button-dark);
}

.ims-add-to-cart:disabled {
    background: var(--ims-text-muted);
    cursor: not-allowed;
}

.ims-add-to-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ims-add-to-cart.success {
    background: var(--ims-accent-green);
    border-color: var(--ims-text-primary);
    color: var(--ims-text-primary);
}

/* Add to Quote Button */
.ims-add-to-quote {
    padding: 0.625rem 1.5rem;
    background: transparent;
    color: var(--ims-button-dark);
    border: 1px solid var(--ims-button-dark);
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    width: 180px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.ims-add-to-quote:hover {
    background: var(--color-bg-light);
    color: var(--ims-button-dark);
    border-color: var(--ims-button-dark);
}

.ims-add-to-quote:disabled {
    border-color: var(--ims-text-muted);
    color: var(--ims-text-muted);
    cursor: not-allowed;
}

.ims-add-to-quote.adding {
    opacity: 0.7;
    pointer-events: none;
}

.ims-add-to-quote.success {
    background: var(--ims-accent-green, #34d399);
    border-color: var(--ims-text-primary);
    color: var(--ims-text-primary);
}

.ims-add-to-quote.error {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

/* ==========================================================================
   More Info Button & Expandable Panel
   ========================================================================== */

/* Enable flex-wrap on product cards so the panel flows to a new row */
.ims-product-card,
.ims-unified-product-card {
    flex-wrap: wrap;
}

/* More Info Toggle */
.ims-more-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0;
    background: none;
    color: var(--color-dark-charcoal);
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: opacity 0.2s ease;
    width: 180px;
    margin-top: 0.375rem;
}

.ims-more-info-btn:hover {
    opacity: 0.7;
}

.ims-more-info-btn[aria-expanded="true"] {
    color: var(--color-dark-charcoal);
}

.ims-more-info-btn[aria-expanded="true"]:hover {
    opacity: 0.7;
}

.ims-more-info-arrow {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.ims-more-info-btn[aria-expanded="true"] .ims-more-info-arrow {
    transform: rotate(180deg);
}

/* Expandable Panel */
.ims-more-info-panel {
    flex: 0 0 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.ims-more-info-panel.is-open {
    opacity: 1;
    /* max-height is set via JS for smooth animation */
}

.ims-more-info-inner {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 0 0.5rem;
    border-top: 1px solid var(--ims-border-color, #e5e7eb);
    margin-top: 1rem;
}

/* Loading state for the button */
.ims-more-info-btn.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

/* Larger product image */
.ims-more-info-image-wrap {
    flex-shrink: 0;
    width: 360px;
}

.ims-more-info-image-wrap a {
    display: block;
}

.ims-more-info-image-wrap img.ims-more-info-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    object-fit: contain;
    background: var(--ims-bg-light);
    border: 1px solid var(--ims-border-color, #e5e7eb);
}

/* Gallery Thumbnails */
.ims-more-info-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.625rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.ims-more-info-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid var(--ims-border-color, #e5e7eb);
    border-radius: 4px;
    background: var(--ims-bg-light);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.ims-more-info-thumb:hover {
    border-color: var(--color-dark-charcoal);
}

.ims-more-info-thumb.is-active {
    border-color: var(--color-dark-charcoal);
}

.ims-more-info-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Bullet points / details */
.ims-more-info-details {
    flex: 1;
    min-width: 0;
}

.ims-more-info-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ims-text-primary, #111827);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ims-more-info-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ims-more-info-bullets li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ims-text-primary, #111827);
}

.ims-more-info-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-gold-light);
}

/* Volume Discounts inside More Info panel */
.ims-volume-discounts.ims-volume-discounts--inline {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 2.25rem 0 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ims-volume-discounts--inline .ims-volume-discounts__table {
    border: none !important;
}

/* Bottom "Less Info" collapse link */
.ims-more-info-collapse-wrap {
    text-align: right;
    padding-top: 1rem;
    padding-right: 1.5rem;
}

.ims-more-info-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-dark-charcoal);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.ims-more-info-collapse-btn:hover {
    opacity: 0.7;
}

/* Empty state */
.ims-more-info-empty {
    flex: 1;
    text-align: center;
    padding: 1rem 0;
}

.ims-more-info-empty p {
    font-size: 0.875rem;
    color: var(--ims-text-secondary, #6b7280);
    margin: 0;
}

.ims-more-info-empty a {
    color: var(--ims-accent-blue, #2563eb);
    text-decoration: underline;
}

/* Responsive: stack image and details on smaller screens */
@media (max-width: 640px) {
    .ims-more-info-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .ims-more-info-image-wrap {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

    .ims-more-info-btn {
        width: auto;
    }
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.ims-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--ims-text-secondary);
}

.ims-pagination-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ims-pagination-text strong {
    color: var(--ims-text-primary);
    font-weight: 600;
}

/* ==========================================================================
   Layout Container
   ========================================================================== */

.ims-product-listing-layout {
    display: grid;
    grid-template-columns: var(--ims-filter-sidebar-width) 1fr;
    gap: 2rem;
    align-items: start;
}

/* When sidebar wrapper has no content, make products full width */
.ims-filter-sidebar-wrapper:empty + .ims-products-main,
.ims-filter-sidebar-wrapper:not(:has(.ims-filter-sidebar)):not(:has(.ims-subcategory-nav)) + .ims-products-main {
    grid-column: 1 / -1;
}

/* Hide empty filter wrapper */
.ims-filter-sidebar-wrapper:empty {
    display: none;
}

/* Adjust grid when no sidebar content (neither filters nor subcategory nav) */
.ims-product-listing-layout:has(.ims-filter-sidebar-wrapper:empty),
.ims-product-listing-layout:not(:has(.ims-filter-sidebar)):not(:has(.ims-subcategory-nav)) {
    grid-template-columns: 1fr;
}

@media (max-width: 1024px) {
    .ims-product-listing-layout {
        grid-template-columns: 300px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .ims-product-listing-layout {
        grid-template-columns: 1fr;
    }
    
    .ims-filter-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 1.5rem;
    }

    .ims-price-filter {
        grid-template-columns: 1fr;
    }
    
    .ims-price-apply {
        justify-self: flex-end;
    }
    
    .ims-page-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ims-product-card {
        flex-direction: column;
        text-align: center;
    }
    
    .ims-product-image {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }
    
    .ims-product-info {
        align-items: center;
    }
    
    .ims-product-actions {
        align-items: center;
        width: 100%;
    }
    
    .ims-price-section {
        text-align: center;
    }
    
    .ims-cart-section {
        align-items: center;
    }
}

/* ==========================================================================
   WooCommerce Block Overrides
   ========================================================================== */

/* Override WooCommerce defaults to match our design */
.wp-block-woocommerce-product-collection .ims-product-card,
.woocommerce .products .ims-product-card {
    display: flex !important;
    width: 100% !important;
}

/* Hide default WooCommerce elements */
.ims-product-listing .woocommerce-result-count,
.ims-product-listing .woocommerce-ordering {
    display: none !important;
}

/* Style the WooCommerce breadcrumbs */
.woocommerce-breadcrumb {
    font-size: 0.875rem !important;
    color: var(--ims-text-secondary) !important;
    margin-bottom: 0.75rem !important;
    padding: 0 !important;
}

.woocommerce-breadcrumb a {
    color: var(--ims-text-secondary) !important;
    text-decoration: underline !important;
}

.woocommerce-breadcrumb a:hover {
    color: var(--ims-text-primary) !important;
}

/* ==========================================================================
   Filter Animations
   ========================================================================== */

@keyframes filterSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ims-filter-section.expanded .ims-filter-content-inner {
    animation: filterSlideDown 0.2s ease;
}

/* ==========================================================================
   Volume Pricing Indicator
   ========================================================================== */

.ims-volume-pricing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    color: var(--ims-accent-blue);
    cursor: pointer;
}

.ims-volume-pricing-badge:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Catalog Page Link
   ========================================================================== */

.ims-catalog-page-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--ims-text-primary);
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color 0.2s ease;
}

.ims-catalog-page-link:hover {
    color: var(--ims-text-primary);
    text-decoration: underline;
}

.ims-catalog-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.ims-catalog-icon path {
    stroke: #7f1d1d;
    stroke-width: 0.6;
}

.ims-catalog-page-link span {
    font-weight: 500;
}

/* ==========================================================================
   SDS Document Links
   ========================================================================== */

.ims-sds-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.ims-sds-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--ims-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ims-sds-link:hover {
    color: var(--ims-accent-blue);
    text-decoration: underline;
}

.ims-sds-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.ims-sds-link span {
    font-weight: 500;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.ims-products-loading {
    text-align: center;
    padding: 3rem;
    color: var(--ims-text-muted);
}

.ims-products-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ims-border-color);
    border-top-color: var(--ims-accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   No Products Found
   ========================================================================== */

.ims-no-products {
    text-align: center;
    padding: 3rem;
    background: var(--ims-bg-white);
    border: 1px solid var(--ims-border-color);
    border-radius: 8px;
}

.ims-no-products-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.ims-no-products-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ims-text-primary);
    margin-bottom: 0.5rem;
}

.ims-no-products-text {
    font-size: 0.875rem;
    color: var(--ims-text-secondary);
}

