/* Frontend styles for the Orchid Store Extension plugin */
/* Ensure consistency with the Orchid Store theme */

.product-entry {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.product-entry .woocommerce {
    width: 100%;
}

.product-entry .item {
    margin: 10px;
    flex: 1 1 calc(25% - 20px); /* 4 columns */
}

@media (max-width: 768px) {
    .product-entry .item {
        flex: 1 1 calc(50% - 20px); /* 2 columns */
    }
}

@media (max-width: 480px) {
    .product-entry .item {
        flex: 1 1 100%; /* full width on mobile */
    }
}

/* OS5 widget specific styles */
.product-widget-os5 .section-title{position:relative;padding-bottom:10px}
.product-widget-os5 .section-title .os-view-all{position:absolute;right:0;top:0;background:#3498db;color:#fff;padding:6px 12px;border-radius:3px;text-decoration:none;font-size:13px}
.product-widget-os5 .section-title .os-view-all:hover{opacity:.9}

/* 5 column grid */
.woocommerce.columns-5 ul.products > li.product{width:20%;box-sizing:border-box;padding:10px}
@media (max-width: 1024px){.woocommerce.columns-5 ul.products > li.product{width:33.333%}} /* 3 col on tablet */
@media (max-width: 768px){.woocommerce.columns-5 ul.products > li.product{width:50%}} /* 2 col on small tablet */
@media (max-width: 480px){.woocommerce.columns-5 ul.products > li.product{width:100%}} /* 1 col on mobile */

/* Sale percentage badge */
.product-widget-os5 .onsale{background:#e74c3c;color:#fff;padding:6px 8px;border-radius:50px;font-weight:700;display:inline-block}

/* Banner styles */
.product-widget-os5 .os5-banner {
    width: 100%;
    position: relative;
    overflow: hidden;
    margin: 0 0 20px;
}

.product-widget-os5 .os5-banner-image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.product-widget-os5 .os5-banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-widget-os5 .os5-banner-link:hover .os5-banner-image {
    transform: scale(1.05);
}

/* small adjustment to product card */
.product-widget-os5 ul.products li.product .woocommerce-LoopProduct-link{display:block}

/* OS5 Featured Categories Widget Styles */
.os5-cats-widget .os-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

/* Column configurations */
.os5-cats-widget .os-row[data-desktop-cols="1"] .os-col { flex: 0 0 100%; max-width: 100%; }
.os5-cats-widget .os-row[data-desktop-cols="2"] .os-col { flex: 0 0 50%; max-width: 50%; }
.os5-cats-widget .os-row[data-desktop-cols="3"] .os-col { flex: 0 0 33.333333%; max-width: 33.333333%; }
.os5-cats-widget .os-row[data-desktop-cols="4"] .os-col { flex: 0 0 25%; max-width: 25%; }
.os5-cats-widget .os-row[data-desktop-cols="5"] .os-col { flex: 0 0 20%; max-width: 20%; }
.os5-cats-widget .os-row[data-desktop-cols="6"] .os-col { flex: 0 0 16.666667%; max-width: 16.666667%; }
.os5-cats-widget .os-row[data-desktop-cols="4"] .os-col>.card>.box .right{ padding: 15px;}
.os5-cats-widget .os-row[data-desktop-cols="5"] .os-col>.card>.box .right{ padding: 7px;}
.os5-cats-widget .os-row[data-desktop-cols="6"] .os-col>.card>.box .right{ padding: 5px;}
.os5-cats-widget .os-row[data-desktop-cols="4"] .os-col>.card{ padding: 15px;}
.os5-cats-widget .os-row[data-desktop-cols="5"] .os-col>.card{ padding: 7px;}
.os5-cats-widget .os-row[data-desktop-cols="6"] .os-col>.card{ padding: 5px;}
.os5-cats-widget .os-row[data-desktop-cols="4"] .os-col>.card>.box>.left{ max-width: 80px;flex: 0 0 80px;}
.os5-cats-widget .os-row[data-desktop-cols="5"] .os-col>.card>.box>.left{ max-width: 60px; flex: 0 0 60px;}
.os5-cats-widget .os-row[data-desktop-cols="6"] .os-col>.card>.box>.left{ max-width: 50px;flex: 0 0 50px;}
.os5-cats-widget .os-col {
    padding: 5px;
    box-sizing: border-box;
}

/* Card design to match original */
.os5-cats-widget .card {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    border-radius: 3px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.os5-cats-widget .box {
    display: flex;
    align-items: center;
    flex: 1;
}

.os5-cats-widget .left {
    flex-shrink: 0;
}

.os5-cats-widget .right {
    flex: 1;
    min-width: 0;
}

.os5-cats-widget .thumb {
    width: 100%;
    position: relative;
}

.os5-cats-widget .thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.os5-cats-widget .title h3 {
    margin: 0;
    font-size: 1em;
    font-weight: 700;
}

.os5-cats-widget .product-numbers {
    font-size: 0.85em;
}

.os5-cats-widget .product-numbers p {
    margin: 0;
}

/* Tablet Layout */
@media screen and (max-width: 992px) {
    .os5-cats-widget .os-row[data-tablet-cols="1"] .os-col { flex: 0 0 100%; max-width: 100%; }
    .os5-cats-widget .os-row[data-tablet-cols="2"] .os-col { flex: 0 0 50%; max-width: 50%; }
    .os5-cats-widget .os-row[data-tablet-cols="3"] .os-col { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .os5-cats-widget .os-row[data-tablet-cols="4"] .os-col { flex: 0 0 25%; max-width: 25%; }
    
    /* Last item in odd-numbered rows spans full width */
    .os5-cats-widget .os-row[data-tablet-cols="2"] .os-col:last-child:nth-child(2n+1) {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .os5-cats-widget .os-row[data-tablet-cols="2"] .os-col:last-child:nth-child(2n+1) .box {
        max-width: 50%;
        margin: 0 auto;
    }
}

/* Mobile Layout */
@media screen and (max-width: 576px) {
    .os5-cats-widget .os-row[data-mobile-cols="1"] .os-col { 
        flex: 0 0 100%;
        max-width: 100%;
    }
    .os5-cats-widget .os-row[data-mobile-cols="2"] .os-col { 
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .os5-cats-widget .os-row[data-mobile-cols="1"] .os-col .box {
        max-width: 300px;
        /* margin: 0 auto; */
    }
}

/* Owl Carousel Slider Styles */
.os5-slider-widget .owl-carousel .item {
    padding: 0px;
}

.os5-slider-widget .owl-carousel .thumb {
    background-size: cover;
    background-position: center;
    height: 300px;
    position: relative;
}

.os5-slider-widget .owl-carousel .mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}

.os5-slider-widget .owl-carousel .item-entry {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    text-align: left;
    width: 80%;
    z-index: 5;
}

.os5-slider-widget .owl-carousel .excerpt {
    display: block;
}

/* Content Location Styles for OS5 Slider Widget */
.os5-slider-widget .content-holder {
    display: flex;
    align-items: flex-start; /* Default to top */
    justify-content: flex-start; /* Default to left */
    height: 100%; /* Ensure content holder takes full height of slide */
    width: 100%;
    position: relative; /* For absolute positioning of item-entry */
}

.os5-slider-widget .content-holder .item-entry {
    position: absolute; /* Override previous absolute positioning */
    width: 80%; /* Keep original width */
    padding: 20px; /* Add some padding */
    box-sizing: border-box; /* Include padding in width */
}

.os5-slider-widget .os-slider-content-left-top .item-entry {
    top: 20px;
    left: 20px;
    bottom: auto;
    right: auto;
    text-align: left;
}

.os5-slider-widget .os-slider-content-left-bottom .item-entry {
    bottom: 20px;
    left: 20px;
    top: auto;
    right: auto;
    text-align: left;
}

.os5-slider-widget .os-slider-content-center .item-entry {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%; /* Adjust width for centering */
}

/* OS5 Blog Post Slider Widget Styles */
.os-blog-slider-widget .owl-carousel .item {
    /* Spacing is now controlled by margin in JS */
}

.os-blog-slider-widget .card {
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    border-radius: 3px;
    overflow: hidden;
    height: 100%;
}

.os-blog-slider-widget .thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.os-blog-slider-widget .card-content {
    padding: 15px;
}

.os-blog-slider-widget .title h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.os-blog-slider-widget .title h3 a {
    text-decoration: none;
    color: inherit;
}

.os-blog-slider-widget .entry-metas ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: #777;
}

.os-blog-slider-widget .entry-metas ul li {
    margin-right: 15px;
}

.os-blog-slider-widget .entry-metas ul li:last-child {
    margin-right: 0;
}

.os-blog-slider-widget .post-categories {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
}

.os-blog-slider-widget .post-categories a {
    background-color: #3498db;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    text-decoration: none;
    margin-right: 5px;
}

.os-blog-slider-widget .post-categories a:hover {
    background-color: #2980b9;
}

.os-blog-slider-widget .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.os-blog-slider-widget .section-title .os-view-all {
    /* The flex properties on the parent handle alignment */
}

.os-blog-slider-widget .owl-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.os-blog-slider-widget .owl-nav button {
    pointer-events: all;
    background: rgba(0,0,0,0.5) !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    line-height: 40px !important;
    text-align: center;
    font-size: 20px !important;
}

.os-blog-slider-widget .owl-nav .owl-prev {
    margin-left: -20px;
}

.os-blog-slider-widget .owl-nav .owl-next {
    margin-right: -20px;
}

/* Responsive fixes for blog slider */
.os-blog-slider-widget .owl-carousel .owl-stage {
    display: flex;
}

.os-blog-slider-widget .owl-carousel .owl-item {
    display: flex;
}

.os-blog-slider-widget .owl-carousel .owl-item .item {
    width: 100%;
    flex: 1;
}



.os5-slider .owl-stage {
    display: flex;
    align-items: stretch;
}

.os5-slider .owl-item {
    display: flex;
    flex: 1 0 auto;
    height: 100%;
}

.os5-slide {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}


.os-blog-slider-widget .owl-nav {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.os-blog-slider-widget:hover .owl-nav {
    opacity: 1;
}
