/**
 * Home Sidebar Styling
 * Matches Original Electro Theme Design
 */

/* Sidebar Container */
#sidebar.sidebar {
    width: 100%;
    padding-left: 30px;
    margin-bottom: 50px;
    margin-top: 50px;
}

/* Widget Styling - Match Electro Original */
.sidebar .widget {
    margin-bottom: 5.143em; /* Original Electro value */
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

/* Widget Title - Match Electro Original */
.sidebar .widget .widget-title {
    font-size: 1.357em;
    line-height: 0.947em;
    margin-bottom: 1.842em;
    padding-bottom: 1.053em;
    position: relative;
    border-bottom: 1px solid #dddddd;
    font-weight: normal;
}

.sidebar .widget .widget-title::after {
    content: ' ';
    width: 3.684em;
    border-bottom: 2px solid #2563eb; /* Primary color */
    display: block;
    position: absolute;
    bottom: -1px;
}

/* Product Categories Widget - Match Electro Original */
.widget_product_categories ul {
    list-style: none;
}

.widget_product_categories .product-categories,
.widget_product_categories .widget-title + ul {
    padding: 0 !important;
    margin: 0;
    border: 2px solid #dddddd;
    border-radius: 6px;
}

.widget_product_categories ul li {
    border-top: 1px solid #dddddd;
}

.widget_product_categories ul li:first-child {
    border: none;
}

.widget_product_categories .cat-item > a,
.widget_product_categories .cat-item > span {
    padding: 0.571em 0 0.643em 0;
    display: inline-block;
}

.widget_product_categories .cat-item a {
    color: #333e48;
    text-decoration: none;
    padding: 0.571em 2.143em 0.643em 2.143em;
    display: block;
    position: relative;
}

.widget_product_categories .cat-item a:hover {
    color: #2563eb;
}

.widget_product_categories .cat-item .count {
    float: right;
    font-size: 0.857em;
    color: #8f8f8f;
}

/* Product List Widget - Match Electro Original */
.widget_products ul.product_list_widget {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_products .product_list_widget li {
    margin-bottom: 1.35em; /* Original Electro value */
    display: block;
    clear: both;
}

.widget_products .product_list_widget li:last-child {
    margin-bottom: 0;
}

.widget_products .product_list_widget li a {
    display: block;
    text-decoration: none;
    color: #333e48;
}

.widget_products .product_list_widget li a:hover .product-title {
    color: #2563eb;
}

/* Images - 75px x 75px (Original Electro) */
.widget_products .product_list_widget li img {
    width: 75px;
    height: 75px;
    margin-right: 20px;
    float: left;
    object-fit: cover;
}

.widget_products .product_list_widget li .product-title {
    color: #333e48;
    font-weight: bold;
    font-size: 1em;
    display: block;
    line-height: 1.2em;
    margin-bottom: 0;
}

/* Star Rating - Match Electro Original */
.widget_products .star-rating {
    width: 5.2em;
    height: 1em;
    position: relative;
    font-size: 1em;
    margin: 8px 0;
    margin-left: 95px; /* 75px image + 20px margin */
}

.widget_products .star-rating::before {
    content: "★★★★★";
    color: #dddddd;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.widget_products .star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
}

.widget_products .star-rating span::before {
    content: "★★★★★";
    top: 0;
    position: absolute;
    left: 0;
    color: #fed700; /* Yellow for stars */
}

/* Price - Match Electro Original */
.widget_products .electro-price,
.widget_products .price {
    margin-top: 0;
    display: block;
    margin-left: 95px; /* 75px image + 20px margin */
    font-size: 1em;
}

.widget_products .star-rating + .electro-price,
.widget_products .star-rating + .price {
    margin-top: 0;
}

.widget_products .price .amount {
    display: inline-block;
    font-size: 1.071em;
    font-weight: bold;
}

.widget_products .price del {
    color: #8f8f8f;
    display: block;
    width: 100%;
    float: left;
}

.widget_products .price del .amount {
    font-size: 0.928em;
    text-decoration: line-through;
    font-weight: normal;
}

.widget_products .price ins {
    text-decoration: none;
    display: block;
    float: left;
}

.widget_products .price ins .amount {
    color: #dc3545; /* Danger color for sale price */
    font-weight: bold;
    font-size: 1.071em;
}

/* Layout Wrapper */
.home-layout-wrapper {
    display: block;
}

/* Responsive Styles */

/* Large screens - show sidebar with proper layout */
@media (min-width: 992px) {
    /* Container for content + sidebar */
    .home-layout-wrapper {
        display: flex;
        flex-wrap: nowrap;
        gap: 30px;
        align-items: flex-start;
    }
    
    /* Main content area - 75% width */
    .home-layout-wrapper .content-area {
        width: 75%;
        flex: 0 0 75%;
        max-width: 75%;
        overflow-x: hidden;
        position: relative;
        z-index: 1;
    }
    
    /* Sidebar - 25% width */
    .home-layout-wrapper #sidebar.sidebar {
        width: 25%;
        flex: 0 0 25%;
        max-width: 25%;
        padding-left: 0;
        position: relative;
        z-index: 2;
    }
    
    /* Ensure all carousel sections stay within content area */
    .home-layout-wrapper .content-area section,
    .home-layout-wrapper .content-area .section-products-carousel,
    .home-layout-wrapper .content-area .section-product-cards-carousel {
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* Medium screens - Force hide sidebar */
@media (max-width: 991px) {
    /* Comprehensive sidebar hide */
    #sidebar,
    #sidebar.sidebar,
    .sidebar,
    .sidebar-home,
    aside#sidebar,
    aside.sidebar {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Content full width */
    .content-area,
    .home-layout-wrapper .content-area {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    .home-layout-wrapper {
        display: block !important;
    }
}

/* Clear floats */
.content-area::after,
#sidebar::after {
    content: "";
    display: table;
    clear: both;
}

/* Clear fix for product list items */
.product_list_widget > li::after {
    content: "";
    display: table;
    clear: both;
}

/* Added to cart animation */
.product-inner.added-to-cart {
    animation: pulseGreen 0.6s ease-in-out;
}

@keyframes pulseGreen {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}
