/**
 * Custom CSS for WooCommerce Shop Layout
 */

/* Product Search Section - Full Width Centered */
.product-search-section {
    width: 100%;
    margin: 20px 0;
    text-align: center;
}

.product-search-section .woocommerce-product-search {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
}

.product-search-section .woocommerce-product-search .search-field {
    flex: 1;
    padding: 12px 15px;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    color: #4a4a4a;
}

.product-search-section .woocommerce-product-search button {
    padding: 12px 20px;
    background-color: #ff8c00;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.product-search-section .woocommerce-product-search button:hover {
    background-color: #ff6b35;
}

/* Horizontal Filters */
.horizontal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    align-items: center;
}

.filter-section {
    position: relative;
    margin-right: 15px;
}

/* Dropdown Filters */
.dropdown-filter {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.dropdown-trigger {
    background-color: white;
    border: 1px solid #e0e0e0;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 150px;
    color: #000000;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dropdown-trigger:hover {
    border-color: #ff8c00;
}

.dropdown-trigger:after {
    content: "▼";
    font-size: 10px;
    margin-left: 10px;
    color: #ff8c00;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 250px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    z-index: 20;
    border-radius: 4px;
    padding: 15px;
    margin-top: 5px;
    border: 1px solid #e0e0e0;
    left: 0;
}

/* Price Range Slider */
.price-slider-container {
    width: 100%;
    padding: 10px 0;
}

.price-slider {
    height: 5px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin: 20px 0;
    position: relative;
}

.price-slider .ui-slider-range {
    height: 5px;
    background-color: #ff8c00;
    border-radius: 5px;
    position: absolute;
}

.price-slider .ui-slider-handle {
    width: 18px;
    height: 18px;
    background-color: white;
    border: 2px solid #ff8c00;
    border-radius: 50%;
    position: absolute;
    top: -7px;
    margin-left: -9px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: border-color 0.2s ease;
    z-index: 10;
}

.price-slider .ui-slider-handle:hover,
.price-slider .ui-slider-handle:active {
    border-color: #ff6b35;
    transform: scale(1.1);
}

.price-slider-values {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #4a4a4a;
    font-weight: bold;
    margin-bottom: 10px;
}

.price-filter-form {
    margin-top: 15px;
}

.price-filter-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.filter-button {
    flex: 1;
    padding: 10px;
    background-color: #ff8c00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.filter-button:hover {
    background-color: #ff6b35;
}

.clear-filters-button {
    padding: 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    transition: background-color 0.3s ease;
    flex: 1;
}

.clear-filters-button:hover {
    background-color: #d32f2f;
}

.price-range-hint {
    color: #777;
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Category List and Toggle Styles */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.parent-category-item {
    position: relative;
    margin-bottom: 10px;
}

.parent-category-link {
    display: block;
    padding: 8px 0;
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.parent-category-link:hover, 
.parent-category-link.active {
    color: #ff8c00;
}

.parent-category-link .count {
    color: #777;
    font-size: 12px;
    font-weight: normal;
    margin-left: 5px;
}

/* Fixed category toggle icons */
.category-toggle {
    position: absolute;
    right: 0;
    top: 8px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    text-align: center;
    line-height: 22px;
    border-radius: 50%;
    /* background-color: #f5f5f5; */
    transition: all 0.2s ease;
    font-size: 0; /* Hide any text content */
    text-indent: -9999px; /* Hide any text content */
    overflow: hidden; /* Hide any content */
}

/* Remove arrow icon content */
.category-toggle:before {
    content: '';  /* Empty content - no arrow */
    display: block;
}


.subcategory-list {
    list-style: none;
    padding: 0 0 0 15px;
    margin: 5px 0 10px;
    border-left: 1px solid #e0e0e0;
}

.child-category-item {
    margin-bottom: 5px;
}

.child-category-link {
    display: block;
    padding: 5px 0;
    color: #4a4a4a;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.child-category-link:hover,
.child-category-link.active {
    color: #ff8c00;
}

.child-category-link .count {
    color: #777;
    font-size: 12px;
    font-weight: normal;
    margin-left: 5px;
}

/* Attribute List */
.attribute-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
}

.attribute-item {
    margin-bottom: 10px;
}

.attribute-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #4a4a4a;
    transition: color 0.2s ease;
}

.attribute-label:hover {
    color: #000000;
}

.attribute-checkbox {
    margin-right: 10px;
    accent-color: #ff8c00;
}

.attribute-label .count {
    margin-left: 5px;
    color: #777;
    font-size: 12px;
}

.apply-attribute-filter {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background-color: #ff8c00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.apply-attribute-filter:hover {
    background-color: #ff6b35;
}

/* Full Width Products */
.full-width-products {
    width: 100%;
    margin-top: 30px;
}

.full-width-products ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.full-width-products ul.products li.product {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.full-width-products ul.products li.product:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.full-width-products ul.products li.product .woocommerce-loop-product__title {
    font-size: 18px;
    font-weight: bold;
    margin-top: 15px;
    color: #000000;
    transition: color 0.3s ease;
}

.full-width-products ul.products li.product .woocommerce-loop-product__title:hover {
    color: #ff8c00;
}

.full-width-products ul.products li.product .price {
    color: #ff8c00;
    font-weight: bold;
    font-size: 18px;
    margin: 10px 0;
}

.full-width-products ul.products li.product .button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background-color: #ff8c00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.full-width-products ul.products li.product .button:hover {
    background-color: #ff6b35;
    color: #ffffff;
}

/* Shop Info (Results Count) */
.shop-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce-result-count {
    margin: 0;
    font-size: 14px;
    color: #4a4a4a;
}

/* WooCommerce Ordering Dropdown */
.woocommerce-ordering {
    margin-bottom: 0;
}

.woocommerce-ordering select {
    padding: 10px 35px 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: white;
    color: #000000;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8c00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.woocommerce-ordering select:hover {
    border-color: #ff8c00;
}

/* Custom Scrollbar for attribute lists */
.attribute-list::-webkit-scrollbar {
    width: 8px;
}

.attribute-list::-webkit-scrollbar-track {
    background-color: #f5f5f5;
    border-radius: 4px;
}

.attribute-list::-webkit-scrollbar-thumb {
    background-color: #e0e0e0;
    border-radius: 4px;
}

.attribute-list::-webkit-scrollbar-thumb:hover {
    background-color: #d0d0d0;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .horizontal-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .filter-section {
        width: 100%;
        margin-right: 0;
    }
    
    .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-content {
        width: 100%;
        position: relative;
        margin-top: 5px;
    }
    
    .full-width-products ul.products {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    /* Mobile category toggle adjustments */
    .category-toggle {
        width: 30px;
        height: 30px;
        line-height: 28px;
        top: 5px;
    }
}

@media (max-width: 767px) {
    .product-search-section .woocommerce-product-search {
        flex-direction: column;
    }
    
    .product-search-section .woocommerce-product-search .search-field {
        border-radius: 4px 4px 0 0;
    }
    
    .product-search-section .woocommerce-product-search button {
        border-radius: 0 0 4px 4px;
    }
    
    .full-width-products ul.products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Add two-column shop layout */
.shop-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
}

.sidebar-filters {
    width: 250px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-width: 0; /* Ensures proper flexbox behavior */
}

/* Filter block styles */
.filter-block {
    margin-bottom: 25px;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.filter-title {
    padding: 12px 15px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.filter-content {
    padding: 15px;
}

/* Preserve existing styles */
.horizontal-filters {
    display: none; /* Hide the original horizontal filters */
}

/* Responsive layout */
@media (max-width: 991px) {
    .shop-layout {
        flex-direction: column-reverse;

    }
    
    .sidebar-filters {
        width: 100%;
        order: 2;
    }
    
    .main-content {
        width: 100%;
        order: 1;
    }
    
    /* Other responsive styles */
    .filter-section {
        margin-bottom: 15px;
    }
}

/* Product Card Styles */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.product-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-header {
    margin-bottom: 10px;
}

/* Product Title with Fixed Height */
.woocommerce-loop-product__title {
    font-size: 16px !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    font-weight: 600 !important;
    color: #333 !important;
    height: 48px; /* Fixed height */
    line-height: 1.5;
    white-space: normal; /* Allow wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ellipsis for overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    max-width: 100%; /* Contain within parent */
}

/* Single Product Page Title */
.woocommerce div.product .product_title {
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* Cart and Checkout Pages */
.cart-page .columns,
.checkout-page .columns {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.cart-page .column,
.checkout-page .column {
    padding: 0 15px;
    flex: 0 0 auto;
}

.cart-page .column.is-8,
.checkout-page .column.is-8 {
    width: 66.6667%;
}

.cart-page .column.is-4,
.checkout-page .column.is-4 {
    width: 33.3333%;
}

.order-details-box {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
}

.order-details-box h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-page .cart_totals,
.checkout-page .woocommerce-checkout-review-order-table {
    width: 100%;
    margin-bottom: 20px;
}

.cart-page .cart_totals th,
.cart-page .cart_totals td,
.checkout-page .woocommerce-checkout-review-order-table th,
.checkout-page .woocommerce-checkout-review-order-table td {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.cart-page .cart_totals tr:last-child th,
.cart-page .cart_totals tr:last-child td,
.checkout-page .woocommerce-checkout-review-order-table tr:last-child th,
.checkout-page .woocommerce-checkout-review-order-table tr:last-child td {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-page .wc-proceed-to-checkout,
.checkout-page #place_order {
    width: 100%;
}

.cart-page .wc-proceed-to-checkout .button,
.checkout-page #place_order {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #ff8c00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cart-page .wc-proceed-to-checkout .button:hover,
.checkout-page #place_order:hover {
    background-color: #ff6b35;
}

/* Responsive styles */
@media (max-width: 768px) {
    .cart-page .column.is-8,
    .cart-page .column.is-4,
    .checkout-page .column.is-8,
    .checkout-page .column.is-4 {
        width: 100%;
    }
    
    .order-details-box {
        margin-top: 30px;
        position: static;
    }
} 