/**
 * International Sires Page Styles
 * Based on Australian Sires layout with left sidebar filters
 */

/* Main Layout */
.international-sires-page-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 30px 5px;
    box-sizing: border-box;
    clear: both;
    overflow-x: hidden;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

/* Ensure the content area takes full width */
.tax-product_cat.term-international-sires-holsteins #primary.content-area,
.tax-product_cat.term-international-sires-jersey #primary.content-area,
.tax-product_cat.term-international-sires-brown-swiss #primary.content-area,
.tax-product_cat.term-international-sires-ayrshire #primary.content-area,
.tax-product_cat.term-international-sires-guernsey #primary.content-area {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

/* Override WooCommerce styles */
.tax-product_cat.term-international-sires-holsteins .woocommerce-products-header,
.tax-product_cat.term-international-sires-jersey .woocommerce-products-header,
.tax-product_cat.term-international-sires-brown-swiss .woocommerce-products-header,
.tax-product_cat.term-international-sires-ayrshire .woocommerce-products-header,
.tax-product_cat.term-international-sires-guernsey .woocommerce-products-header {
    display: none;
}

/* Filters Sidebar */
.international-sires-filters {
    width: 25%;
    padding: 0 15px;
    box-sizing: border-box;
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}

/* Main Content Area */
.international-sires-main-content {
    width: 75%;
    padding: 0 15px;
    box-sizing: border-box;
}

.international-sires-page-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.75rem; /* 28px based on 16px base */
    color: #333;
}

/* Filter Sections */
.international-sires-filters h3 {
    font-size: 1.375rem; /* 22px based on 16px base */
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.filter-section {
    margin-bottom: 5px;
}

.filter-section h4 {
    font-size: 1rem; /* 16px - matches base */
    margin-bottom: 0px;
    color: #444;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.international-sires-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem; /* 14px based on 16px base */
    background-color: #003c71;
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.international-sires-button:hover {
    background-color: #0d2b4a;
}

.international-sires-button-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.international-sires-button-secondary:hover {
    background-color: #e0e0e0;
}

/* View and Sort Options */
.view-sort-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.view-toggle a {
    display: inline-block;
    padding: 8px 15px;
    background-color: white;
    color: #003c71;
    border: 1px solid #003c71;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem; /* 14px based on 16px base */
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
}

.view-toggle a:hover {
    background-color: #f0f0f0;
}

.sorting-options {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sort-option {
    padding: 8px 15px;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem; /* 14px based on 16px base */
    transition: all 0.3s ease;
}

.sort-option.active {
    background-color: #003c71;
    color: white;
}

/* Range Slider Styles */
.range-slider-container {
    margin: 15px 0;
}

.range-slider {
    margin: 10px 0;
}

/* Hide range values display as requested - values are shown in the slider itself */
.range-values {
    display: none;
}

/* Products Grid */
.international-sires-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    justify-items: center;
}

/* Product Card */
.international-sires-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

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

/* Product title link styling */
.product-header-link {
    text-decoration: none;
    display: block;
    transition: opacity 0.3s ease;
}

.product-header-link:hover {
    opacity: 0.9;
}

.product-header-link:hover h3 {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.product-header {
    background-color: #003c71;
    padding: 15px 3px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.product-header h3 {
    color: white;
    margin: 0;
    font-size: 1.125rem; /* 18px based on 16px base */
    font-weight: 700;
    text-transform: uppercase;
}

.product-image {
    height: auto;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
}

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

/* Price and Select Button Row */
.product-price-select-row {
    display: flex;
    align-items: center;
    background-color: #d9eaf9;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px;
}

.product-price {
    flex: 1;
    text-align: left;
    font-size: 1.125rem; /* 18px based on 16px base */
    font-weight: 700;
    color: #003c71;
}

.product-price .inc-gst {
    font-size: 0.875rem; /* 14px based on 16px base */
    font-weight: 400;
}

.price-na {
    color: #666;
    font-style: italic;
}

.product-select-button {
    margin-left: 10px;
}

.select-options-btn {
    background-color: #9fdacc;
    color: #003c71;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem; /* 14px based on 16px base */
    transition: all 0.3s ease;
    display: inline-block;
}

.select-options-btn:hover {
    background-color: #8bc9ba;
    color: #0d2b4a;
}

.product-sire {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    background-color: #e9ecef;
    font-size: 0.875rem; /* 14px based on 16px base */
}

.sire-label {
    font-weight: 600;
    color: #495057;
}

.sire-value {
    color: #333;
}

.product-data-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0;
}

/* H28: hide the data row on bull grid cards while the design is finalised.
   display:none drops the row out of layout entirely, so each card shrinks
   by the row's height automatically — no additional sizing work needed.
   To restore: delete this block (the original .product-data-row rule
   above is preserved untouched). */
.product-data-row {
    display: none;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.8125rem; /* 13px based on 16px base */
    background-color: #f1f3f4;
}

.data-item:nth-child(odd) {
    border-right: 1px solid #e0e0e0;
}

.data-label {
    font-weight: 600;
    color: #495057;
}

.data-value {
    color: #333;
    font-weight: 500;
}

/* Table View Styles */
.international-sires-data-table {
    width: 100%;
    margin-top: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: none;
    overflow-x: auto;
}

.international-sires-data-table.visible {
    display: block !important;
}

.international-sires-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem; /* 14px based on 16px base */
}

.international-sires-table th {
    background: #003c71;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #0f2d4f;
}

.international-sires-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.international-sires-table tr:hover {
    background-color: #f8f9fa;
}

.international-sires-table .column-image img {
    width: 60px;
    height: auto;
    border-radius: 4px;
}

.column-actions .select-options {
    background: #003c71;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem; /* 12px based on 16px base */
    display: inline-block;
}

.column-actions .select-options:hover {
    background: #0f2d4f;
}

.international-sires-table .no-results-row td {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* No products message */
.no-products-message {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin: 30px 0;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
    clear: both;
    font-size: 1.125rem; /* 18px based on 16px base */
    color: #333;
    font-weight: 500;
}

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

@media (max-width: 992px) {
    .international-sires-page-container {
        flex-direction: column;
    }

    .international-sires-filters {
        width: 100%;
        margin-bottom: 20px;
    }

    .international-sires-main-content {
        width: 100%;
    }

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

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

    .view-sort-container {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        width: 100%;
    }
    
    /* Make view toggle buttons full width on mobile */
    .view-toggle {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .view-toggle a {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
        text-align: center;
        box-sizing: border-box;
    }
    
    .view-toggle a:last-child {
        margin-bottom: 0;
    }

    .sorting-options {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        flex-direction: column;
    }

    .international-sires-table {
        font-size: 0.75rem; /* 12px based on 16px base */
    }

    .international-sires-table th,
    .international-sires-table td {
        padding: 6px 4px;
    }

    /* Tighter price row + shorter sire-name row on mobile so cards stay compact. */
    .product-price-container {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .product-price {
        text-align: center;
        padding: 5px;
    }

    .international-sires-product-card .product-sire {
        min-height: 20px;
    }
}
