/*
 Theme Name:   Shoptimizer Child
 Theme URI:    https://www.commercegurus.com/shoptimizer/
 Description:  A child theme for the Shoptimizer theme.
 Author:       Armin Maglic
 Template:     shoptimizer
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  shoptimizer-child
*/

/* Add your own custom CSS here */

/* Styles from st.css for Custom Woo Product Showcase Widget */

.trp-notice.notice.error {
    display: none;
}
.cwp-product-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.cwp-product-grid li {
    list-style: none;
    padding: 0 15px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

/* Responsive column widths */
.cwp-product-grid.columns-1 li {
    width: 100%;
}
.cwp-product-grid.columns-2 li {
    width: 50%;
}
.cwp-product-grid.columns-3 li {
    width: 33.33%;
}
.cwp-product-grid.columns-4 li {
    width: 25%;
}
.cwp-product-grid.columns-5 li {
    width: 20%;
}
.cwp-product-grid.columns-6 li {
    width: 16.66%;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .cwp-product-grid.columns-4 li,
    .cwp-product-grid.columns-5 li,
    .cwp-product-grid.columns-6 li {
        width: 33.33%;
    }
}

@media (max-width: 768px) {
    .cwp-product-grid.columns-3 li,
    .cwp-product-grid.columns-4 li,
    .cwp-product-grid.columns-5 li,
    .cwp-product-grid.columns-6 li {
        width: 50%;
    }
}

@media (max-width: 480px) {
    .cwp-product-grid li {
        width: 100% !important;
    }
}
.cwp-custom-woo-products {
    font-family: "Poppins", sans-serif;
    background-color: #f9f9f9;
    padding: 20px;
}

.cwp-product-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 15px;
    flex-wrap: wrap;
    margin: 0px;
    touch-action: pan-y pinch-zoom;
}
ul.products.ppt-custom-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0;
    width: auto;
    margin-left: -55px;
    margin-right: -25px;
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    ul.products.ppt-custom-products-grid {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 20px; /* Increase gap for better spacing */
        margin-left: 0; /* Reset margins */
        margin-right: 0;
        padding: 10px; /* Add some padding */
    }
}

/* Tablet Responsive */
@media (min-width: 768px) and (max-width: 1023px) {
    ul.products.ppt-custom-products-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns layout */
        gap: 15px; /* Adjust gap */
        margin-left: -15px; /* Adjust margins */
        margin-right: -15px;
    }
}

/* Desktop (Large Screens) */
@media (min-width: 1024px) {
    ul.products.ppt-custom-products-grid {
        grid-template-columns: repeat(4, 1fr); /* Four columns layout */
        gap: 10px;
        margin-left: -55px;
        margin-right: -25px;
        margin-bottom: 20px;
    }
}
.cwp-product-item {
    width: 100%;
    margin: 0;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    touch-action: auto;
}

.cwp-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cwp-product-image {
    position: relative;
    overflow: hidden;
    background-color: white;
    transition: box-shadow 0.3s ease;
}

.cwp-product-image img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.cwp-needs-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(43, 54, 37, 0.8);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.cwp-product-image:hover .cwp-add-to-cart-btn {
    width: auto;
    padding: 0 20px;
    border-radius: 23px;
}

.cwp-product-image:hover img {
    transform: none;
    filter: brightness(1.05);
}

.cwp-product-image:hover::after {
    opacity: 1;
}

.cwp-product-image:hover .cwp-add-to-cart-btn::after {
    content: "Add to Cart";
    font-size: 14px;
    margin-left: 5px;
}
.cwp-product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.cwp-product-rating .star-rating {
    margin-right: 5px;
}

.cwp-review-count {
    font-size: 0.9em;
    color: #666;
}
.cwp-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 0px 0px 10px;
}

.cwp-product-category {
    font-size: 12px;
    color: #666666;
}

.cwp-product-rating .star-rating {
    font-size: 14px;
    color: #d7a64b;
}

.cwp-product-title {
    margin: 10px 0px 5px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    transition: color 0.3s ease;
}

.cwp-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #2b3625;
    margin-bottom: 10px;
    margin-left: 10px;
}

.cwp-add-to-cart {
    text-align: center;
    padding-bottom: 15px;
}

.cwp-add-to-cart .button {
    background-color: #d7a64b;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cwp-add-to-cart .button:hover {
    background-color: #3bafda;
}

@keyframes cwpFadeIn {
    to {
        opacity: 1;
    }
}

@keyframes cwpWiggle {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.cwp-product-image:hover {
    box-shadow: 0 0 20px rgba(215, 166, 75, 0.5);
}

@media (max-width: 1024px) {
    .cwp-product-item {
        width: calc(33.33% - 20px);
    }
}

@media (max-width: 768px) {
    .cwp-product-item {
        width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .cwp-product-item {
        width: calc(100% - 20px);
    }
}

.cwp-product-image:hover .cwp-benefit {
    opacity: 1;
}

.cwp-benefit-top-right,
.cwp-benefit-bottom-right {
    right: 0px;
    text-align: right;
}

.cwp-benefit-top-left,
.cwp-benefit-bottom-left {
    left: 0px;
    text-align: left;
}

.cwp-benefit-top-right,
.cwp-benefit-top-left {
    top: 40px;
}

.cwp-benefit-bottom-right,
.cwp-benefit-bottom-left {
    bottom: 20px;
}

.cwp-benefit-top-left::after,
.cwp-benefit-bottom-left::after {
    content: " →";
}

.cwp-benefit-top-right::before,
.cwp-benefit-bottom-right::before {
    content: "← ";
}

.cwp-benefit:nth-child(1) {
    transition-delay: 0.1s;
}
.cwp-benefit:nth-child(2) {
    transition-delay: 0.2s;
}
.cwp-benefit:nth-child(3) {
    transition-delay: 0.3s;
}
.cwp-benefit:nth-child(4) {
    transition-delay: 0.4s;
}

/* New additions */
.cwp-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cwp-product-link:hover {
    text-decoration: none;
    color: inherit;
}

.cwp-product-link:hover .cwp-product-title {
    color: #d7a64b;
}

.col-full {
    /*max-width: none !important;*/
    /*padding-right: 0 !important;*/
    /*padding-left: 0 !important;*/
    /*margin-right: 0 !important;*/
    /*margin-left: 0 !important;*/
}
.site-content {
    padding-top: 0 !important;
}
.cwp-tabs-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.cwp-category-tabs {
    display: flex;
    gap: 10px;
}

.cwp-category-tab {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: none;
    cursor: pointer;
    margin-right: 10px;
    color: #505050;
    border-radius: 5px;
}
.cwp-category-tab:hover {
    background-color: #d7a64b;
    color: white;
}
.cwp-category-tabs-desc {
    margin-bottom: 20px;
}
.cwp-category-desc {
    display: none;
    padding: 0;
    background-color: none;
    border: 0;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.cwp-category-desc.active {
    display: block;
    text-align: center;
}

.cwp-category-tab.active {
    background-color: #3bafda;
    color: #fff;
}
.cwp-view-all {
    padding: 5px 15px;
    background-color: #f0f0f0;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
}
.cwp-view-all:hover {
    background-color: #d7a64b;
    color: white;
}

.cwp-product-row {
    display: flex;
    flex-wrap: wrap;
}

.cwp-product-item {
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .cwp-tabs-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .cwp-category-tabs {
        margin-bottom: 10px;
    }

    .cwp-view-all {
        align-self: flex-end;
    }

    .cwp-product-item {
        width: 48%;
    }
}
/* Make category tabs scrollable on mobile/tablet */
@media (max-width: 1024px) {
    .cwp-category-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .cwp-category-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Opera */
    }

    .cwp-category-tab {
        display: inline-block;
        flex-shrink: 0;
    }
}

/* Horizontal scrolling products for mobile/tablet */
@media (max-width: 1024px) {
    .cwp-product-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 10px 0;
    }

    .cwp-product-row::-webkit-scrollbar {
        display: none;
    }

    .cwp-product-item {
        flex: 0 0 90%;
        width: 90%;
        margin: 0 10px;
        scroll-snap-align: center;
    }

    /* Add scroll indicators */
    .cwp-custom-woo-products {
        position: relative;
    }

    .cwp-custom-woo-products::before,
    .cwp-custom-woo-products::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 40px;
        z-index: 1;
        pointer-events: none;
    }

    .cwp-custom-woo-products::before {
        left: 0;
        background: linear-gradient(
            to right,
            rgba(249, 249, 249, 1),
            rgba(249, 249, 249, 0)
        );
    }

    .cwp-custom-woo-products::after {
        right: 0;
        background: linear-gradient(
            to left,
            rgba(249, 249, 249, 1),
            rgba(249, 249, 249, 0)
        );
    }
}

/* Additional responsive adjustments */
@media (max-width: 768px) {
    .cwp-tabs-container {
        flex-direction: row;
        padding: 0 10px;
        position: relative;
    }

    .cwp-view-all {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

    .cwp-category-desc {
        padding: 0 15px;
        font-size: 13px;
    }

    .cwp-product-title {
        font-size: 14px;
    }

    .cwp-product-price {
        font-size: 16px;
    }
}

/* Touch-friendly improvements */
@media (max-width: 1024px) {
    .cwp-product-item {
       touch-action: auto;
    }

    .cwp-add-to-cart .button {
        padding: 12px 24px; /* Larger touch target */
        font-size: 16px;
    }
}
.cwp-product-row,
.cwp-category-tabs {
    scroll-behavior: smooth;
}
/* Add loading state for AJAX transitions */
.cwp-custom-woo-products.loading {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.loading {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: loading-spinner 0.6s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes loading-spinner {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
/* Add loading animation styles */
#wc-ajax-products-grid.loading {
    opacity: 0.5;
    position: relative;
}

#wc-ajax-products-grid.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.woo-filter-widget {
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
}

.filter-title {
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filter-content {
    display: block !important; /* Always show content */
}

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

.brand-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
}

.brand-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

.brand-name {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.brand-count {
    color: #666;
    font-size: 0.9em;
}

.hidden-brand {
    display: none;
}

.show-more-wrapper {
    padding: 10px 0;
}

.show-more-brands {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 5px 0;
    font-size: 0.9em;
}

.show-more-brands:hover {
    text-decoration: underline;
}

/* Tablet specific styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .cwp-product-row {
        display: flex !important;
        grid-template-columns: none;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0 15px;
        gap: 20px;
        -webkit-overflow-scrolling: touch;
        cursor: grab;
        touch-action: pan-x pan-y;
    }

    .cwp-product-item {
        flex: 0 0 45%;
        min-width: 45%;
        margin: 0;
        scroll-snap-align: center;
    }

    /* Remove scroll indicators for tablet */
    .cwp-custom-woo-products::before,
    .cwp-custom-woo-products::after {
        display: none;
    }
}

/* Larger tablet styles (1024px and up) */
@media (min-width: 1024px) {
    .cwp-product-row {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        padding: 0 15px;
    }
}

/* Mobile styles (up to 767px) */
@media (max-width: 767px) {
    .cwp-tabs-container {
        flex-direction: column;
        padding: 0 15px;
    }

    .cwp-category-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        margin-bottom: 15px;
        -webkit-overflow-scrolling: touch;
    }

    .cwp-view-all {
        width: 100%;
        text-align: center;
        padding: 10px;
        margin-top: 35px;
    }
    .cwp-category-tabs-desc {
        margin-top: 35px;
    }

    .cwp-product-row {
        display: flex !important;
        grid-template-columns: none;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0 15px;
        gap: 15px;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        cursor: grab;
        touch-action: pan-x pan-y;
    }

    .cwp-product-item {
        flex: 0 0 85%;
        min-width: 85%;
        scroll-snap-align: center;
        margin: 0;
    }
}

/* Additional improvements */
.cwp-product-row {
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    z-index: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.cwp-product-row::-webkit-scrollbar {
    display: none;
}

.cwp-product-item {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
        touch-action: auto;
}
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay span {
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

#wc-ajax-products-grid {
    position: relative;
    min-height: 200px;
}

/* Category page specific styles */
.cwp-category-view .cwp-category-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0;
    overflow-x: visible;
    scroll-snap-type: none;
}

.cwp-category-view .cwp-product-item {
    width: 100%;
    margin: 0;
    scroll-snap-align: unset;
}

/* Maintain original horizontal scroll for non-category pages */
@media (max-width: 1024px) {
    .cwp-product-row:not(.cwp-category-grid) {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0;
        gap: 10px;
        scroll-padding: 20px;
    }

    .cwp-product-row:not(.cwp-category-grid) .cwp-product-item {
        flex: 0 0 80%;
        width: 80%;
        margin: 0;
        scroll-snap-align: center;
    }

    .cwp-custom-woo-products:not(.cwp-category-view) {
        padding: 20px 10px;
        overflow-x: hidden;
    }

    .cwp-product-row:not(.cwp-category-grid) {
        margin: 0 -10px;
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    .cwp-product-row:not(.cwp-category-grid) .cwp-product-item {
        flex: 0 0 85%;
        width: 85%;
    }
}

/* Responsive adjustments for category view */
@media (max-width: 768px) {
    .cwp-category-view .cwp-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .cwp-product-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.woo-filter-modal.active .woo-filter-modal-content {
    transform: translateY(0);
}

.woo-filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.woo-filter-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.woo-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

/* Prevent body scroll when modal is open */
body.filter-modal-open {
    overflow: hidden;
}

/* Scrollbar styles for the modal */
.woo-filter-modal-body {
    -webkit-overflow-scrolling: touch;
}

.woo-filter-modal-body::-webkit-scrollbar {
    width: 8px;
}

.woo-filter-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.woo-filter-modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.woo-filter-modal.loading .woo-filter-modal-content {
    opacity: 0.6;
    pointer-events: none;
}

.woo-filter-modal.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3bafda;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* Remove the condition for category grid */
@media (max-width: 1024px) {
    .cwp-product-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    .cwp-product-item {
        width: 100%;
        margin: 0;
        scroll-snap-align: unset;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cwp-product-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .cwp-product-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
