/* Product Diagram Section - Full Width */
.product-diagram-section-full {
    width: 100%;
    margin: 20px 0;
    background: #fff;
}

.pdp-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pdp-page-title {
    font-size: 30px;
    font-weight: 700;
    color: #1b2a44;
    margin: 0;
    line-height: 1.2;
}

.genuine-badge-img {
    height: 70px;
    width: auto;
    flex-shrink: 0;
}

/* Eurospares-style Split Layout */
.diagram-split-layout {
    display: flex;
    gap: 15px;
    max-width: 100%;
    margin: 0;
}

/* Left Panel - Diagram */
.diagram-left-panel {
    flex: 0 0 65%;
    background: #f5f5f5;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: visible;
}

.diagram-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

.diagram-image-container {
    position: relative;
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    min-height: 900px;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.diagram-image-container.zoomed {
    overflow: auto !important;
    cursor: zoom-out;
    display: block !important;
}

.diagram-wrapper {
    position: relative;
    width: 150%;
    max-width: none;
    display: inline-block;
    transform-origin: top left;
}

.diagram-wrapper.zoomed {
    transform: scale(1.5);
    cursor: move;
}

.diagram-image {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
}

/* Overlay positioned absolutely over the image - must match image exactly */
.diagram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.no-diagram-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

/* Hotspot Styling - HIDDEN BY DEFAULT */
.diagram-hotspot {
    position: absolute;
    width: 32px;
    height: 32px;
    background: rgba(231, 76, 60, 0);
    border: 2px solid transparent;
    border-radius: 50%;
    color: transparent;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%);  /* Center on coordinates */
}

/* No hover effect - hotspots only visible when clicked */

/* Active/Clicked state - LIGHT SUBTLE HIGHLIGHT - VISIBLE */
.diagram-hotspot.active,
.diagram-hotspot.highlighted {
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(52, 152, 219, 0.2) !important;
    color: transparent !important;
    transform: translate(-50%, -50%) !important;
    border: 2px solid rgba(52, 152, 219, 0.6) !important;
    z-index: 100 !important;
    animation: pulse 2s infinite !important;
}

/* Pulse animation - subtle glow */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(52, 152, 219, 0);
    }
}

/* Hover effect on active hotspots */
.diagram-hotspot.active:hover,
.diagram-hotspot.highlighted:hover {
    background: rgba(52, 152, 219, 0.35) !important;
    transform: translate(-50%, -50%) scale(1.2) !important;
}

.diagram-hotspot.flash {
    animation: flashPulse 0.6s ease-in-out;
}

@keyframes flashPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        background: rgba(52, 152, 219, 0.25);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        background: rgba(52, 152, 219, 0.45);
        box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
    }
}

/* Hotspot Tooltip - COMPLETELY HIDDEN */
.hotspot-tooltip {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.hotspot-tooltip::after {
    display: none !important;
}

/* Tooltip stays hidden even when hotspot is active */
.diagram-hotspot.active .hotspot-tooltip,
.diagram-hotspot.highlighted .hotspot-tooltip {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.tooltip-part {
    color: #ffcc00;
    font-weight: 600;
}

.tooltip-name {
    color: #ccc;
    font-size: 11px;
}

/* Right Panel - Parts Table */
.diagram-right-panel {
    flex: 0 0 35%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.parts-table-header {
    background: #1b2a44;
    color: #fff;
    padding: 12px 15px;
    border-radius: 4px 4px 0 0;
}

.parts-table-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-responsive {
    overflow-y: auto;
    max-height: 900px;
    flex: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.table-responsive::-webkit-scrollbar {
    display: none;
}

.parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.parts-table thead {
    background: #4a6d8c;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.parts-table thead tr {
    background: #4a6d8c;
}

.parts-table th {
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    border-bottom: 2px solid #3a5a7a;
    font-size: 11px;
    text-transform: uppercase;
}

.parts-table td {
    padding: 6px 5px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 11px;
}

.part-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.part-row:hover {
    background-color: #e3f2fd;
    cursor: pointer;
}

.part-row.highlighted {
    background-color: #2196f3 !important;
    color: #fff;
    animation: flash 0.5s ease-in-out;
}

.part-row.highlighted td {
    color: #fff;
}

.part-row.highlighted a {
    color: #fff !important;
    font-weight: 600;
}

.ref-number {
    font-weight: 700;
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
}

.part-number a {
    color: #1979c3;
    text-decoration: none;
}

.part-number a:hover {
    text-decoration: underline;
}

.part-name {
    color: #333;
}

.part-price {
    font-weight: 600;
    color: #333;
}

.part-qty .qty-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

.part-qty .qty-btn,
.qty-wrapper .qty-btn {
    width: 28px !important;
    height: 32px !important;
    padding: 0 !important;
    border: 1px solid #ccc !important;
    background: #f5f5f5 !important;
    color: #333 !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

.part-qty .qty-btn:hover {
    background: #e0e0e0;
    border-color: #999;
}

.part-qty .qty-btn:active {
    background: #d0d0d0;
}

.part-qty .qty-minus,
.qty-wrapper .qty-minus {
    border-radius: 3px 0 0 3px !important;
    border-right: none !important;
}

.part-qty .qty-plus,
.qty-wrapper .qty-plus {
    border-radius: 0 3px 3px 0 !important;
    border-left: none !important;
}

.part-qty input.qty,
.qty-wrapper input.qty {
    width: 50px !important;
    padding: 6px 8px !important;
    border: 1px solid #ccc !important;
    border-left: none !important;
    border-right: none !important;
    text-align: center !important;
    font-size: 14px !important;
    height: 32px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

.part-action .btn-add-to-cart {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #e74c3c;
    color: #fff;
    border: none;
    white-space: nowrap;
}

.part-action .btn-add-to-cart:hover {
    background-color: #c0392b;
    transform: scale(1.05);
}

/* Stock Status Column */
.part-stock {
    text-align: center;
    vertical-align: middle !important;
    padding: 4px 2px !important;
}

.stock-status {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.stock-status.in-stock {
    background-color: #28a745;
    color: #fff;
}

.stock-status.order {
    background-color: #ffc107;
    color: #000;
}

.col-ref { width: 4%; text-align: center; }
.col-part-number { width: 16%; }
.col-description { width: 26%; }
.col-price { width: 9%; }
.col-stock { width: 8%; text-align: center; }
.col-qty { width: 13%; }
.col-action { width: 24%; }

/* Part Info Tabs */
.part-info-tabs {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.tab-headers {
    display: flex;
    border-bottom: 2px solid #1b2a44;
    background: #f0f3f7;
}

.tab-header {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4a6d8c;
    transition: all 0.3s ease;
}

.tab-header:hover {
    background: #dce5ef;
    color: #1b2a44;
}

.tab-header.active {
    background: #1b2a44;
    color: #fff;
}

.tab-content {
    display: none;
    padding: 20px;
    min-height: 200px;
}

.tab-content.active {
    display: block;
}

.no-part-selected {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

.fitment-loading {
    text-align: center;
    padding: 20px;
    color: #4a6d8c;
    font-size: 13px;
}

.fitment-vehicle-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fitment-vehicle-item {
    border-bottom: 1px solid #e8eef4;
}

.fitment-vehicle-item:last-child {
    border-bottom: none;
}

.fitment-vehicle-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1b2a44;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.fitment-vehicle-link:hover {
    background-color: #f0f4f8;
    color: #4a6d8c;
}

.fitment-vehicle-icon {
    color: #4a6d8c;
    font-size: 10px;
    flex-shrink: 0;
}

.fitment-vehicle-label {
    font-weight: 500;
}

.fitment-no-data {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 13px;
    font-style: italic;
}

.fitment-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: #4a6d8c;
    padding: 6px 14px;
    margin: 0 0 0 0;
    border-radius: 0;
}

.fitment-extras-section {
    margin-bottom: 0;
    border-bottom: 1px solid #e8eef4;
}

.fitment-extras-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fitment-extras-item {
    padding: 7px 14px;
    border-bottom: 1px solid #f0f3f7;
    font-size: 12px;
    color: #444;
}

.fitment-extras-item:last-child {
    border-bottom: none;
}

.fitment-available-title {
    background: #2e7d32;
}

.fitment-not-available-title {
    background: #c62828;
}

#fitment-vehicles-section .fitment-section-title {
    background: #1b2a44;
}

.part-details-content,
.part-dimensions-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th {
    text-align: left;
    padding: 10px 15px;
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
    width: 30%;
    border-bottom: 1px solid #eee;
}

.details-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.details-table tr:last-child th,
.details-table tr:last-child td {
    border-bottom: none;
}

/* Special styling for Replaced By row */
.details-table #detail-replaced-by {
    background: linear-gradient(to right, #fff9e6 0%, #fff3cd 100%);
    border-left: 4px solid #ff6b35;
    color: #856404;
    font-weight: 600;
    padding: 15px 20px;
    line-height: 2.2;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    border-radius: 0 4px 4px 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.details-table #detail-replaced-by:before {
    content: "⚠ ";
    color: #ff6b35;
    font-weight: bold;
    margin-right: 8px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    vertical-align: middle;
}

.dimensions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.dimension-section h4 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #1b2a44;
    color: #1b2a44;
    font-size: 16px;
}

.dimensions-table {
    width: 100%;
    border-collapse: collapse;
}

.dimensions-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
    width: 50%;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.dimensions-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

.dimensions-table tr:last-child th,
.dimensions-table tr:last-child td {
    border-bottom: none;
}

/* Hide default product info section below diagram - ONLY on grouped product pages */
.page-product-grouped .product-info-main,
.page-product-grouped .product.info.detailed {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .diagram-split-layout {
        flex-direction: column;
    }
    
    .diagram-left-panel,
    .diagram-right-panel {
        flex: 1 1 100%;
    }
    
    .table-responsive {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .parts-table {
        font-size: 11px;
    }
    
    .parts-table th,
    .parts-table td {
        padding: 6px 4px;
    }
    
    .btn-add-to-cart {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Text Overlay (like Eurospares) */
.text-overlay {
    position: absolute;
    padding: 4px 8px;
    font-size: 12px;
    color: #000;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    z-index: 1;
}

.text-overlay.top-left {
    top: 10px;
    left: 10px;
}

.text-overlay.bottom-left {
    bottom: 10px;
    left: 10px;
}
