/**
 * Australian Sires Holsteins Specific Fixes
 * Fixes image height consistency and video button functionality
 * Version: 1.0.0
 */

/* ============================================
   IMAGE HEIGHT CONSISTENCY FIX
   ============================================ */

/* Ensure consistent image container height in grid view */
.tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .product-image {
    height: 330px; /* Fixed height to match video container */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8; /* Light background for images that don't fill */
    position: relative;
    overflow: hidden;
}

/* Make images maintain aspect ratio within container */
.tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .product-image img,
.tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .grid-view-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed from cover to contain to show full image */
    object-position: center;
    display: block;
}

/* Ensure ACTIVE video containers match image height */
.tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container {
    min-height: 330px; /* Match image container height */
}

/* Inactive containers should collapse when hidden */
.tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container-inactive {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
}

/* ============================================
   VIDEO VIEW BUTTON STYLING
   ============================================ */

/* Ensure video button is properly styled when active */
.tax-product_cat.term-australian-sires-holsteins .view-as-video.active {
    background-color: #003c71;
    color: white;
}

/* Button hover states */
.tax-product_cat.term-australian-sires-holsteins .view-as-video:hover {
    opacity: 0.9;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Change height to auto for screens 1799px and below */
@media (max-width: 1799px) {
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .product-image {
        height: auto !important;
    }
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container {
        height: auto !important;
        min-height: auto;
    }
}

@media (max-width: 1440px) {
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .product-image {
        height: auto !important;
    }
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container {
        height: auto !important;
        min-height: auto;
    }
    /* Ensure inactive containers stay collapsed */
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container-inactive {
        min-height: 0 !important;
    }
}

@media (max-width: 992px) {
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .product-image {
        height: auto !important;
    }
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container {
        height: auto !important;
        min-height: auto;
    }
    /* Ensure inactive containers stay collapsed */
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container-inactive {
        min-height: 0 !important;
    }
}

@media (max-width: 768px) {
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .product-image {
        height: auto !important;
    }
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container {
        height: auto !important;
        min-height: auto;
    }
    /* Ensure inactive containers stay collapsed */
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container-inactive {
        min-height: 0 !important;
    }
}

@media (max-width: 480px) {
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-product-card .product-image {
        height: auto !important;
    }
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container {
        height: auto !important;
        min-height: auto;
    }
    /* Ensure inactive containers stay collapsed */
    .tax-product_cat.term-australian-sires-holsteins .australian-sires-card-video-container-inactive {
        min-height: 0 !important;
    }
}

/* ============================================
   GENOMIC/PROVEN FILTER BUTTONS
   ============================================ */

.genomic-proven-filter {
    margin-bottom: 0px;
    padding-bottom: 0px;
    border-bottom: 0px;
}

.genomic-proven-filter h4 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.genomic-proven-filter .filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.genomic-proven-filter .filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background-color: white;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.genomic-proven-filter .filter-btn:hover {
    background-color: #0f2d4d !important;
    border-color: #0f2d4d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(22, 65, 112, 0.3) !important;
}

.genomic-proven-filter .filter-btn.active {
    background-color: #0f2d4d !important;
    border-color: #0f2d4d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(22, 65, 112, 0.3) !important;
}

/* Add margin between filter sections */
.sexed-filter {
    margin-top: 0px !important;
    padding-top: 0px !important;
    border-bottom: 0px;
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

/* ============================================
   ORIGIN FILTER (Australian/International)
   ============================================ */

/* Origin filter button styling */
.origin-filter {
    margin-bottom: 0px;
    padding-bottom: 0px;
    border-bottom: 0px;
}

.origin-filter .filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.origin-filter .filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background-color: white;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.origin-filter .filter-btn:hover {
    background-color: #0f2d4d !important;
    border-color: #0f2d4d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(22, 65, 112, 0.3) !important;
}

.origin-filter .filter-btn.active {
    background-color: #0f2d4d !important;
    border-color: #0f2d4d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(22, 65, 112, 0.3) !important;
}

/* Hide products marked as origin-hidden */
.australian-sires-product-card.origin-hidden,
.australian-sires-data-table tbody tr.origin-hidden {
    display: none !important;
}

/* Sexed filter styles - same as bull type filter */
.sexed-filter .filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background-color: white;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sexed-filter .filter-btn:hover {
    background-color: #0f2d4d !important;
    border-color: #0f2d4d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(22, 65, 112, 0.3) !important;
}

.sexed-filter .filter-btn.active {
    background-color: #0f2d4d !important;
    border-color: #0f2d4d !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(22, 65, 112, 0.3) !important;
    margin-right: 10px;
}