@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* Dynamic Category Filters Core Design System */
.gromach-archive-container {
    width: 100%;
    margin: 40px auto;
    padding: 40px 30px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    color: #1F2937;
    background-color: #F9FAFB;
    margin-top: 0;
}

.gromach-archive-inner {
    display: flex;
    gap: 30px;
    max-width: 1320px;
    margin: 0 auto;
    align-items: flex-start;
}

/* Sidebar & Filters UI */
.gromach-sidebar-filters {
    width: 300px;
    flex-shrink: 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    position: sticky;
    top: 100px;
    z-index: 100;
}

.gromach-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
}

.gromach-sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    font-family: 'Outfit', sans-serif;
}

.gromach-close-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9CA3AF;
}

/* Filter Groups Styling */
.gromach-filter-group {
    border-bottom: 1px solid #F3F4F6;
    padding: 24px 0;
    box-sizing: border-box;
}

.gromach-filter-group:last-child {
    border-bottom: none;
}

.gromach-filter-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding-bottom: 6px;
}

.gromach-filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.gromach-category-filter-list,
.gromach-subcategory-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gromach-cat-item,
.gromach-subcat-item {
    margin-bottom: 6px;
}

.gromach-cat-item a,
.gromach-subcat-item a {
    display: block;
    width: 100%;
    border-radius: 12px;
    padding: 10px 12px;
    color: #374151;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.gromach-cat-item.active > a,
.gromach-subcat-item.active > a,
.gromach-cat-item a:hover,
.gromach-subcat-item a:hover {
    background-color: #EFF6FF;
    color: #111827;
}

.gromach-subcategory-list {
    margin-top: 8px;
    padding-left: 10px;
}

.gromach-subcat-item a {
    font-size: 13px;
    color: #4B5563;
}

/* Keyword Search Input */
.gromach-search-input-wrap {
    position: relative;
}

.gromach-search-input-wrap input {
    width: 100%;
    padding: 12px 35px 12px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.25s ease;
    box-sizing: border-box;
    background-color: #F9FAFB;
}

.gromach-search-input-wrap input:focus {
    outline: none;
    border-color: #16A34A;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.gromach-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #9CA3AF;
    transition: color 0.2s ease;
}

.gromach-search-clear:hover {
    color: #374151;
}

/* Collapsible Filter Groups */
.collapsible-group .gromach-filter-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.collapsible-group .toggle-arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 4px;
}

.collapsible-group.active .toggle-arrow {
    transform: rotate(-135deg);
}

.collapsible-group .gromach-filter-content {
    margin-top: 15px;
    display: none;
}

.collapsible-group.active .gromach-filter-content {
    display: block;
}

/* Checkbox and Radio styling */
.gromach-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #4B5563;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.gromach-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #D1D5DB;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background-color: #FFF;
    margin: 0;
}

.gromach-checkbox-label input[type="checkbox"]:checked {
    border-color: #16A34A;
    background-color: #16A34A;
}

.gromach-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    top: 2px;
    left: 5px;
    transform: rotate(45deg);
}

.gromach-checkbox-label span {
    transition: color 0.2s ease;
}

.gromach-checkbox-label input[type="checkbox"]:checked + span {
    color: #111827;
    font-weight: 500;
}

.gromach-scrollable-filters {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for Filters */
.gromach-scrollable-filters::-webkit-scrollbar {
    width: 5px;
}
.gromach-scrollable-filters::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 10px;
}
.gromach-scrollable-filters::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}
.gromach-scrollable-filters::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Numeric Range Fields (Min/Max inputs) */
.gromach-range-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.gromach-range-inputs .range-field {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 8px;
    background-color: #F9FAFB;
    font-size: 13px;
    box-sizing: border-box;
}

.gromach-range-inputs .range-field span {
    color: #9CA3AF;
    margin-right: 5px;
}

.gromach-range-inputs .range-field input {
    border: none;
    background: none;
    width: 100%;
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    padding: 0;
    box-sizing: border-box;
}

.gromach-range-inputs .range-field input:focus {
    outline: none;
}

/* Premium Custom Dual Range Slider */
.gromach-double-slider-wrap {
    position: relative;
    width: 100%;
    height: 6px;
    margin: 25px 0 10px 0;
}

.gromach-double-slider-wrap .slider-track {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: #E5E7EB;
    border-radius: 3px;
    z-index: 1;
}

.gromach-double-slider-wrap input[type="range"] {
    position: absolute;
    width: 100%;
    height: 0;
    margin: 0;
    pointer-events: none;
    appearance: none;
    outline: none;
    background: none;
    z-index: 2;
    top: 5px;
}

/* Style Range thumbs independently for cross-browser support */
.gromach-double-slider-wrap input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #000;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    pointer-events: auto;
    margin-top: -6px; /* center the thumb vertically */
}

.gromach-double-slider-wrap input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #000;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    pointer-events: auto;
}

/* Action button at bottom of sidebar */
.gromach-reset-filters-btn-wrap {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #F3F4F6;
}

.gromach-reset-filters-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    background: #FFFFFF;
    color: #4B5563;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gromach-reset-filters-btn:hover {
    background-color: #F9FAFB;
    color: #111827;
    border-color: #9CA3AF;
}

/* Product Listing Layout */
.gromach-archive-content {
    flex: 1;
    min-width: 0; /* Prevent flex blowout */
}

/* Breadcrumbs & Title */
.gromach-breadcrumbs {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 12px;
}

.gromach-breadcrumbs a {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s;
}

.gromach-breadcrumbs a:hover {
    color: #16A34A;
}

.gromach-archive-title {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 10px 0;
    font-family: 'Outfit', sans-serif;
}

.gromach-archive-description {
    font-size: 15px;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 800px;
}

/* Controls Bar (Results Count, Sorting, Mobile Filter Toggle) */
.gromach-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.gromach-controls-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gromach-controls-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.gromach-sort-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gromach-mobile-filter-trigger {
    display: none;
    align-items: center;
    gap: 8px;
    background-color: #111827;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.gromach-mobile-filter-trigger:hover {
    background-color: #1F2937;
}

.gromach-results-count {
    font-size: 14px;
    color: #4B5563;
    font-weight: 500;
}

.gromach-sort-select {
    min-width: 170px;
    max-width: 240px;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    font-size: 14px;
    color: #374151;
    background-color: #FFFFFF;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.gromach-sort-select:focus {
    border-color: #16A34A;
}

/* Active Filter Summary Tags */
.gromach-active-tags-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    background-color: #F3F4F6;
    padding: 10px 15px;
    border-radius: 10px;
}

.active-tags-label {
    font-size: 12px;
    font-weight: 600;
    color: #4B5563;
}

.gromach-active-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gromach-tag-item {
    background-color: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.gromach-tag-remove {
    cursor: pointer;
    color: #9CA3AF;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.gromach-tag-remove:hover {
    color: #EF4444;
}

.gromach-clear-tags-btn {
    background: none;
    border: none;
    color: #16A34A;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}

.gromach-clear-tags-btn:hover {
    text-decoration: underline;
}

/* Results grid wrapper & loading */
.gromach-products-results-wrap {
    position: relative;
    min-height: 400px;
}

/* Glassmorphic Loading Skeleton Overlay */
.gromach-loading-skeleton {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    animation: fadeIn 0.25s ease;
    border-radius: 16px;
}

.gromach-skeleton-spinner-wrap {
    background: #FFFFFF;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.gromach-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #F3F4F6;
    border-top: 3px solid #16A34A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Card Grid Styles */
.gromach-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.gromach-no-products {
    grid-column: 1 / -1;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: #6B7280;
    font-size: 15px;
    font-weight: 500;
}

/* Custom Machine Card UI */
.gromach-machine-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    box-sizing: border-box;
}

.gromach-machine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: #D1D5DB;
}

/* Image Wrap & Badge */
.gromach-card-image-wrap {
    position: relative;
    background-color: #F8FAFC;
    border-bottom: 1px solid #E5E7EB;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.gromach-card-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gromach-machine-card:hover .gromach-card-image {
    transform: scale(1.03);
}

.gromach-status-badge,
.gromach-sold-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background-color: #EF4444;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.gromach-status-badge.gromach-status-condition {
    background-color: #ea580c;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.22);
}
.archive .gromach-card-image-wrap img.gromach-card-image {
    height: 230px;
    object-fit: cover;
}

.gromach-machine-card.is-sold .gromach-card-image {
    filter: grayscale(100%);
    opacity: 0.8;
}

.gromach-machine-card.is-sold:hover .gromach-card-image {
    transform: none;
}

/* Card Body */
.gromach-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background-color: #FFFFFF;
}

.gromach-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.gromach-card-brand,
.gromach-card-sku {
    font-weight: 700;
}

.gromach-card-title {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    font-family: 'Outfit', sans-serif;
    color: #111827;
    text-transform: capitalize;
    min-height: 45px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: "Manrope", Sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3em;
    color: #000000;
}

.gromach-card-title a {
    color: inherit;
    text-decoration: none;
}

.gromach-card-title a:hover {
    color: #181c31;
}

.gromach-card-price {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 18px;
}

.gromach-card-specs-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.gromach-spec-badge {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 5px;
    padding: 10px 5px;
    text-align: center;
    /* min-height: 106px; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.gromach-spec-icon-svg {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 20px;
    margin: 0 auto;
    color: #16A34A;
}
.gromach-spec-icon-svg svg {
    color: #ff9813;
}

.gromach-spec-label {
    font-size: 11px;
    color: #6B7280;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.gromach-spec-text {
    font-size: 12px;
    color: #111827;
    font-weight: 600;
}

.gromach-card-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
}

.gromach-card-footer {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.gromach-card-price {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.price-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

.price-amount {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    font-family: 'Outfit', sans-serif;
    color: #9F9F9F;
    font-family: "Manrope", Sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1em;
}
/* Buttons details and offer */
.gromach-card-buttons {
    display: flex;
    gap: 8px;
}

.gromach-btn {
    flex: 1;
    padding: 10px;
    border-radius: 05px 05px 05px 05px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.gromach-btn-details {
    background-color: #000000;
    color: #fff;
    border: 1px solid #E5E7EB;
}

.gromach-btn-details:hover {
    background-color: #ff9813;
    color: #FFFFFF;
    border-color: #ff9813;
}

.gromach-btn-offer {
    background-color: #ff9813;
    color: #FFFFFF;
    border: 1px solid #ff9813;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.15);
}

.gromach-btn-offer:hover {
    background-color: #000;
    border-color: #000;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
    color: #fff;
}

/* Pagination container styles */
.gromach-pagination-wrap {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.gromach-pagination-wrap ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
}

.gromach-pagination-wrap li {
    margin: 0;
    border-right: 1px solid #E5E7EB;
}

.gromach-pagination-wrap li:last-child {
    border-right: none;
}

.gromach-pagination-wrap a, 
.gromach-pagination-wrap span {
    display: inline-block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    background: #FFFFFF;
    transition: background-color 0.2s;
}

.gromach-pagination-wrap a:hover {
    background-color: #F9FAFB;
    color: #ff9813;
}

.gromach-pagination-wrap span.current {
    background-color: #ff9813;
    color: #FFFFFF;
    cursor: default;
}

/* Mobile Sidebar Backdrop */
.gromach-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    animation: fadeIn 0.25s ease;
}

/* RESPONSIVE LAYOUT BREAKPOINTS */
@media (max-width: 1280px) {
    .gromach-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .gromach-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
   .gromach-archive-container {
        margin: 20px auto;
        margin-top: 0;
    }
    
    .gromach-archive-inner {
        flex-direction: column;
    }

    .gromach-mobile-filter-trigger {
        display: flex;
    }

    /* Transform Sidebar into dynamic responsive drawer */
    .gromach-sidebar-filters {
        position: fixed;
        top: 0;
        left: -320px; /* Hidden offscreen initially */
        bottom: 0;
        width: 300px;
        height: 100vh;
        overflow-y: auto;
        z-index: 1000;
        border-radius: 0;
        transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        margin: 0;
        border: none;
        box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    }

    .gromach-sidebar-filters.open {
        left: 0; /* Slide in drawer */
    }

    .gromach-close-sidebar {
        display: block;
    }
}

@media (max-width: 480px) {
    .gromach-products-grid {
        grid-template-columns: 1fr;
    }
    
    .gromach-controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .gromach-controls-left {
        justify-content: space-between;
    }

    .gromach-sort-select {
        width: 100%;
    }
    .gromach-card-title {
    text-transform: capitalize;
    min-height: fit-content;
}
}
