/* International Sires Montbeliarde FR Single Product Styles */
/* Consistent with Australian Sires Holstein styling */

.montbeliarde-fr-layout-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 15px;
    background-color: #f9f9f9;
    font-size:1rem;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) .woocommerce-breadcrumb {
  font-size: 0.8em;
  color: #767676;
  text-align: right;
}

.montbeliarde-fr-single-product {
    font-family: Arial, sans-serif;
}

/* Header Section */
.montbeliarde-fr-header-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.montbeliarde-fr-left-column {
    padding-right: 20px;
}

.montbeliarde-fr-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;
}

/* Key Indicators - ISU and INEL */
.montbeliarde-fr-key-indicators {
    display: flex;
    gap: 0;
    margin-top: 10px;
    margin-bottom: 10px;
}

.indicator-box {
    background-color: #003c71;
    color: white;
    text-align: center;
    padding: 14px 22px;
    position: relative;
    flex: 1;
}

.indicator-box:first-child {
    border-radius: 8px 0 0 8px;
}

.indicator-box:last-child {
    border-radius: 0 8px 8px 0;
}

.indicator-box:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 2px;
    background-color: white;
}

.isu-box {
    background-color: #003c71;
}

.inel-box {
    background-color: #003c71;
}

.indicator-label {
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 0px;
    color: white;
}

.indicator-value {
    font-size: 0.9em;
    font-weight: bold;
    color: white;
}

/* Video Toggle Controls */
.video-toggle-controls {
    margin: 20px 0;
    text-align: left;
}

.video-toggle-button {
    background-color: #003c71;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.video-toggle-button:hover {
    background-color: #0f2f4f;
}

/* Explainer Tool Button */
.explainer-button,
button[onclick*="openExplainerTool"] {
    background-color: #003c71;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 10px;
    display: inline-block;
}

.explainer-button:hover,
button[onclick*="openExplainerTool"]:hover {
    background-color: #1e3d5f;
}

/* Buttons container */
.montbeliarde-fr-buttons {
    display: flex;
    gap: 10px;
    margin: 5px 0;
    align-items: center;
    flex-wrap: wrap;
}

/* Ensure explainer button container displays properly when moved */
.montbeliarde-fr-buttons .phe-help-button-container {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    display: inline-block !important;
    margin: 0 !important;
}

.montbeliarde-fr-buttons .phe-help-button {
    position: relative !important;
}


/* Ensure proper highlighting for Workability table fields */
.production-data-table th[data-explainer-field] {
    position: relative;
    cursor: help;
}

.production-data-table th[data-explainer-field].explainer-highlight,
.production-data-table td[data-field].explainer-highlight {
    background-color: rgba(45, 90, 142, 0.1) !important;
    outline: 2px solid #003c71 !important;
    outline-offset: -1px;
}

/* Prevent all headers from being highlighted together */
.production-data-table thead tr.explainer-highlight {
    background: none !important;
    outline: none !important;
}

.production-data-table thead tr.explainer-highlight th {
    background: none !important;
    outline: none !important;
}

/* Only highlight the specific field being explained */
.production-data-table th.explainer-active,
.production-data-table td.explainer-active {
    background-color: rgba(45, 90, 142, 0.2) !important;
    outline: 2px solid #003c71 !important;
}

/* Product Image/Video */
.montbeliarde-fr-product-image {
    margin: 5px 0;
    width: 100%;
}

.product-main-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-main-image:hover {
    transform: scale(1.02);
}

.product-main-video {
    width: 100%;
    height: auto;
    display: block;
}

.video-container {
    width: 100%;
    height: auto;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Description Section */
.montbeliarde-fr-description-section {
    margin: 5px 0;
    float: left;
    width:100%;
}

.description-container {
    border: 2px solid #003c71;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

.description-title {
    background-color: #003c71;
    color: white;
    margin: 0;
    padding: 5px 16px;
    font-size: 1em;
    font-weight: bold;
    text-transform: none;
    border-radius: 0;
}

.description-content {
    padding: 20px;
    background-color: #ffffff;
}

.product-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.product-description p {
    margin-bottom: 15px;
}

.description-caption {
    color: #003c71;
    font-size: 1em;
    font-weight: bold;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.description-summaries {
    margin: 0;
}

.summary-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    line-height: 1.5;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.green-checkmark {
    color: #28a745;
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
}

.summary-text {
    color: #333;
    line-height: 1.5;
    flex: 1;
    font-size: 0.9em;
}

/* General Information Sidebar */
.montbeliarde-fr-general-info-sidebar {
    background-color: #f8f9fa;
}

.general-info-box {
    background-color: white;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    border: 2px solid #003c71;
}

.info-box-title {
    background-color: #003c71;
    color: white;
    margin: 0;
    padding: 5px 16px;
    font-size: 0.99em;
    font-weight: bold;
    text-align: left;
}

.info-table-structured {
    margin: 0;
}

.info-row-structured {
    display: flex;
    border-bottom: 1px solid #fff;
}

.info-row-structured:last-child {
    border-bottom: none;
}

.info-label-structured {
    background-color: #c3e4d9;
    padding: 5px 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.8em;
    width: 40%;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.info-value-structured {
    background-color: #f6f9fb;
    padding: 5px 10px; 
    font-weight: 500;
    color: #333;
    text-align: right;
    font-size: 0.8em;
    width: 60%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Price Section */
.price-section {
    background-color: #003c71;
    padding: 15px 20px;
    margin: 0;
}

.price-variation {
    margin-bottom: 10px;
}

.price-variation:last-child {
    margin-bottom: 0;
}

.price-label {
    color: white;
    font-weight: bold;
    margin-right: 10px;
    display: inline;
}

.variation-title {
    font-weight: 600;
    color: white;
    margin-right: 5px;
    display: inline;
}

.price-display {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    position: relative;
    overflow: visible;
}

.inc-gst {
    font-size: 0.8em;
    opacity: 0.9;
}

/* Stock Icon and Status */
.stock-icon-wrapper {
    display: inline-block;
    position: relative;
    margin-left: 10px;
    vertical-align: middle;
    z-index: 1000;
}

.stock-icon {
    cursor: pointer;
    font-size: 1.2em;
    display: inline-block;
    vertical-align: middle;
}

.stock-icon.in-stock {
    opacity: 1;
}

.stock-icon.out-of-stock {
    opacity: 0.5;
}

/* Stock status styling removed - using inline styles only */
.stock-status {
    font-size: 0.65em;
    color: #fff;
}
*/

/* Cart Section */
.montbeliarde-fr-cart-section {
    padding: 20px;
    background-color: white;
}

.product-options {
    margin-bottom: 15px;
}

.product-options label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.product-options select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.quantity-cart-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quantity input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.single_add_to_cart_button {
    background: #0f2f52 !important;
    opacity: 1 !important;
    filter: none !important;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    transition: background-color 0.3s ease;
}

.single_add_to_cart_button:hover {
    background-color: #0f2f4f;
}

/* Download PDF Section */
.download-pdf-container {
    margin-top: 20px;
    background-color: transparent;
    border-radius: 8px;
    padding: 20px;
}

.download-pdf-button {
    width: 100%;
    background: #003c71 !important;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
}

.download-pdf-button:hover {
    background-color: #0f2f4f !important;
}

.download-pdf-description {
    font-size: 0.85em;
    color: #666;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

/* Pedigree Information */
.pedigree-info-box {
    background-color: white;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    border: 2px solid #003c71;
    margin-top: 20px;
}

.pedigree-title {
    background-color: #003c71;
    color: white;
    margin: 0;
    padding: 5px 16px;
    font-size: 0.99em;
    font-weight: bold;
    text-align: left;
}

.pedigree-subsection {
    margin: 0;
}

.pedigree-subsection-title {
    margin: 0;
    padding: 5px 20px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    text-align: left;
}

.sire-title {
    background-color: #00a77e;
}

.dam-title {
    background-color: #003c71;
}

.pedigree-info-structured {
    margin: 0;
}

.pedigree-row-structured {
    display: flex;
    border-bottom: 1px solid #fff;
    background-color: #f6f9fb;
}

.pedigree-row-structured:last-child {
    border-bottom: none;
}

.pedigree-label-structured {
    background-color: #c3e4d9;
    padding: 12px 15px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    width: 40%;
    border-right: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.pedigree-value-structured {
    background-color: #f6f9fb;
    padding: 12px 15px;
    font-weight: 500;
    color: #333;
    text-align: right;
    font-size: 0.9em;
    width: 60%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Tables Section */
.montbeliarde-fr-tables-section {
    margin-top: 24px;
}

.production-table-container {
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #003c71;
}

.production-table-title {
    background-color: #003c71;
    color: white;
    padding: 5px 16px;
    font-size: 0.99em;
    font-weight: bold;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-subtitle {
    font-size: 0.85em;
    font-weight: normal;
    opacity: 0.9;
}

.production-data-table,
.conformation-data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    font-size:0.8em;
}

.production-header {
    background-color: #c3e4d9;
    color: #333;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8em; 
    border-right: 1px solid #ddd;
}

.production-header:last-child {
    border-right: none;
}

.production-data {
    padding: 12px;
    text-align: center;
    background-color: #f6f9fb;
    border: 1px solid #e0e0e0;
    font-weight: 500;
}

/* Conformation Table Specific */
.conformation-data-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.conformation-data-table tbody tr:last-child {
    border-bottom: none;
}

.conformation-data-table tbody tr:first-child {
    background-color: #f0f7ff;
}

.conformation-trait-label {
    background-color: #c3e4d9;
    padding: 10px 15px;
    font-weight: 600;
    color: #333;
    border-right: 1px solid #ddd;
}

.conformation-trait-value {
    background-color: #f6f9fb;
    padding: 10px 15px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    border-right: 1px solid #e0e0e0;
}

.special-field {
    background-color: #003c71 !important;
    font-weight: bold;
    color: white !important;
}

.special-field-value {
    background-color: #2c5aa0 !important;
    font-weight: bold;
    color: white !important;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .montbeliarde-fr-header-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .montbeliarde-fr-left-column {
        padding-right: 0;
    }
    
    .montbeliarde-fr-general-info-sidebar {
        width: 100%;
    }
    
    .montbeliarde-fr-product-title {
        font-size: 2rem;
    }
    
    .montbeliarde-fr-key-indicators {
        flex-direction: column;
        gap: 15px;
        padding: 0 5px;
    }
    
    .indicator-box {
        width: auto;
        border-radius: 8px !important;
        padding: 15px 20px;
        min-width: auto;
        margin: 0;
    }
    
    .indicator-box:not(:last-child)::after {
        display: none;
    }
    
    /* Fix button styling consistency on mobile */
    #video-toggle-btn,
    .explainer-button,
    .download-pdf-button,
    button[onclick*="toggleVideoView"],
    button[onclick*="openExplainerTool"] {
        text-transform: none !important;
        font-size: 14px !important;
        width: 100% !important;
        margin: 10px 0 !important;
        padding: 10px 20px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 5px !important;
    }
    
    /* Ensure button container has proper spacing */
    .product-header-actions,
    .button-container,
    .montbeliarde-fr-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-top: 15px !important;
        padding: 0 10px !important;
    }
    
    /* Make sure all action buttons have consistent appearance */
    .product-header-actions button,
    .product-header-actions .button,
    .button-container button,
    .button-container .button {
        text-transform: none !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        min-height: 44px !important;
        width: 100% !important;
        white-space: normal !important;
    }
    
    .quantity-cart-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .quantity input {
        width: 100%;
    }
    
    .single_add_to_cart_button {
        width: 100%;
    }
    
    .info-label-structured,
    .pedigree-label-structured {
        width: 45%;
        font-size: 0.8em;
    }
    
    .info-value-structured,
    .pedigree-value-structured {
        width: 55%;
        font-size: 0.8em;
    }
    
    .production-data-table,
    .conformation-data-table {
        font-size: 0.8em;
    }
    
    .production-header,
    .production-data,
    .conformation-trait-label,
    .conformation-trait-value {
        padding: 8px 5px;
        font-size: 0.8em;
    }
    
    .production-table-title {
        font-size: 1em;
    }
    
    .table-subtitle {
        font-size: 0.75em;
    }
}

/* Video Loading States */
.video-container.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.video-container.loaded {
    background-color: #000;
}

.video-container.playing .product-main-video {
    opacity: 1;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Loading States */
.pdf-generating {
    opacity: 0.7;
    cursor: not-allowed;
}

.pdf-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pdf-success {
    background: #00a77e !important;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
}