/* ============================================
   EMEGA CATEGORY PAGE LAYOUT
   File: cartridge/static/default/css/rendering/emega-category-page.css
   ============================================ */

/* Main Container - NO LEFT PADDING */
.emega-category-page {
    max-width: 100%; /* Changed from 1600px to 100% */
    margin: 0;
    padding: 0;
    width: 100%;
}

.emega-category-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
    padding: 20px; /* Top 20px, Right 0, Bottom 20px, Left 20px */
}

/* ============================================
   SIDEBAR (LEFT) - FLUSH TO EDGE
   ============================================ */
.category-sidebar {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

/* Sidebar Wrapper (the white box with border) */
.category-sidebar-wrapper {
    background: #fff;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    padding: 1rem;
}

/* ============================================
   REFINEMENT SECTIONS 
   ============================================ */

/* Add right border to the refinements container */
.refinements.emega-refinements {
    border-right: 2px solid #d5d9d9;
    padding-right: 1rem;
    margin-right: -1rem;
}

.emega-refinement-section {
    border-bottom: none !important;
    border-right: none;
    padding: 1rem 0;
}

.emega-refinement-section:first-child {
    padding-top: 0;
}

.emega-refinement-section:last-child {
    border-bottom: none;
}

.emega-refinement-title {
    font-size: 0.875rem !important;
    font-weight: 600 !important; /* Changed from 700 to 600 */
    color: #0f1111;
    margin: 0 !important;
    padding: 0.5rem 0 0.25rem 0 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.5px !important;
}

.emega-refinement-content {
    font-size: 0.875rem;
    border-bottom: none !important;
    padding-top: 0 !important; /* Remove any top padding */
    margin-top: 0 !important; /* Remove any top margin */
}

/* Remove any other potential borders */
.emega-refinements .refinement {
    border: none !important;
    border-bottom: none !important;
}

.emega-refinements hr,
.emega-refinements .card-body {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* ============================================
   EMEGA CATEGORIES STYLE
   ============================================ */

/* Remove default refinement styles */
.emega-breadcrumb-wrapper {
    border: none !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.emega-category-breadcrumb {
    display: flex;
    flex-direction: column;
}

/* Breadcrumb items - TIGHTER spacing */
.emega-breadcrumb-item {
    padding: 1px 0 !important; /* Reduced spacing */
    font-size: 14px !important;
    line-height: 1.3 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Parent items - ensure no indentation */
.emega-breadcrumb-item.emega-parent-item {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Current category item - SAME vertical spacing as others */
.emega-breadcrumb-item.emega-current-item {
    padding-left: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 1px !important; /* Match .emega-breadcrumb-item */
    padding-bottom: 1px !important; /* Match .emega-breadcrumb-item */
}

/* Remove all indentation by default */
.emega-breadcrumb-item.indent-0,
.emega-breadcrumb-item.indent-1,
.emega-breadcrumb-item.indent-2,
.emega-breadcrumb-item.indent-3 {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Parent category back links - CONSISTENT vertical spacing */
.emega-refinements .emega-back-link,
a.emega-back-link {
    color: #261511 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    display: block !important;
    padding: 1px 0 1px 12px !important; /* Consistent 1px top/bottom */
    margin: 0 !important;
    line-height: 1.3 !important;
    position: relative;
}

/* Arrow positioned absolutely inside the padding area */
.emega-back-arrow {
    position: absolute;
    left: 0;
    display: inline-block;
}

.emega-refinements .emega-back-link:hover,
a.emega-back-link:hover {
    color: #261511 !important;
    text-decoration: none !important;
}

/* Current category - CONSISTENT vertical spacing with back link */
.emega-current-category,
span.emega-current-category {
    color: #261511 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    display: block !important;
    padding: 1px 0 1px 12px !important; /* Consistent 1px top/bottom */
    margin: 0 !important;
    line-height: 1.3 !important;
}

/* Subcategories list - tighter spacing */
.emega-category-list,
ul.emega-category-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.emega-subcategories,
ul.emega-subcategories {
    padding-left: 20px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.emega-category-item,
.emega-subcategory-item,
li.emega-category-item,
li.emega-subcategory-item {
    padding: 1px 0 !important; /* Reduced spacing */
    margin: 0 !important;
    border: none !important;
    border-bottom: none !important;
    line-height: 1.3 !important;
}

/* Subcategory links - CONSISTENT vertical spacing */
.emega-refinements .emega-category-link,
.emega-refinements a.emega-category-link,
.emega-subcategories .emega-category-link,
.emega-subcategories a.emega-category-link {
    color: #261511 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    display: inline-block !important;
    line-height: 1.3 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.emega-refinements .emega-category-link:hover,
.emega-refinements a.emega-category-link:hover,
.emega-subcategories .emega-category-link:hover,
.emega-subcategories a.emega-category-link:hover {
    color: #261511 !important;
    text-decoration: none !important;
}

.emega-category-link span {
    display: inline !important;
    color: #261511 !important;
}

/* Remove any hr or borders */
.emega-refinements hr,
.emega-refinements .emega-breadcrumb-item + .emega-breadcrumb-item::before,
.emega-refinements .values.content::before {
    display: none !important;
    border: none !important;
}

.emega-refinement-content {
    border-bottom: none !important;
}

.emega-refinements .values.content {
    border-top: none !important;
    padding-top: 0 !important;
}

.emega-refinements .card-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Additional overrides for default SFRA link styles */
.refinements.emega-refinements a,
.refinements.emega-refinements a:link,
.refinements.emega-refinements a:visited {
    color: #261511 !important;
    text-decoration: none !important;
}

.refinements.emega-refinements a:hover,
.refinements.emega-refinements a:active {
    color: #261511 !important;
    text-decoration: none !important;
}

/* ============================================
   EMEGA PRICES Refine SECTIONS
   ============================================ */

.price-refinement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.price-refinement-item {
    margin: 0;
    padding: 0;
    width: fit-content; /* Shrink to content width */
}

.price-refinement-link {
    display: inline-block; /* Changed from block */
    width: auto; /* Changed from 100% */
    text-align: left;
    padding: 1px 0; /* Match category spacing */
    color: #261511;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3; /* Match category line-height */
    transition: none;
}

.price-refinement-link:hover {
    color: #261511;
    text-decoration: none;
}

.price-refinement-item.selected .price-refinement-link {
    font-weight: 700;
    color: #261511;
}

.price-range-text {
    display: inline; /* Changed from block */
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   BOOLEAN ATTRIBUTE REFINEMENT STYLES
   ============================================ */

/* List Reset */
.emega-attributes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.emega-refinement-item {
    list-style: none;
    margin: 0 0 2px 0;
    padding: 0;
}

/* Refinement Link (Works for checkboxes) */
.emega-refinement-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    text-decoration: none;
    color: #0f1111;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.emega-refinement-link:hover:not(.disabled) {
    color: #c7511f;
}

.emega-refinement-link:hover:not(.disabled) .emega-refinement-label {
    text-decoration: underline;
}

.emega-refinement-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Checkbox Styles */
.emega-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.emega-checkbox svg {
    display: block;
}

.emega-checkbox-empty {
    display: block;
    width: 14px;
    height: 14px;
    border: 1px solid #888c8c;
    border-radius: 2px;
    background: white;
    transition: border-color 0.15s ease;
}

.emega-refinement-link:hover:not(.disabled) .emega-checkbox-empty {
    border-color: #007185;
}

/* Label */
.emega-refinement-label {
    flex: 1;
    font-weight: 400;
}

.emega-refinement-link.selected .emega-refinement-label {
    font-weight: 700;
}

/* Count Badge */
.emega-refinement-count {
    color: #565959;
    font-size: 13px;
    margin-left: auto;
}

/* ============================================
   SIZE ATTRIBUTE REFINEMENT STYLES (COMPACT GRID)
   ============================================ */

/* Size Grid Container - Compact for sidebar */
.emega-size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.emega-size-item {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0; /* Allow items to shrink */
}

/* Size Link Button - Smaller and more compact */
.emega-size-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    padding: 6px 4px;
    border: 1px solid #d5d9d9;
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    color: #0f1111;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.15s ease;
    text-align: center;
}

.emega-size-link:hover:not(.disabled) {
    border-color: #007185;
    box-shadow: 0 0 0 1px #c7f3ff;
    color: #007185;
}

.emega-size-link.selected {
    border-color: #007185;
    border-width: 2px;
    background: #e3f2fd;
    color: #007185;
    font-weight: 700;
}

.emega-size-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: #f7f7f7;
    color: #888;
}

.emega-size-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

/* ============================================
   MOBILE FILTER - ULTRA SMOOTH (NO DOUBLE FOLD)
   ============================================ */

/* Hardware acceleration for all animations */
.mobile-filter-drawer * {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

/* Mobile-specific classes */
.mobile-only {
    display: none;
}

/* Mobile Filter Trigger Button */
.mobile-filter-trigger {
    margin: 16px 0;
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

/* Mobile Filter Drawer - FULL SCREEN */
.mobile-filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition:
        visibility 0s 0.3s,
        opacity 0.3s;
}

.mobile-filter-drawer.active {
    visibility: visible;
    opacity: 1;
    transition:
        visibility 0s,
        opacity 0.3s;
}

.filter-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* Half Screen Bottom Sheet */
.filter-drawer-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60vh;
    max-height: 650px;
    background: white;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.mobile-filter-drawer.active .filter-drawer-content {
    transform: translateY(0);
}

/* Filter Drawer Header */
.filter-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    background: white;
    min-height: 56px;
    border-radius: 20px 20px 0 0 !important;
    flex-shrink: 0;
}

.filter-drawer-header::before {
    display: none;
}

.filter-drawer-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f1111;
    margin: 0;
}

.btn-close-drawer {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 4px;
    color: #0f1111;
    width: 36px;
    height: 36px;
    margin-left: auto;
}

.btn-close-drawer:active {
    opacity: 0.7;
}

.btn-close-drawer svg {
    width: 24px;
    height: 24px;
}

/* Filter Drawer Body */
.filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: white;
    padding: 0;
}

/* Refinement Sections */
.mobile-filter-drawer .emega-refinements,
.mobile-filter-drawer .refinements {
    padding: 0;
    background: white;
    margin: 0;
}

.mobile-filter-drawer .emega-refinement-section,
.mobile-filter-drawer .refinement {
    background: white;
    margin: 0 !important;
    border-radius: 0;
    padding: 0;
    border-top: 1px solid #e8e8e8 !important;
    border-bottom: 1px solid #e8e8e8 !important;
    border-left: none !important;
    border-right: none !important;
}

.mobile-filter-drawer .emega-refinement-section + .emega-refinement-section,
.mobile-filter-drawer .refinement + .refinement {
    border-top: none;
}

/* Refinement Header - Clickable */
.mobile-filter-drawer .emega-refinement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px !important;
    cursor: pointer;
    user-select: none;
    background: white;
    min-height: 48px;
    margin: 0 !important;
    transition: background-color 0.1s ease;
}

.mobile-filter-drawer .emega-refinement-header:active {
    background: #f7f7f7;
}

.mobile-filter-drawer .emega-refinement-title,
.mobile-filter-drawer .emega-refinement-header h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #0f1111;
    flex: 1;
    line-height: 1.4;
}

/* Chevron Icon - BUTTERY SMOOTH ROTATION */
.mobile-filter-drawer .emega-refinement-header::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid #565959;
    border-bottom: 2px solid #565959;
    transform: rotate(-45deg);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
    margin-left: 12px;
    will-change: transform;
}

.mobile-filter-drawer
    .emega-refinement-section.expanded
    .emega-refinement-header::after {
    transform: rotate(45deg);
}

/* Refinement Content - BUTTERY SMOOTH ANIMATION */
.mobile-filter-drawer .emega-refinement-content,
.mobile-filter-drawer .content,
.mobile-filter-drawer .card-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 !important;
    margin: 0 !important;
    transition:
        max-height 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.25s ease-out,
        padding 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: max-height, opacity;
}

/* Expanded state - smooth reveal with fade */
.mobile-filter-drawer
    .emega-refinement-section.expanded
    .emega-refinement-content,
.mobile-filter-drawer .emega-refinement-section.expanded .content,
.mobile-filter-drawer .emega-refinement-section.expanded .card-body {
    max-height: 800px;
    opacity: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 16px 12px !important;
    transition:
        max-height 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.35s ease-in 0.1s,
        padding 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Collapsed state - ensure it's fully hidden */
.mobile-filter-drawer
    .emega-refinement-section.collapsed
    .emega-refinement-content,
.mobile-filter-drawer .emega-refinement-section.collapsed .content,
.mobile-filter-drawer .emega-refinement-section.collapsed .card-body {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* ============================================
   UNIFORM TIGHT SPACING FOR ALL CONTENT
   ============================================ */

/* All Lists - Reset */
.mobile-filter-drawer .values,
.mobile-filter-drawer .emega-category-list,
.mobile-filter-drawer .emega-attributes-list,
.mobile-filter-drawer .price-refinement-list,
.mobile-filter-drawer .emega-size-grid {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
    display: block;
}

/* All List Items - UNIFORM TIGHT SPACING */
.mobile-filter-drawer .values li,
.mobile-filter-drawer .emega-category-item,
.mobile-filter-drawer .emega-subcategory-item,
.mobile-filter-drawer .emega-refinement-item,
.mobile-filter-drawer .price-refinement-item {
    list-style: none;
    padding: 2px 0 !important;
    margin: 0 !important;
    border-bottom: none;
    display: block;
    width: 100%;
}

/* All Links - UNIFORM TIGHT SPACING */
.mobile-filter-drawer .values a,
.mobile-filter-drawer .emega-category-link,
.mobile-filter-drawer .emega-refinement-link,
.mobile-filter-drawer .price-refinement-link {
    color: #0f1111;
    text-decoration: none;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    line-height: 1.4 !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    transition: color 0.15s ease;
}

.mobile-filter-drawer .values a:hover,
.mobile-filter-drawer .emega-category-link:hover,
.mobile-filter-drawer .emega-refinement-link:hover,
.mobile-filter-drawer .price-refinement-link:hover {
    color: #007185;
}

/* Checkboxes */
.mobile-filter-drawer .emega-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.mobile-filter-drawer .emega-checkbox-empty {
    display: block;
    width: 18px;
    height: 18px;
    border: 1px solid #888c8c;
    border-radius: 2px;
    background: white;
}

.mobile-filter-drawer .emega-refinement-label {
    font-size: 14px !important;
    color: #0f1111;
    line-height: 1.4;
}

/* Custom Control - UNIFORM */
.mobile-filter-drawer .custom-control {
    padding: 2px 0 !important;
    margin: 0 !important;
}

.mobile-filter-drawer .custom-control-label {
    font-size: 14px !important;
    color: #0f1111;
    cursor: pointer;
    padding-left: 8px;
    line-height: 1.4;
}

/* Price Range Text - UNIFORM */
.mobile-filter-drawer .price-range-text {
    font-size: 14px !important;
    line-height: 1.4 !important;
    display: block;
}

/* Buttons - UNIFORM */
.mobile-filter-drawer .values li button,
.mobile-filter-drawer .price-option {
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    padding: 4px 0 !important;
    margin: 0 !important;
    cursor: pointer;
    font-size: 14px !important;
    color: #0f1111;
    line-height: 1.4 !important;
    display: block;
}

/* Subcategories indentation */
.mobile-filter-drawer .emega-subcategories,
.mobile-filter-drawer ul.emega-subcategories {
    padding-left: 20px !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
}

/* Back link - consistent spacing */
.mobile-filter-drawer .emega-back-link {
    padding: 4px 0 4px 12px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: block;
}

/* Current category - consistent spacing */
.mobile-filter-drawer .emega-current-category {
    padding: 4px 0 4px 12px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: block;
}

/* Spacing between elements */
.mobile-filter-drawer .emega-back-link + .emega-current-category {
    margin-top: 0 !important;
}

.mobile-filter-drawer .emega-current-category + .emega-subcategories {
    margin-top: 4px !important;
}

/* Remove default card styles */
.mobile-filter-drawer .card,
.mobile-filter-drawer .card-header,
.mobile-filter-drawer .card-body {
    border: none !important;
    background: transparent !important;
}

/* Size grid for mobile */
.mobile-filter-drawer .emega-size-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
    gap: 8px !important;
    margin-top: 4px !important;
}

.mobile-filter-drawer .emega-size-item {
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-filter-drawer .emega-size-link {
    font-size: 13px !important;
    padding: 10px 6px !important;
    min-height: 40px !important;
}

/* Filter Drawer Footer */
.filter-drawer-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e8e8e8;
    background: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.btn-clear-filters,
.btn-apply-filters {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.btn-clear-filters {
    background: white;
    border: 1px solid #d5d9d9;
    color: #0f1111;
}

.btn-clear-filters:active {
    background: #f7f7f7;
    border-color: #a0a6a8;
}

.btn-apply-filters {
    background: #ffd814;
    border: 1px solid #fcd200;
    color: #0f1111;
}

.btn-apply-filters:active {
    background: #f7ca00;
    border-color: #f2c200;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .desktop-tablet-only {
        display: none !important;
    }
}

/* Prevent body scroll when drawer is open */
body.filter-drawer-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100vh;
}

/* Smooth scrolling */
.filter-drawer-body {
    scroll-behavior: smooth;
}

/* Thin scrollbar */
.filter-drawer-body::-webkit-scrollbar {
    width: 4px;
}

.filter-drawer-body::-webkit-scrollbar-thumb {
    background: #d5d5d5;
    border-radius: 2px;
}

.filter-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Performance optimizations */
.mobile-filter-drawer.active .filter-drawer-body {
    transform: translateZ(0);
}

.mobile-filter-drawer .emega-refinement-section {
    contain: layout style;
}

/* ============================================
   MAIN CONTENT (RIGHT)
   ============================================ */
.emega-main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin-left: 20px;
    margin-right: 0;
}

/* Category Header Wrapper - 30% width constraint */
.category-header-wrapper {
    max-width: 30%;
    margin-bottom: 24px;
}

/* Category Header */
.category-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f1111;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

/* Category Description */
.category-description {
    font-size: 14px;
    color: #565959;
    line-height: 1.5;
    margin-top: 12px;
}

.category-description a {
    color: #007185;
    text-decoration: none;
}

.category-description a:hover {
    color: #c7511f;
    text-decoration: underline;
}

/* ============================================
   Page Designer SECTION
   ============================================ */
.emega-pd-isolation-wrapper {
    padding-bottom: 10px;
}

/* ============================================
   PRODUCT GRID SECTION
   ============================================ */
.product-grid-section {
    background: #fff;
    width: 100%;
    padding: 0;
    margin: 0;
}

/* ============================================
   SortOrderMenu style
   ============================================ */
.sorting-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    background: transparent;
    border: none;
    margin-bottom: 16px;
}

.sorting-bar > * {
    width: auto;
    max-width: 30%;
    min-width: 250px;
}

.sorting-bar select.custom-select,
.sorting-bar select.custom-select:focus,
.sorting-bar select.custom-select:active,
select[name="sort-order"],
select[name="sort-order"]:focus,
select[name="sort-order"]:active {
    outline: none !important;
    box-shadow: none !important;
    border-color: #ddd !important;
}

/* Results Count Bar */
.results-count-bar {
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #565959;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.results-count-bar .search-result-count {
    font-weight: 400;
    color: #0f1111;
}

.results-count-bar .search-keywords {
    color: #c7511f;
    font-weight: 600;
}

.results-count-bar p {
    margin: 0;
}

/* ============================================
   Product Grid Styles
   ============================================ */
.product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

/* Override Bootstrap column classes */
.product-grid > .region,
.product-grid > div[class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Product tile container */
.product-grid .product {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

/* Image container - fixed aspect ratio */
.product-grid .product .image-container {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Square aspect ratio */
    overflow: hidden;
    background: #f8f8f8;
}

.product-grid .product .image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Product tile body */
.product-grid .product .tile-body {
    padding: 12px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-grid .product .pdp-link {
    text-decoration: none;
}

.product-grid .product .tile-body .product-name {
    font-size: 14px;
    line-height: 1.4;
    color: #0f1111;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Grid footer */
.product-grid .grid-footer {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 0 !important;
    margin: 0 !important;
    grid-column: 1 / -1; /* Span all columns */
}

/* Show More Button Container */
.product-grid .show-more {
    width: 100%;
}

.product-grid .show-more .text-center {
    width: 100%;
    max-width: 100%;
}

.product-grid .show-more button.more {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 575px) {
    .category-header-wrapper {
        max-width: 100%;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .emega-main-content {
        flex: 1;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: auto;
    }
    .sorting-bar {
        display: none;
    }
}

@media (min-width: 576px) and (max-width: 768px) {
    .category-header-wrapper {
        max-width: 100%;
    }
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .emega-main-content {
        flex: 1;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: auto;
    }
    .sorting-bar {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 20px !important;
    }
}
