/* Hereford Single Product Page Styles */


/* Breadcrumb Styles */
.woocommerce-breadcrumb {
    font-size: 0.8em;
    text-align: right;
}

.woocommerce .woocommerce-breadcrumb {
     margin: 5px;
}
/* PHE Tour Button */
.phe-start-tour {
    padding: 10px 20px;
}
/* Explainer Tool Help Button */
.explainer-button,
button[onclick*="openExplainerTool"],
.phe-help-button {
    padding: 8px 20px;
    text-transform: initial;
}



.hereford-single-product-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 5px;
    font-family: 'Helvetica Neue Condensed', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Main Product Layout */
.hereford-product-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Left Column Styles */
.hereford-left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Product Header */
.hereford-product-header {
    padding: 0px;
}

.hereford-product-title-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.hereford-product-title {
    font-size: 3rem;
    font-weight: bold;
    margin: 0;
    color: #003c71;
    border-bottom: solid 3px #003c71;
    border-bottom-right-radius: 20px;
    flex: 1;
}

/* Product Symbols */
.product-symbols-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-symbol {
    height: 40px !important;
    width: auto !important;
    max-width: 100px !important;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.product-symbol:hover {
    transform: scale(1.1);
}

.hereford-product-image {
    text-align: center;
    width: 100%;
}

.hereford-product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hereford-product-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Product Description Section */
.hereford-product-description {
    background: #fff;
    border: 2px solid #003c71;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.description-title {
    background: #003c71;
    color: white;
    margin: 0;
    padding: 5px 20px;
    font-size: 1em;
    font-weight: bold;
    border-bottom: solid 1px #fff;
}

.description-content {
    padding: 20px;
    font-size: 0.9em;
    line-height: 1.6;
    color: #333;
}

.description-content p {
    margin-bottom: 15px;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* Pedigree Section - Angus Style */
.hereford-pedigree-section {
    background: #fff;
    border: 2px solid #003c71;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.pedigree-header {
    background: #003c71;
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
}

.pedigree-section-header {
    background: #00a77e;
    color: white;
    margin: 0;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
}

.pedigree-row {
    display: flex;
    background: white;
}

.pedigree-row:last-child {
    border-bottom: none;
}

.pedigree-label {
    font-weight: normal;
  margin-right: 8px;
  display: inline-block;
  min-width: 140px;
  padding:5px 20px;
}

.pedigree-value {
    flex: 1;
    padding: 5px 20px;
    color: #333;
    font-weight: bold;
    background: white;
}

/* Right Column Styles */
.hereford-right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* General Information */
.hereford-general-info {
    background: #fff;
    border: 2px solid #003c71;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.general-info-header {
    text-align: left;
    font-size: 1em;
    background-color: #003c71;
    color: white;
    padding: 10px;
    font-weight: bold;
}

.info-table-structured {
    border: none;
    width: 100%;
}

.info-row-structured {
    display: flex;
    border-bottom: 1px solid #fff;
}

.info-row-structured:last-child {
    border-bottom: none;
}

.info-label-structured {
    flex: 0 0 40%;
    border-right: 1px solid #fff;
    text-align: left;
    background-color: #c3e4d9;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 0.8em;
}

.info-value-structured {
    flex: 1;
    text-align: right;
    background-color: #f6f9fb;
    padding: 5px 10px;
    font-size: 0.8em;
}

/* EBV Section */
.hereford-ebv-section {
    grid-column: 1 / -1;
    margin-top: 40px;
    background: #fff;
    border: 2px solid #003c71;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ebv-title {
    background: #003c71;
    color: white;
    margin: 0;
    padding: 8px 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
}

.hereford-ebv-section h3.ebv-title {
    margin-bottom: 0px;
    border-bottom:solid 1px #fff;
}

.ebv-table-container {
    overflow-x: auto;
    padding: 0px;
}

.ebv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    margin: 0;
    min-width: 1400px;
}

.ebv-table th,
.ebv-table td {
    border: 1px solid #003c71;
    padding: 6px 4px;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
}

.ebv-table th {
    background: #003c71;
    font-weight: bold;
    color: white;
    font-size: 16px;
    padding: 8px 4px;
}

.trait-label {
    background: #c3e4d9 !important;
    font-weight: bold;
    color: #003c71 !important;
    font-size: 16px;
    min-width: 50px;
}

.ebv-values td {
    background: #c3e4d9;
}

.ebv-accuracy td {
    background: #9fdacc;
}

.ebv-percentile td {
    background: #b9d7f8;
}

/* Desktop EBV Cards Layout - Hidden by default */
@media (min-width: 769px) {
    .ebv-mobile-cards {
        display: none;
    }
}

.hereford-ebv-section .ebv-table-container table.ebv-table {
    margin-bottom: 0px;
}


/* Additional styling fixes */
.hereford-add-to-cart .woocommerce div.product form.cart .variations {
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
}
/* Variations Form Label Styling */
.variations_form.cart th.label,
form.variations_form.cart th.label {
    line-height: 1.1em;
}
/* Variation Availability Stock Styling */
.woocommerce-variation-availability .stock {
    font-size: 0.8em;
    color: #0e2c4e;
    text-align: right;
    padding-right: 20px;
}
/* Stock paragraph styling */
p.stock.in-stock {
    font-size: 0.8em;
    color: #0e2c4e;
    text-align: right;
    padding-right: 20px;
}
/* Stock display in variation form */
.single_variation_wrap .woocommerce-variation-availability p.stock.in-stock,
.single_variation_wrap .woocommerce-variation-availability .stock,
.woocommerce-variation .woocommerce-variation-availability p.stock {
    font-size: 0.8em !important;
    color: #0e2c4e !important;
    text-align: right !important;
    padding-right: 20px !important;
    display: block !important;
}





.hereford-add-to-cart .woocommerce div.product form.cart .variations select,
.hereford-add-to-cart select[name*="attribute_"] {
    width: 95% !important;
}
/* Hide the Clear variations button */
.variations_form .reset_variations {
    display: none !important;
}


.hereford-add-to-cart .single_variation_wrap {
    width: 100% !important;
}

.hereford-product-price {
    padding: 5px 20px;
    background: #003c71;
    border-top: 1px solid #ddd;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

.hereford-add-to-cart {
    padding: 10px;
    border-top: 1px solid #ddd;
}

.hereford-add-to-cart .single_add_to_cart_button {
    background: #00a77e;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}

.hereford-add-to-cart .single_add_to_cart_button:hover {
    background: #008a6a;
}


/* WooCommerce Form Spacing Adjustments - Force Override */
form.variations_form.cart {
    margin-bottom: 10px !important;
}

form.variations_form.cart table.variations {
    margin-bottom: 0px !important;
    margin-top: 0px !important;
}

form.variations_form.cart table.variations tbody tr td {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

form.variations_form.cart .single_variation_wrap {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    padding-top: 0px !important;
}

form.variations_form.cart .woocommerce-variation-add-to-cart {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    padding-top: 0px !important;
    padding:0px 12px;
}

form.variations_form.cart .quantity {
    margin-bottom: 5px !important;
    margin-top: 0px !important;
}

form.variations_form.cart .single_add_to_cart_button {
    margin-bottom: 0px !important;
    background-color: #003c71 !important;
    background: #003c71 !important;
    opacity: 1 !important;
}

form.variations_form.cart .single_add_to_cart_button:hover {
    background-color: #0f2f52 !important;
    background: #0f2f52 !important;
    opacity: 1 !important;
}

/* More specific WooCommerce selectors */
.woocommerce form.variations_form.cart .single_add_to_cart_button,
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce-page form.variations_form.cart .single_add_to_cart_button {
    background-color: #003c71 !important;
    background: #003c71 !important;
    opacity: 1 !important;
    filter: none !important;
}

.woocommerce form.variations_form.cart .single_add_to_cart_button:hover,
.woocommerce div.product form.cart .single_add_to_cart_button:hover,
.woocommerce-page form.variations_form.cart .single_add_to_cart_button:hover {
    background-color: #0f2f52 !important;
    background: #0f2f52 !important;
    opacity: 1 !important;
    filter: none !important;
}

/* Additional specific targeting */
.woocommerce div.product form.cart table.variations {
    margin-bottom: 0px !important;
}

.woocommerce div.product form.cart .single_variation_wrap {
    margin-top: 0px !important;
    padding-top: 0px !important;
}

/* Breeding Indices Section */
.hereford-breeding-indices-section {
    grid-column: 1 / -1;
    margin-top: 30px;
    background: #fff;
    border: 2px solid #003c71;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.indices-title {
    background: #003c71;
    color: white;
    margin: 0;
    padding: 8px 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
}

.indices-table-container {
    overflow-x: auto;
    padding: 0;
}

.indices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    margin: 0;
    min-width: 600px;
}

.indices-table th,
.indices-table td {
    border: 1px solid #003c71;
    padding: 6px 4px;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
}

.indices-table th {
    background: #003c71;
    font-weight: bold;
    color: white;
    font-size: 16px;
    padding: 8px 4px;
}

.indices-values td {
    background: #c3e4d9;
}

.indices-averages td {
    background: #9fdacc;
}

/* General Info Table Styling */
.info-table-structured {
    border: none;
    width: 100%;
}

.info-row-structured {
    display: flex;
    border-bottom: 1px solid #fff;
}

.info-row-structured:last-child {
    border-bottom: none;
}

.info-label-structured {
    flex: 0 0 40%;
    border-right: 1px solid #fff;
    text-align: left;
    font-size: 0.8em;
}

.info-value-structured {
    flex: 1;
    text-align: right;
    font-size: 0.8em;
}

.general-info-header {
    text-align: left;
    font-size: 1em;
}

/* Add to Cart Layout Styling */
.hereford-add-to-cart .woocommerce-variation-add-to-cart,
.hereford-add-to-cart .cart {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hereford-add-to-cart .quantity {
    flex: 0 0 auto;
    margin: 0 !important;
}

.hereford-add-to-cart .quantity input {
    width: 60px !important;
    height: 25px !important;
    text-align: center;
}

.hereford-add-to-cart .single_add_to_cart_button {
    flex: 1;
    min-width: 120px;
    margin: 0 !important;
}

.hereford-add-to-cart .variations_button {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

/* Additional styling fixes */
.hereford-add-to-cart .woocommerce div.product form.cart .variations {
    margin-bottom: 5px !important;
    padding-bottom: 5px !important;
}

.hereford-add-to-cart .woocommerce div.product form.cart .variations select,
.hereford-add-to-cart select[name*="attribute_"] {
    width: 95% !important;
}

.hereford-add-to-cart .single_variation_wrap {
    width: 100% !important;
}

/* WooCommerce Product Form Styling */
.woocommerce div.product form.cart {
    margin-top: 0px;
  padding: 0px;
  background: none;
  border-radius: 0px;
  border: 0px solid #ddd;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    background-color: #003c71 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 0.8em !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    opacity: 1 !important;
    filter: none !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background-color: #0f2d4f !important;
}

/* Mobile EBV Cards Layout */
@media (max-width: 768px) {
    .hereford-product-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Mobile symbol adjustments */
    .hereford-product-title-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }

    .product-symbols-container {
        justify-content: flex-start;
        gap: 6px;
    }

    .product-symbol {
        height: 30px;
        max-width: 45px;
    }

    .hereford-ebv-section {
        margin-top: 20px;
        border: none;
    }

    .ebv-table-container {
        display: none; /* Hide table on mobile */
    }

    .ebv-mobile-cards {
        display: block;
        padding: 0;
    }

    .ebv-mobile-card {
        background: white;
        border: 1px solid #003c71;
        border-radius: 8px;
        margin-bottom: 15px;
        overflow: hidden;
    }

    .ebv-mobile-card-header {
        background: #003c71;
        color: white;
        padding: 12px 15px;
        font-weight: bold;
        font-size: 16px;
    }

    .ebv-mobile-card-content {
        padding: 0;
    }

    .ebv-mobile-row {
        display: table;
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
        table-layout: fixed;
    }

    .ebv-mobile-row:last-child {
        border-bottom: none;
    }

    .ebv-mobile-label {
        display: table-cell;
        width: 28%;
        background: #c3e4d9;
        color: #003c71;
        font-weight: bold;
        padding: 8px 4px;
        font-size: 12px;
        border-right: 1px solid #003c71;
        vertical-align: middle;
        word-wrap: break-word;
    }

    .ebv-mobile-value {
        display: table-cell;
        width: 24%;
        background: #c3e4d9;
        padding: 8px 4px;
        text-align: center;
        font-size: 12px;
        border-right: 1px solid #003c71;
        vertical-align: middle;
    }

    .ebv-mobile-acc {
        display: table-cell;
        width: 24%;
        background: #9fdacc;
        padding: 8px 4px;
        text-align: center;
        font-size: 12px;
        border-right: 1px solid #003c71;
        vertical-align: middle;
    }

    .ebv-mobile-perc {
        display: table-cell;
        width: 24%;
        background: #b9d7f8;
        padding: 8px 4px;
        text-align: center;
        font-size: 12px;
        vertical-align: middle;
    }

    .ebv-mobile-headers {
        display: table;
        width: 100%;
        background: #003c71;
        color: white;
        font-weight: bold;
        font-size: 12px;
        table-layout: fixed;
    }

    .ebv-mobile-headers > div {
        display: table-cell;
        padding: 8px 4px;
        text-align: center;
        border-right: 1px solid white;
        vertical-align: middle;
    }

    .ebv-mobile-headers > div:first-child {
        width: 28%;
        text-align: left;
    }

    .ebv-mobile-headers > div:nth-child(2) {
        width: 24%;
    }

    .ebv-mobile-headers > div:nth-child(3) {
        width: 24%;
    }

    .ebv-mobile-headers > div:nth-child(4) {
        width: 24%;
        border-right: none;
    }

    .pedigree-row {
        flex-direction: column;
    }

    .pedigree-label {
        flex: none;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .hereford-product-title {
        font-size: 2rem;
    }

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

/* Related Products Section */
.hereford-related-products {
    grid-column: 1 / -1;
    margin-top: 40px;
    border: 2px solid #003c71;
    border-radius: 8px;
    background: #fff;
}

.related-title {
    background: #003c71;
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

.related-product-item {
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.related-product-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

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

.related-product-title {
    padding: 15px;
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.related-product-item a {
    text-decoration: none;
    color: inherit;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px 10px;
}

.modal-close:hover {
    color: #ccc;
}

/* Video Toggle Controls Styling */
.video-toggle-controls {
    margin: 10px 0;
    text-align: left;
}

.video-toggle-button {
    background-color: #003c71 !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 0.8em !important;
    font-weight: bold !important;
    transition: background-color 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.video-toggle-button:hover {
    background-color: #0d2b4a !important;
    color: white !important;
}

/* Video Animation Styles - Performance optimized */
.video-container {
    position: relative;
    width: 100%;
    max-width: 950px;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 0 auto; /* Center the video container */
    will-change: transform; /* GPU acceleration hint */
    transform: translateZ(0); /* Force hardware acceleration */
}

.product-main-video {
    width: 100%;
    max-width: 950px;
    height: auto;
    display: block;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
    min-height: 200px; /* Prevent layout shift while loading */
    will-change: transform; /* GPU acceleration hint */
    transform: translateZ(0); /* Force hardware acceleration */
    backface-visibility: hidden; /* Prevent flickering */
    -webkit-backface-visibility: hidden;
}

.product-main-video:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Video Loading States */
.video-container.loaded {
    opacity: 1;
}

.video-container:not(.loaded) {
    opacity: 0.7;
}

/* Ensure video maintains same size as image */
.hereford-product-image {
    text-align: center;
    width: 100%;
}

.hereford-product-image img,
.hereford-product-image .video-container {
    width: 100%;
    max-width: 950px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

.hereford-product-image img {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hereford-product-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Download PDF Section Styles */
.hereford-download-pdf {
    border: 0px solid #003c71;
    overflow: hidden;
    margin-top: 0px;
    padding:0px 20px;
}

.download-pdf-header {
    background-color: #003c71;
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-icon {
    font-size: 20px;
}

.download-pdf-content {
    text-align: center;
}

.download-pdf-button {
    background-color: #003c71;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: inherit;
    gap: 8px;
    width: auto;
    min-width: 100%;
}

.download-pdf-button:hover {
    background-color: #1e3a6f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 80, 144, 0.3);
}

.download-pdf-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(22, 65, 112, 0.3);
}

.download-pdf-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-pdf-button.pdf-generating {
    background-color: #0f2d4f;
    cursor: wait;
}

.download-pdf-button.pdf-success {
    background-color: #28a745 !important;
    cursor: default;
}

.pdf-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: pdf-spin 1s ease-in-out infinite;
}

@keyframes pdf-spin {
    to { transform: rotate(360deg); }
}

.download-pdf-description {
    font-size: 15px;
    color: #555;
    margin: 0;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* Responsive adjustments for Download PDF */
@media (max-width: 768px) {
    .download-pdf-header {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    .download-pdf-content {
        padding: 15px;
    }
    
    .download-pdf-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .download-pdf-description {
        font-size: 13px;
    }
}


/* Remove top padding from main content area on hereford single product pages */
.hereford-single-product-container #primary.content-area main#main.site-main {
    padding-top: 0;
}
