/* Charolais 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;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) .woocommerce-breadcrumb {
  font-size: 0.8em;
  color: #767676;
  text-align: right;
}

.charolais-single-product-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 15px;
    font-family: 'Helvetica Neue Condensed', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
}

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

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

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

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

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

/* 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);
}

/* Product Description Styling */
.charolais-product-description {
    border: 2px solid #003c71;
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
    background-color: #ffffff;
    width:100%;
    float: left;
}

.charolais-product-description .description-title {
    background-color: #003c71;
    color: white;
    font-size: 1em;
    font-weight: bold;
    margin: 0;
    padding: 12px 20px;
    border: none;
}

.charolais-product-description .description-content {
    padding: 20px;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

.charolais-product-description .description-content p {
    margin: 0 0 10px 0;
}

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

.charolais-product-description .description-content ul {
    margin: 0;
    padding-left: 20px;
}

.charolais-product-description .description-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

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

.charolais-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.charolais-product-image img:hover {
    transform: scale(1.02);
}

/* Pedigree Section - Angus Style */
.charolais-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: 5px 20px;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
}

.pedigree-content {
    background: white;
    padding:5px 20px;
}

.pedigree-detail {
    margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: normal;
}


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

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

.pedigree-detail .field-value {
    flex: 1;
    padding: 10px 20px;
    color: #333;
    font-weight: bold;
    background: inherit;
}

/* Right Column Styles */
.charolais-right-column {
    display: flex;
    flex-direction: column;
}

.charolais-general-info {
    background: #fff;
    height: fit-content;
    border: 2px solid #003c71;
  border-radius: 8px;
}

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

/* EBV Section Styles */
.charolais-ebv-section {
    margin-top: 40px;
    background: #fff;
    border: 2px solid #003c71;
    border-radius: 8px;
    overflow: hidden;
}

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

.charolais-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: 1200px;
}

.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-values td:not(.trait-label) {
    background: #c3e4d9;
}

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

/* Breeding Indices Section */
.breeding-indices-section {
    margin-top: 30px;
    background: #fff;
    border: 2px solid #003c71;
    border-radius: 8px;
    overflow: hidden;
}

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

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

.indices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.indices-table th {
    background: #c3e4d9;
    color: #003c71;
    font-weight: bold;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #003c71;
    font-size: 0.85rem;
}

.indices-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.indices-values td:not(.trait-label) {
    background: #f6f9fb;
}

.indices-percentile td:not(.trait-label) {
    background: #fff3e0;
}

/* General Information 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;
    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;
}

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

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

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

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

.charolais-add-to-cart .single_add_to_cart_button {
    flex: 1;
    min-width: 120px;
    margin: 0 !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;
}





.charolais-add-to-cart .variations_button {
    display: flex !important;
    align-items: center;
    gap: 10px;
}
/* Hide the Clear variations button */
.variations_form .reset_variations {
    display: none !important;
}


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

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

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

/* Product Price and Cart */
.charolais-product-price {
    padding: 5px 20px;
    background: #003c71;
    border-top: 1px solid #ddd;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

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

.charolais-add-to-cart .single_add_to_cart_button {
    background: #003c71;
    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;
}

.charolais-add-to-cart .single_add_to_cart_button:hover {
    background: #0f2f52;
}

/* Specific WooCommerce Add to Cart Button Styling */
.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 Spacing Adjustments - Force Override */
form.variations_form.cart {
    margin-bottom: 10px !important;
}

.charolais-add-to-cart .woocommerce div.product form.cart .variations {
    margin-bottom: 0em !important;
    padding-bottom: 0px !important;
}

.charolais-add-to-cart .single_variation_wrap {
    margin-top: 5px !important;
    padding-top: 0px !important;
}

.charolais-add-to-cart .woocommerce div.product form.cart .variations select,
.charolais-add-to-cart select[name*="attribute_"] {
    width: 95% !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    height: auto !important;
}

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

.charolais-add-to-cart .woocommerce-variation-add-to-cart {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 10px !important;
    padding: 0px 20px !important;
}

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

.charolais-add-to-cart .quantity input.qty {
    width: 60px !important;
    height: 40px !important;
    text-align: center;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    padding: 8px !important;
}

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

/* Related Products Section */
.charolais-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;
}

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

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

@media (max-width: 768px) {
    .charolais-product-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

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

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

    

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

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

    .ebv-table-container,
    .indices-table-container {
        padding: 10px;
    }

    .ebv-table,
    .indices-table {
        font-size: 0.8rem;
    }

    .ebv-table th,
    .indices-table th {
        padding: 6px 4px;
        font-size: 0.75rem;
    }

    .ebv-table td,
    .indices-table td {
        padding: 6px 4px;
    }
}

/* Mobile EBV Cards Layout */
@media (max-width: 768px) {
    .ebv-table-container {
        display: none; /* Hide table on mobile */
    }

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

    .charolais-ebv-section {
        border: none;
    }

    .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;
    }
}

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

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

/* 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;
}

/* Border removed as requested */

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

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

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

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

/* Download PDF Section Styles */
.charolais-download-pdf {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.download-pdf-header {
    background-color: #003c71;
    color: white;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

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

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

.download-pdf-button:hover {
    background-color: #0f2d4f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(22, 65, 112, 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: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* 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 charolais single product pages */
.charolais-single-product-container #primary.content-area main#main.site-main {
    padding-top: 0;
}
