/* Default classes */
.mk-grid {
 max-width: 100%;
 margin: 0px !important;
}


/* Main Container Layout */
.rs-catalog-wrapper{
    display: grid;
    grid-template-columns: 3fr 9fr;
    gap: 30px; 
    max-width: 100%;
    margin-top: 50px;
}
/* Remove page header */
#mk-page-introduce {
    display: none;
}

/* Category header */
#rs-catalog-header {
    display: grid;
    grid-template-columns: 1fr 3fr; 
    gap: 30px;
    background-color: #f9f9f9; 
}
.rs-cat-header-hero {
    grid-column: 2 / 3; 
}
.rs-cat-header-hero {
    padding: 20px 30px;
    border-radius: 4px;
    text-align: center; 
}
.rs-header-toggle {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 10pt;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.rs-header-toggle:hover {
    color: #555;
}

.rs-cat-header-image {
    max-width: 200px !important;
}

.rs-cat-title {
    margin: 0; 
    text-transform: uppercase;
}

.rs-header-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: rotate(45deg); /* Points Down */
    transition: transform 0.3s ease;
    margin-bottom: 4px; /* Optical vertical center adjustment */
}
.rs-cat-header-hero.open .rs-header-arrow {
    transform: rotate(225deg); /* Points Up */
    margin-bottom: -4px;
}

/* Collapsible Description */
.rs-cat-desc-collapse {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}
.rs-cat-header-hero.open .rs-cat-desc-collapse {
    max-height: 500px; /* Must be larger than your text height */
    opacity: 1;
    margin-top: 15px; /* Adds space between title and text when open */
}
.rs-cat-desc {
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    #rs-catalog-header {
        display: block; /* Removes the grid */
    }
    
    .rs-cat-header-hero {
        grid-column: auto;
        text-align: center; /* Keeps it centered on small screens */
    }
}


/* Sidebar Container */
.rs-filter-sidebar {
    border-top: 1px solid #eee; /* Top Separator */
}
.rs-filter-form {
    margin-left: 25px;
}
.rs-filter-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 10px 0 20px 0;
    width: 100%;
}

.rs-filter-title {
    font-size: 16pt;
    font-weight: 700;
    color: #000;
}

.rs-mobile-toggle {
    display: none; /* Hidden on Desktop */
    background: transparent;
    border: none;
    padding: 10px; /* Touch target size */
    cursor: pointer;
    z-index: 1001;
}
.rs-burger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: block;
}
.rs-burger-icon span {
    display: block;
    position: absolute;
    height: 2px;       /* Line Thickness */
    width: 100%;       /* Line Width */
    background: #000;  /* Line Color */
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: all 0.25s ease-in-out;
}
/* Positioning the lines */
.rs-burger-icon span:nth-child(1) { top: 0px; }
.rs-burger-icon span:nth-child(2) { top: 8px; }
.rs-burger-icon span:nth-child(3) { top: 16px; }

/* Accordion Item */
.rs-accordion-item { border-bottom: 1px solid #eee; }

.rs-accordion-header {
    display: flex;
    font-size: 11pt;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
}

.rs-accordion-header .rs-title { 
    font-weight: 600; 
}

.rs-arrow {
    width: 8px; height: 8px;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.rs-accordion-item.open .rs-arrow { transform: rotate(225deg); margin-top: 5px; }

.rs-accordion-body {
    display: none; /* Hidden by default (desktop accordion logic) */
    padding-bottom: 20px;
}
.rs-accordion-item.open .rs-accordion-body { display: block; }

/* Category menu */
.rs-cat-link {
    font-size: 11pt;
}
.rs-cat-link.active {
    font-weight: 700;
    border: 0px;
    color: #434343;
}
/* when the sub-menu is active --> Parent is active */
.rs-category-menu-list li {
    margin: 5px 0px;
}
.rs-category-menu-list > li.rs-cat-open > a.rs-cat-link {
    font-weight: 700; 
    color: #434343;
}
.rs-category-menu-list {
    list-style: none;
    padding: 0;
}
.rs-sub-menu {
    list-style: none;
}
.rs-category-menu-list, .rs-sub-menu {
    margin: 0;
}

/* menu items */
#rs-price-range {
    width: 60%;
    accent-color: #000;
}
.rs-filter-content select {
    padding: 10px 10px;
    width: 100%;
}
/* Tag pill styling Container */
.rs-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.rs-camp-inventory-pill {
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size:11px; 
    font-weight: bold; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.rs-tag-cloud li {
    margin: 0; 
}
/* Price styling */
.rs-catalog-price {
    font-style:italic;
}
.rs-standard-price {
    text-decoration:none;
}
.rs-sale-price {
    text-decoration:none;
    margin-right: 8px;
    margin-right: 8px;
}
.rs-regular-price {
    opacity: 0.6;
    text-decoration: line-through;
}

/* Hide the default checkbox */
.rs-tag-cloud input[type="checkbox"] { 
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.rs-tag-button {
    display: inline-block;
    padding: 6px 14px;
    font-size: 8pt;
    font-weight: 500;
    color: #333;           /* Black Text */
    background-color: transparent;
    border: 1px solid #333; /* Black Outline */
    border-radius: 20px;    /* Rounded "Pill" shape */
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.2;
}
.rs-tag-button:hover {
    background-color: #f5f5f5;
}
.rs-tag-cloud input[type="checkbox"]:checked + .rs-tag-button {
    background-color: #000; 
    color: #fff;            
    border-color: #000;
}



/**
 * 
 *  Products Grid Styling 
 * 
 */
.products-grid-wrapper {
    width: 100%;
    height: auto;
    position: relative; 
    min-height: 500px;
}

.rs-products-grid-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.rs-tags {
    font-size: 0.8em;
    color: #545454;
}
/* Product catalog styling @catalog template */

.rs-product-wrapper {
    padding: 15px;
}
.rs-product-loop-thumb {
    position: relative;
    /* Ensure the container maintains its layout around the image */
    display: block; 
}

.rs-new-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: #000000;
    color: #ffffff;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 10;
}
.rs-product-loop-thumb {
    width: 100%;
    /* Modern way to lock ratio */
    aspect-ratio: 4 / 3; 
    
    /* Fallback for very old browsers (optional): height: 0; padding-bottom: 75%; */
    
    overflow: hidden;
    position: relative;
    display: block; /* Ensure it takes width */
}

.product-loop-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 'cover' fills the box (cropping edges), 'contain' shows full image (letterboxing) */
    transition: opacity 0.3s ease; /* Optional: smooth fade effect */
}
.rs-shop-item-detail {
    padding: 10px 0;
}
b.rs-product-brand {
    font-weight: 700 !important;
    font-style: uppercase;
    font-size: 11pt;
    margin: 0px;
}
.rs-product-title {
    display: flex;
    justify-content: space-between; 
    text-overflow: ellipsis;
    align-items: center;
    width: 100%;
    margin: 0 0 10px 0;
}
.rs-product-title a {
    text-align: left;
    margin-right: 10px;             
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
}

.rs-product-lowest-cat {
    font-size: 0.8em;
    color: #545454;
}

/** 
 * Explanation bubble for the R1/1 badge.
 * @see: content-rs-catalog.php
 */
 .r1-1-badge {
    display: flex;
    position: relative !important;
    align-items: center;
    flex-shrink: 0;
}
.r1-1-badge img {
    height: 22px;
    width: auto;
    display: block;            
}
.r1-1-badge::after {
    content: attr(data-tooltip); /* Grabs the text from HTML */
    position: absolute;
    bottom: 140%; /* Pushes it above the badge */
    right: 0;
    
    width: 220px; /* Nice readable width */
    background-color: #000;
    color: #fff;
    font-size: 12px;
    font-weight: normal;
    text-align: left;
    padding: 10px 12px;
    border-radius: 4px;
    line-height: 1.4;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    
    /* Animation & Hide by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease-in-out;
    z-index: 100;
    pointer-events: none;
}

.r1-1-badge::before {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 12px; 
    border-width: 6px;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
    
    /* Animation & Hide by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease-in-out;
    z-index: 100;
    pointer-events: none;
}

.r1-1-badge:hover::after,
.r1-1-badge:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rs-product-item-desc {
    font-size: 1em;
    color: #666;    
}
.rs-catalog-price {
    font-size: 0.8em;
    color: #333;
    text-align: center;
}
.rs-small-grey-button-wrapper {
    text-align:center
}
.rs-small-grey-button {
    display: inline-block;
    padding: 5px 20px;
    background-color: transparent;
    border: 1px solid #333;
    color: #333;
    text-decoration: none;
    font-size: 0.6em;
    font-weight: 600;
    transition: all 0.3s ease;
}
.rs-small-grey-button:hover {
    background-color: #333;
    color: #fff;
    transition:cubic-bezier(0.075, 0.82, 0.165, 1);
}
.rs-small-grey-button-title {
    text-transform: uppercase;
    letter-spacing: 1px;
}
/* 1. Center the Swatches */
.rs-color-swatches {
    display: flex;
    gap: 6px;
    margin: 10px 0;
    flex-wrap: wrap;
    justify-content: center; /* This centers the items horizontally */
}

/* Swatch Buttons */
.rs-swatch-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #e1e1e1;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.rs-swatch-btn:hover, .rs-swatch-btn.active {
    transform: scale(1.2);
    border-color: #333;
}



/* rs loader */
#rs-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px); 
    z-index: 20; 
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: all;
    transition: opacity 0.25s ease-in-out;
}
.rs-rotating-loader {
    display: block;
    width: 130px;
    animation: rs-spin 1.2s linear infinite;
}


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

/* Pagination */

.rs-pagination-container {
    margin: 20px 0px 40px 0px;
    display: flex;
    justify-content: center;
    width: 100%;
    clear: both;
}

/* Load More Button */
.rs-load-more-btn {
    background-color: transparent;
    color: #333;
    border: 2px solid #333;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rs-load-more-btn:hover {
    background-color: #333;
    color: #fff;
}
/* Responsive Media Query for Mobile/Tablet */
@media (max-width: 768px) {
    /* Mobile filter menu */
    .rs-mobile-toggle {
        display: block;
    }

    .rs-products-grid-inner {
        display: grid;
        grid-template-columns: 1fr; /* Forces exactly 1 column */
        gap: 20px;
    }

    /* Loader */
    .rs-rotating-loader {
        max-width: unset;
        width: 40%; /* Smaller loader for mobile */
    }

    /* Hide the Filter Content (Accordions) by Default */
    .rs-filter-sidebar {
        display: none;
        padding-top: 10px;
        
    }
    /* When JS adds .active to the form, we show the sidebar */
    .rs-filter-form.active .rs-filter-sidebar {
        display: block;
        animation: slideDown 0.3s ease-out forwards;
        padding-right: 20px;
    }

    /* OPEN STATE: Animate Burger to X */
    .rs-filter-form.active .rs-burger-icon span:nth-child(1) {
        top: 8px;
        transform: rotate(135deg);
    }

    .rs-filter-form.active .rs-burger-icon span:nth-child(2) {
        opacity: 0;
        left: -60px; /* Slide out to the left */
    }

    .rs-filter-form.active .rs-burger-icon span:nth-child(3) {
        top: 8px;
        transform: rotate(-135deg);
    }

    /* Mobile catalog */
    .rs-catalog-wrapper {
        grid-template-columns: 1fr; 
    }

    .rs-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .rs-desktop-header {
        display: none;
    }

    /* Sizing items */
    .rs-product-title {
        font-size: 14pt;
    }
    .rs-cat-link {
        font-size: 14pt;
    }
    .rs-tag-button {
        font-size: 10pt;
    }
    .rs-filter-content select {
        font-size: 11pt;
    }
    #rs-price-range {
        width: 70%;
    }
    
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}