/**
 * Single Spare Part Detail Page - Scoped Styling
 *
 * Implements:
 * - Scoped styling container (.gtr-single-spare-part)
 * - 2-Column Hero layout with responsive reflow
 * - Pure light aesthetic matching approved design
 * - Independent New & Used pricing tiles with active state
 * - Full-width cards for Overview, Compatibility, Specs, Related
 * - Mobile responsive table wrappers with smooth scrolling
 * - Lightbox modal styles
 *
 * @package GTR_Auto
 */

/* ==========================================================================
   1. BREADCRUMBS
   ========================================================================== */
.gtr-sp-breadcrumb {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
    font-size: 12px;
}
.gtr-sp-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .gtr-sp-container {
        padding: 0 24px;
    }
}
@media (min-width: 1280px) {
    .gtr-sp-container {
        padding: 0 32px;
    }
}
.gtr-sp-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    color: #64748b;
}
.gtr-sp-breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}
.gtr-sp-breadcrumb-link:hover {
    color: #b8001d;
}
.gtr-sp-breadcrumb-sep {
    color: #cbd5e1;
    user-select: none;
}
.gtr-sp-breadcrumb-item.is-current {
    color: #0f172a;
    font-weight: 600;
}

/* ==========================================================================
   2. MAIN CONTAINER & HERO
   ========================================================================== */
.gtr-single-spare-part {
    background: #f8fafc;
    padding: 24px 0 48px 0;
    color: #0f172a;
}
.gtr-sp-hero-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
@media (min-width: 768px) {
    .gtr-sp-hero-section {
        padding: 32px;
    }
}
.gtr-sp-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
}
@media (min-width: 992px) {
    .gtr-sp-hero-grid {
        grid-template-columns: 48% 52%;
        gap: 40px;
    }
}

/* ==========================================================================
   3. PRODUCT GALLERY (LEFT COLUMN)
   ========================================================================== */
.gtr-sp-gallery-col {
    display: flex;
    flex-direction: column;
}
.gtr-sp-main-image-wrap {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    max-height: 440px;
    padding: 20px;
}
@media (min-width: 768px) {
    .gtr-sp-main-image-wrap {
        min-height: 380px;
        padding: 28px;
    }
}
.gtr-sp-main-image-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gtr-sp-main-img {
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
    cursor: zoom-in;
}
.gtr-sp-zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease;
    z-index: 2;
}
.gtr-sp-zoom-btn:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}
.gtr-sp-thumbnails-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.gtr-sp-thumb-btn {
    width: 68px;
    height: 68px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.gtr-sp-thumb-btn:hover {
    border-color: #94a3b8;
}
.gtr-sp-thumb-btn.is-active {
    border: 2px solid #b8001d !important;
    box-shadow: 0 0 0 1px #b8001d;
}
.gtr-sp-thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   4. PRODUCT IDENTITY & ACTIONS (RIGHT COLUMN)
   ========================================================================== */
.gtr-sp-info-col {
    display: flex;
    flex-direction: column;
}
.gtr-sp-badge-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.gtr-sp-badge-mfr {
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 3px;
    display: inline-block;
}
.gtr-sp-badge-quality {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
}
.gtr-sp-title {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
}
@media (min-width: 768px) {
    .gtr-sp-title {
        font-size: 28px;
    }
}
.gtr-sp-meta-line {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}
.gtr-sp-meta-dot {
    color: #cbd5e1;
    user-select: none;
}
.gtr-sp-meta-label {
    color: #64748b;
    margin-right: 4px;
}
.gtr-sp-meta-val {
    color: #0f172a;
    font-weight: 600;
}

/* ==========================================================================
   5. INDEPENDENT NEW & USED PRICE BOXES (RADIO TILE BEHAVIOR)
   ========================================================================== */
.gtr-sp-price-boxes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
@media (min-width: 480px) {
    .gtr-sp-price-boxes {
        grid-template-columns: 1fr 1fr;
    }
}
.gtr-sp-price-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px 18px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    outline: none;
}
.gtr-sp-price-tile:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}
.gtr-sp-price-tile.is-selected {
    border: 2px solid #b8001d !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(184, 0, 29, 0.08);
}
.gtr-sp-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gtr-sp-tile-condition {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.gtr-sp-tile-radio-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    position: relative;
    transition: all 0.15s ease;
}
.gtr-sp-price-tile.is-selected .gtr-sp-tile-radio-indicator {
    border-color: #b8001d;
    background: #b8001d;
}
.gtr-sp-price-tile.is-selected .gtr-sp-tile-radio-indicator::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffffff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.gtr-sp-tile-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    margin-top: 6px;
}
.gtr-sp-tile-amount {
    font-size: 20px;
    font-weight: 800;
    color: #b8001d;
    line-height: 1.2;
    margin-top: 4px;
}
@media (min-width: 768px) {
    .gtr-sp-tile-amount {
        font-size: 24px;
    }
}
.gtr-sp-tile-secondary {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
}

/* ==========================================================================
   6. ACTIONS: RETAIL ENQUIRY & MESSAGING BUTTONS
   ========================================================================== */
.gtr-sp-primary-action-wrap {
    margin-bottom: 12px;
}
.gtr-sp-btn-primary {
    width: 100%;
    height: 48px;
    background: #b8001d;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(184, 0, 29, 0.25);
    transition: background 0.15s ease;
}
.gtr-sp-btn-primary:hover {
    background: #9e0018;
}
.gtr-sp-messaging-actions {
    display: flex;
    gap: 12px;
}
.gtr-sp-msg-btn {
    flex: 1;
    height: 42px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.gtr-sp-msg-btn.is-whatsapp {
    background: #25D366;
}
.gtr-sp-msg-btn.is-whatsapp:hover {
    background: #20ba5a;
}
.gtr-sp-msg-btn.is-line {
    background: #06C755;
}
.gtr-sp-msg-btn.is-line:hover {
    background: #05b04c;
}

/* ==========================================================================
   7. LOWER FULL-WIDTH SECTIONS
   ========================================================================== */
.gtr-sp-section {
    margin-top: 24px;
}
.gtr-sp-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
@media (min-width: 768px) {
    .gtr-sp-section-card {
        padding: 32px;
    }
}
.gtr-sp-section-heading-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.gtr-sp-section-accent-bar {
    width: 4px;
    height: 20px;
    background: #b8001d;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}
.gtr-sp-section-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}
@media (min-width: 768px) {
    .gtr-sp-section-title {
        font-size: 20px;
    }
}
.gtr-sp-section-sub {
    font-size: 13px;
    color: #64748b;
    margin: -6px 0 18px 0;
    line-height: 1.5;
}

/* Product Overview prose styling */
.gtr-sp-prose {
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
}
.gtr-sp-prose p {
    margin: 0 0 16px 0;
}
.gtr-sp-prose p:last-child {
    margin-bottom: 0;
}

/* Tables (Compatibility & Specs) */
.gtr-sp-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}
.gtr-sp-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.gtr-sp-data-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.gtr-sp-data-table tbody td,
.gtr-sp-data-table tbody th {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.gtr-sp-data-table tbody tr:last-child td,
.gtr-sp-data-table tbody tr:last-child th {
    border-bottom: none;
}
.gtr-sp-data-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* Specifications Table */
.gtr-sp-specs-table .gtr-sp-spec-label {
    width: 35%;
    min-width: 180px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}
@media (max-width: 600px) {
    .gtr-sp-specs-table .gtr-sp-spec-label {
        width: 45%;
    }
}
.gtr-sp-specs-table .gtr-sp-spec-value {
    width: 65%;
}

/* Product Advisories Grid */
.gtr-sp-advisories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) {
    .gtr-sp-advisories-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.gtr-sp-advisory-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
}
.gtr-sp-advisory-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}
.gtr-sp-advisory-text {
    font-size: 12px;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

/* Related Spare Parts Grid Container (Layout 2) */
.gtr-sp-related-section .gtr-part-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 16px;
}
@media (min-width: 640px) {
    .gtr-sp-related-section .gtr-part-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 992px) {
    .gtr-sp-related-section .gtr-part-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   8. LIGHTBOX MODAL FOR GALLERY ZOOM
   ========================================================================== */
.gtr-sp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gtr-sp-lightbox.is-open {
    display: flex;
}
.gtr-sp-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(4px);
}
.gtr-sp-lightbox-dialog {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.gtr-sp-lightbox-img {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}
.gtr-sp-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.15s ease;
}
.gtr-sp-lightbox-close:hover {
    opacity: 0.8;
}
.gtr-sp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}
.gtr-sp-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}
.gtr-sp-lightbox-nav.is-prev {
    left: -60px;
}
.gtr-sp-lightbox-nav.is-next {
    right: -60px;
}
.gtr-sp-lightbox-counter {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}
