/**
 * Shop Page Styles
 */

/* General Styles */
.shop-page {
    font-family: 'Inter', sans-serif;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Shop Header */
.shop-header {
    background-color: #2A6478;
    padding: 40px 0 40px;
    text-align: center;
    width: 100%;
    color: white;
    margin-bottom: 0;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) .woocommerce-breadcrumb {
    color: #f8f9fa;
    font-size: 0.9rem;
}

.woocommerce-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #f8f9fa;
}

.woocommerce-breadcrumb a {
    color: #f8f9fa !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.shop-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.shop-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Shop Search */
.shop-search-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.ajax-search {
    position: relative;
    max-width: 600px;
    width: 100%;
}

.ajax-search input[type="search"] {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.3s ease;
}

.ajax-search input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.ajax-search input[type="search"]:focus {
    background-color: rgba(255, 255, 255, 0.25);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.ajax-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    width: 40px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    text-align: left;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.search-result-price {
    color: #2A6478;
    font-weight: 600;
}

.search-result-description {
    color: #666;
    font-size: 0.85rem;
    margin-top: 4px;
    line-height: 1.4;
}

/* Hide WooCommerce result count */
.woocommerce-result-count {
    display: none !important;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #666;
}

/* Updated site-content to be full width */
.site-content {
    padding: 40px 0;
    max-width: 1350px;
    margin: 0 auto;
}

/* For WooCommerce pages specifically */
.post-type-archive-product .site-content {
    width: 100%;
    max-width: 100%;
}

/* The container inside site-content remains at 1350px max-width */
.post-type-archive-product .site-content .container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Shop Filters */
.shop-filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center !important;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.shop-sorting {
    display: flex;
    align-items: center !important;
    gap: 15px;
    flex-wrap: wrap;
}

.shop-filters {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Tag Filter Styles */
.tag-filter-container {
    position: relative;
    min-width: 200px;
    margin-left: 15px;
}

/* Make Select2 match orderby styling */
.select2-container .select2-selection--multiple {
    appearance: none;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 4px 15px;
    padding-right: 30px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    min-height: 38px;
}

.select2-container--default .select2-selection--multiple {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    outline: none;
    border-color: #2A6478;
    box-shadow: 0 0 0 2px rgba(42, 100, 120, 0.1);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #2A6478;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 2px 10px 2px 25px !important;
    margin: 3px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-right: 5px;
    padding-right: 5px !important;
    position: absolute;
    left: 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #f0f0f0;
    background: none;
}

.select2-dropdown {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 9999;
}

.select2-search--dropdown {
    padding: 10px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
}

.select2-results__option {
    padding: 8px 15px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #2A6478;
}

/* Orderby Select */
.orderby {
    appearance: none;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 8px 15px;
    padding-right: 30px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.orderby:focus {
    outline: none;
    border-color: #2A6478;
    box-shadow: 0 0 0 2px rgba(42, 100, 120, 0.1);
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 10px;
}

.view-switcher button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: color 0.3s ease;
}

.view-switcher button.active {
    color: #2A6478;
}

/* Product Grid */
.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Grid columns based on customizer settings */
.products.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.products.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.products.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.products.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.products.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Hide elements in grid view that are only for list view */
.product-excerpt,
.product-bottom,
.product-side {
    display: none;
}

/* List View Styles */
.products.view-list {
    grid-template-columns: 1fr;
}

.view-list .product-excerpt {
    display: block !important;
    margin: 15px 0;
    color: #555;
    line-height: 1.6;
}

.view-list .product-bottom {
    display: flex !important;
}

.view-list .product-side {
    display: block !important;
}

.view-list .custom-product-card {
    padding: 30px;
    position: relative;
}

.view-list .product-inner {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.view-list .product-image {
    width: 25%;
    flex: 0 0 25%;
    padding-top: 0;
    height: 250px;
    margin-right: 0;
    position: relative;
}

.view-list .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.view-list .product-details {
    width: 50%;
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 30px;
}

.view-list .product-side {
    width: 25%;
    flex: 0 0 25%;
    display: flex;
    flex-direction: column;
    padding-left: 15px;
}

.view-list .product-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.view-list .category-name {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.view-list .product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.view-list .product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.view-list .stock-quantity {
    display: inline-flex;
    align-items: center;
    color: #2a6478;
    font-size: 0.85rem;
    background-color: rgba(42, 100, 120, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.view-list .stock-quantity::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #2a6478;
    border-radius: 50%;
    margin-right: 8px;
}

.view-list .product-action {
    display: flex;
    gap: 10px;
}

.view-list .add-to-cart-btn {
    background-color: #2A6478;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-list .add-to-cart-btn:hover {
    background-color: #1a4a5a;
    transform: translateY(-2px);
}

.view-list .quick-view-btn {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-list .quick-view-btn:hover {
    background-color: #e9e9e9;
}

/* Move elements to side column in list view */
.view-list .wc-product-tags,
.view-list .shipping-restrictions {
    position: static;
    margin-bottom: 20px;
}

.view-list .wc-product-tags {
    position: static;
    padding: 0;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.view-list .wc-product-tags h4 {
    margin-bottom: 8px;
}

.view-list .wc-product-tag {
    margin-bottom: 5px;
    display: inline-block;
}

.view-list .shipping-restrictions {
    background-color: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* Responsive styles for list view */
@media (max-width: 991px) {
    .view-list .product-inner {
        flex-wrap: wrap;
    }
    
    .view-list .product-image {
        width: 30%;
        flex: 0 0 30%;
    }
    
    .view-list .product-details {
        width: 70%;
        flex: 0 0 70%;
        padding: 0 0 0 20px;
    }
    
    .view-list .product-side {
        width: 100%;
        flex: 0 0 100%;
        padding: 20px 0 0 0;
        border-top: 1px solid #eee;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .view-list .product-inner {
        flex-direction: column;
    }
    
    .view-list .product-image {
        width: 100%;
        flex: 0 0 100%;
        height: auto;
        padding-top: 80%;
        margin-bottom: 20px;
    }
    
    .view-list .product-details {
        width: 100%;
        flex: 0 0 100%;
        padding: 0;
    }
    
    .view-list .product-side {
        width: 100%;
        flex: 0 0 100%;
        padding: 20px 0 0 0;
    }
    
    .view-list .product-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Product Card */
.custom-product-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    padding: 0;
    margin-bottom: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.custom-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-card-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Product Image */
.product-card-image {
    position: relative;
    overflow: hidden;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background-color: #f8f9fa;
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.product-card-image .hover-image {
    opacity: 0;
}

.custom-product-card:hover .product-card-image .main-image {
    opacity: 0;
}

.custom-product-card:hover .product-card-image .hover-image {
    opacity: 1;
}

/* Product Details */
.product-card-details {
    padding: 15px;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    justify-content: space-between;
}

.product-card-category {
    flex: 1 1 50%;
    max-width: 50%;
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.product-card-category a {
    color: #2A6478;
    font-weight: 500;
    text-decoration: none;
}

.product-card-shipping-restrictions {
    max-width: 50%;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.product-card-shipping-restrictions .shipping-truck-icon {
    width: 16px;
    height: 16px;
}

.product-card-shipping-restrictions .shipping-restriction-tag {
    background: #fff;
    color: #999;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    margin: 0 2px;
    border: 1px solid #999;
}

.product-card-shipping-restrictions .tooltip-text {
    margin-left: 8px;
    font-size: 0.85em;
    color: #888;
}

@media (max-width: 600px) {
    .product-card-row {
        flex-direction: column;
        gap: 4px;
    }
    .product-card-category,
    .product-card-shipping-restrictions {
        max-width: 100%;
        flex: 1 1 100%;
        justify-content: flex-start;
    }
    .product-card-shipping-restrictions {
        margin-top: 4px;
    }
}

/* Override conflicting styles */
.product-image, 
.product-details, 
.product-inner,
.product-title,
.category-name {
    /* Reset these styles to prevent conflicts */
    all: initial;
}

h2.product-card-title {
    margin: 0 0 8px 0;
}

h2.product-card-title a {
    font-size: 1.2rem;
    font-weight: 600;
    color: #E1723A;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

h2.product-card-title a:hover {
    color: #2A6478;
}

/* Ensure product tags are displayed correctly */
.wc-product-tags {
    /* position: absolute; */
    top: 10px;
    right: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 2;
    justify-content: flex-end;
    padding: 5px;
    border-radius: 4px;
}

.wc-product-tag {
    background-color: #2A6478;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive grid adjustments */
@media (max-width: 1024px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .products {
        grid-template-columns: 1fr;
    }
}

/* View Loading Indicator */
.view-loading {
    padding: 15px;
    background-color: rgba(42, 100, 120, 0.1);
    color: #2A6478;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    margin: 10px 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    min-width: 200px;
}

/* LIST VIEW SPECIFIC STYLES */
.list-product-card {
    background-color: rgb(250, 250, 250);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.list-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.list-product-inner {
    display: flex;
    flex-direction: row;
    width: 100%;
}

/* First Column */
.list-product-image {
    width: 25%;
    flex: 0 0 25%;
    position: relative;
    overflow: hidden;
}

.list-product-image a {
    display: block;
    height: 100%;
    width: 100%;
}

.list-product-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: opacity 0.3s ease;
}

.list-product-image .hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.list-product-card:hover .list-product-image .main-image {
    opacity: 0;
}

.list-product-card:hover .list-product-image .hover-image {
    opacity: 1;
}

/* Second Column */
.list-product-details {
    width: 50%;
    flex: 0 0 50%;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
}

.list-category-name {
    font-size: 0.85rem;
    color: #2A6478;
}

.list-category-name a {
    color: #2A6478;
    text-decoration: none;
}

.list-product-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.list-product-title a {
    color: #E1723A;
    text-decoration: none;
    transition: color 0.3s ease;
}

.list-product-title a:hover {
    color: #2A6478;
}

.list-product-description {
    color: #555;
    line-height: 1.6;
}

.list-product-actions {
    display: flex;
    flex-grow: 1;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.list-stock-quantity {
    display: inline-flex;
    align-items: center;
    color: #2a6478;
    font-size: 0.85rem;
    background-color: rgba(42, 100, 120, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.list-stock-quantity::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #2a6478;
    border-radius: 50%;
    margin-right: 8px;
}

.list-action-buttons {
    display: flex;
    gap: 10px;
}

.list-view-details-btn {
    background-color: #2A6478;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.list-view-details-btn:hover {
    background-color: #1a4a5a;
    transform: translateY(-2px);
}

/* Third Column */
.list-product-side {
    width: 25%;
    flex: 0 0 25%;
    padding-left: 15px;
    border-left: 1px solid #eee;
    position: relative;
}

.list-product-side h4 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.list-product-tags {
    margin-bottom: 25px;
    width: auto;
    display: block;
}

.list-shipping-restrictions {
    margin-bottom: 25px;
    width: 73%;
    display: block;
}

.list-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 77%;
}

.list-product-tag {
    display: inline-flex;
    background-color: white;
    color: #2A6478;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-right: 5px;
    margin-bottom: 5px;
    width: fit-content;
    white-space: nowrap;
}

.list-restrictions-container {
    background-color: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #eee;
    position: relative;
    z-index: 1;
    display: block;
}

.list-truck-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

.list-restriction-tag {
    display: inline-block;
    font-size: 0.85rem;
    color: #666;
    margin-right: 5px;
}

.list-tooltip {
    font-size: 0.8rem;
    color: #888;
    margin-top: 10px;
    font-style: italic;
}

/* Responsive List View */
@media (max-width: 991px) {
    .list-product-inner {
        flex-wrap: wrap;
    }
    
    .list-product-image {
        width: 30%;
        flex: 0 0 30%;
    }
    
    .list-product-details {
        width: 70%;
        flex: 0 0 70%;
        padding: 0 0 0 20px;
    }
    
    .list-product-side {
        width: 100%;
        flex: 0 0 100%;
        padding: 20px 0 0 0;
        border-left: none;
        border-top: 1px solid #eee;
        margin-top: 20px;
        position: relative;
    }
    
    .list-product-tags,
    .list-shipping-restrictions {
        width: 48%;
        display: inline-block;
        vertical-align: top;
    }
    
    .list-product-tags {
        margin-right: 4%;
    }
}

@media (max-width: 768px) {
    .list-product-inner {
        flex-direction: column;
    }
    
    .list-product-image {
        width: 100%;
        flex: 0 0 100%;
        margin-bottom: 20px;
    }
    
    .list-product-details {
        width: 100%;
        flex: 0 0 100%;
        padding: 0;
    }
    
    .list-product-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .list-product-tags,
    .list-shipping-restrictions {
        width: 100%;
        margin-right: 0;
    }
}

/* Make the #content element 100% width when it appears in WooCommerce pages */
body.woocommerce #content.site-content,
body.woocommerce-page #content.site-content,
body.tax-product_cat #content.site-content,
body.tax-product_tag #content.site-content {
    max-width: 100%;
    width: 100%;
}

/* Adjust shop sorting to accommodate tag filter */
@media (max-width: 768px) {
    .shop-sorting {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tag-filter-container {
        margin-left: 0;
        width: 100%;
        margin-top: 10px;
    }
    
    .select2-container {
        width: 100% !important;
    }
}

/* Additional styles to match Select2 with orderby */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0;
    line-height: 1.6;
}

.select2-container--default .select2-selection--multiple .select2-selection__arrow {
    height: 38px;
    position: absolute;
    top: 0;
    right: 10px;
    width: 20px;
}

/* Make Select2 container same size as orderby */
.woocommerce-ordering .select2-container {
    min-width: 200px;
}

/* Fix Select2 in woocommerce ordering context */
.tag-filter-container.woocommerce-ordering {
    margin: 0 0 0 15px;
}

/* Make select2 choices aligned */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Force Select2 to match orderby height */
.select2-container .select2-selection--multiple {
    height: 38px;
    overflow: hidden;
}

.select2-container--default.select2-container--open .select2-selection--multiple {
    overflow: visible;
    height: auto;
}

/* Match focus effect */
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #2A6478;
}

@media (max-width: 768px) {
    /* Additional mobile styles */
    .tag-filter-container.woocommerce-ordering {
        margin: 10px 0 0 0;
    }
}

/* Fix Select2 dropdown positioning */
.select2-container--open .select2-dropdown {
    position: absolute;
    z-index: 9999;
}

/* Fix positioning for selection container */
.select2-container {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
}

/* Force Select2 to match orderby height and style better */
.tag-filter-container.woocommerce-ordering .select2-container .select2-selection--multiple {
    height: 38px;
    overflow: hidden;
    appearance: none;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 0 30px 0 15px;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    min-height: 38px;
}

/* Fix selection layout */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
    margin: 4px 0;
    list-style: none;
    box-sizing: border-box;
    line-height: 1.5;
}

/* Fix height when dropdown is open */
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-radius: 50px;
    overflow: visible;
    height: auto;
    min-height: 38px;
}

/* Fix dropdown position - ensure it appears below the select */
.select2-container--default .select2-results {
    position: relative;
    max-height: 200px;
    overflow-y: auto;
}

/* Make dropdown alignment better with parent */
.tag-filter-container.woocommerce-ordering .select2-container--open .select2-dropdown {
    margin-top: 0;
    top: 100%;
    left: 0;
}

/* Fix dropdown placement in page */
.select2-container--default .select2-results > .select2-results__options {
    max-height: 200px;
    overflow-y: auto;
    position: relative;
}

/* Ensure dropdown stays connected to parent */
.select2-dropdown {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 9999;
    width: 100%;
}

/* Fix dropdown positioning that appears too far below */
.tag-filter-container.woocommerce-ordering .select2-container--open .select2-dropdown {
    margin-top: 0;
    top: 100%;
    left: 0;
}

/* Force absolute positioning to work correctly */
.tag-filter-container.woocommerce-ordering {
    position: relative;
}

/* Override default select2 dropdown positioning */
.select2-container--open .select2-dropdown {
    position: absolute;
    z-index: 9999;
    margin-top: 2px;
    width: 100%;
}

/* Ensure dropdown stays absolutely positioned relative to container */
.select2-container--default.select2-container--open .select2-dropdown.select2-dropdown--below {
    top: 100%;
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    border-right: none;
}
/* Fix dropdown container to have clear position context */
.select2-container {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
}

/* Ensure dropdown stays absolutely positioned relative to container */
.select2-dropdown.select2-fix-position {
    position: absolute !important;
    z-index: 99999 !important;
    margin-top: 0 !important;
    background-color: white !important;
    border: 1px solid #aaa !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
}

/* Make options clearly visible */
.select2-dropdown.select2-fix-position .select2-results__options {
    max-height: 250px !important;
    padding: 5px !important;
    display: block !important;
    background-color: white !important;
    color: #333 !important;
    font-size: 14px !important;
}

/* Style each option clearly */
.select2-dropdown.select2-fix-position .select2-results__option {
    padding: 8px 12px !important;
    margin: 2px 0 !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    color: #333 !important;
    display: block !important;
}

/* Highlight on hover */
.select2-dropdown.select2-fix-position .select2-results__option:hover,
.select2-dropdown.select2-fix-position .select2-results__option--highlighted {
    background-color: #2A6478 !important;
    color: white !important;
}

/* Clear fix for the container */
.tag-filter-container.woocommerce-ordering {
    position: relative !important;
    display: block !important;
    min-height: 38px !important;
    clear: both !important;
}

/* Make dropdown visible through any overlays */
.select2-container--open .select2-dropdown {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force the body to have position relative so Select2 works correctly */
body.woocommerce-page {
    position: relative;
}

/* Override any margins to ensure proper positioning */
.tag-filter-container.woocommerce-ordering .select2-container--open .select2-dropdown {
    margin-top: 0 !important;
}

/* Reset any potential transforms that might be affecting positioning */
.select2-container, 
.select2-selection, 
.select2-dropdown {
    transform: none !important;
}

/* Select2 Tag Dropdown Styling */
.select2-tag-dropdown {
    background-color: white !important;
    border: 1px solid #aaa !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
    z-index: 100000 !important;
    margin-top: -30px !important;
    overflow: visible !important;
    display: block !important;
    visibility: visible !important;
}

/* Style the dropdown options */
.select2-tag-dropdown .select2-results__options {
    max-height: 250px !important;
    overflow-y: auto !important;
    padding: 5px !important;
}

/* Style each option */
.select2-tag-dropdown .select2-results__option {
    padding: 8px 12px !important;
    margin: 2px 0 !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    color: #333 !important;
}

/* Highlight on hover/selected */
.select2-tag-dropdown .select2-results__option--highlighted[aria-selected] {
    background-color: #2A6478 !important;
    color: white !important;
}

/* Fix the container positioning */
.tag-filter-container.woocommerce-ordering {
    position: relative !important;
    display: inline-block !important;
    min-width: 200px !important;
}

/* Make sure product card elements are visible and positioned correctly */
.custom-product-card {
    position: relative !important;
    overflow: visible !important;
}

/* Ensure proper relative positioning for list view product elements */
.list-product-card {
    position: relative !important;
    overflow: visible !important;
}

/* Explicitly restore list view product tags and containers */
.list-product-side {
    position: relative !important;
}

/* Brain Selector Styling */
.select2-container--default .select2-selection--single {
    background-color: #2A6478 !important;
    border: none !important;
    border-radius: 50px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 15px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: white !important;
    font-weight: 500 !important;
    padding-right: 30px !important;
    line-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    position: absolute !important;
    top: 0 !important;
    right: 10px !important;
    width: 20px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: white transparent transparent transparent !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    color: white !important;
    font-weight: bold !important;
    margin-right: 10px !important;
    height: 38px !important;
    line-height: 38px !important;
    font-size: 18px !important;
    padding: 0 5px !important;
    cursor: pointer !important;
    opacity: 0.8 !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    opacity: 1 !important;
}

/* Match tag filter font with orderby font */
.tag-filter-container .select2-selection,
.tag-filter-container .select2-selection__rendered {
    font-family: inherit !important;
    font-size: 0.9rem !important;
    color: #333 !important;
    font-weight: normal !important;
}

/* Match the style of the selection container to orderby */
.tag-filter-container .select2-container .select2-selection--multiple {
    line-height: 1.6 !important;
    font-size: 0.9rem !important;
    color: #333 !important;
}

/* Remove margin from woocommerce ordering */
.woocommerce .woocommerce-ordering {
    margin: 0 !important;
}

/* Product tags in upper right of product card */
.custom-product-card {
    position: relative;
}
.wc-product-tags-top {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    gap: 6px;
}
.wc-product-tags-top .wc-product-tag {
    background: #fff;
    color: #2A6478;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
}
.wc-product-tags-top .wc-product-tags {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-wrap: wrap;
    align-items: flex-start;
}
@media (max-width: 600px) {
    .wc-product-tags-top {
        top: 8px;
        right: 8px;
        gap: 4px;
    }
    .wc-product-tags-top .wc-product-tag {
        font-size: 0.8em;
        padding: 2px 7px;
    }
}

/* Grid view: Shipping restrictions styling */
.products:not(.view-list) .product-card-shipping-restrictions.shipping-tooltip {
    border: 1px solid #999;
    border-radius: 8px;
    padding: 2px 5px;
    background: #fff;
    position: relative;
}
.products:not(.view-list) .product-card-shipping-restrictions .shipping-restriction-tag {
    border: none;
    position: relative;
    cursor: pointer;
}
.products:not(.view-list) .product-card-shipping-restrictions .tooltip-text {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 120%;
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: pre-line;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    min-width: 180px;
    text-align: center;
    pointer-events: none;
    margin-top: 4px;
}
.products:not(.view-list) .product-card-shipping-restrictions.shipping-tooltip:hover .tooltip-text,
.products:not(.view-list) .product-card-shipping-restrictions.shipping-tooltip:focus .tooltip-text {
    display: block;
} 