/**
 * HHPF Bridge - Custom Product Detail Page Styles
 *
 * Two-column layout with image gallery on the left and a sticky info sidebar
 * on the right. Responsive: collapses to single column below 768px.
 *
 * @package HHPF_Bridge
 * @since 1.23.0
 */

/* ===== Container ===== */
.hhpfb-pdp {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #111;
    line-height: 1.6;
}

/* ===== Breadcrumb ===== */
.hhpfb-pdp-breadcrumb {
    padding: 16px 0;
    font-size: 13px;
    color: #666;
}
.hhpfb-pdp-breadcrumb a {
    color: #555;
    text-decoration: none;
}
.hhpfb-pdp-breadcrumb a:hover {
    color: #111;
    text-decoration: underline;
}

/* ===== Two-Column Layout ===== */
.hhpfb-pdp-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 40px;
    align-items: start;
}

/* ===== Left Column: Gallery ===== */
.hhpfb-pdp-main {
    min-width: 0;
}

.hhpfb-pdp-gallery {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

/* Thumbnail strip (left side) */
.hhpfb-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 68px;
    flex-shrink: 0;
    max-height: 520px;
    overflow-y: auto;
}
.hhpfb-gallery-thumbs::-webkit-scrollbar {
    width: 4px;
}
.hhpfb-gallery-thumbs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.hhpfb-thumb {
    width: 64px;
    height: 64px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
    flex-shrink: 0;
}
.hhpfb-thumb:hover {
    border-color: #999;
}
.hhpfb-thumb.active {
    border-color: #111;
}
.hhpfb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.hhpfb-thumb-more {
    width: 64px;
    height: 64px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #f5f5f5;
    cursor: default;
}

/* Main image */
.hhpfb-gallery-main {
    flex: 1;
    min-width: 0;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hhpfb-gallery-main img {
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
    display: block;
}

/* ===== Content Sections ===== */
.hhpfb-pdp-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #eee;
}
.hhpfb-pdp-section:last-child {
    border-bottom: none;
}
.hhpfb-pdp-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    padding: 0;
    color: #111;
}

/* Description */
.hhpfb-pdp-description {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}
.hhpfb-pdp-description p {
    margin: 0 0 12px;
}
.hhpfb-pdp-description ul {
    padding-left: 20px;
    margin: 0 0 12px;
}

/* Specifications table */
.hhpfb-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.hhpfb-specs-table th,
.hhpfb-specs-table td {
    padding: 10px 14px;
    text-align: left;
    border: none;
}
.hhpfb-specs-table th {
    font-weight: 600;
    color: #555;
    width: 180px;
    white-space: nowrap;
}
.hhpfb-specs-table td {
    color: #111;
}
.hhpfb-specs-table tr:nth-child(odd) {
    background: #f8f8f8;
}
.hhpfb-specs-table tr:nth-child(even) {
    background: #fff;
}

/* Fitment table override inside PDP */
.hhpfb-pdp .hhpfb-fitment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.hhpfb-pdp .hhpfb-fitment-table thead th {
    background: #111;
    color: #fff;
    padding: 8px 10px;
    font-weight: 600;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hhpfb-pdp .hhpfb-fitment-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}
.hhpfb-pdp .hhpfb-fitment-table tbody tr:hover {
    background: #f5f5f5;
}
.hhpfb-pdp #hhpfb-fitment-filter {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}
.hhpfb-pdp #hhpfb-fitment-filter:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

/* ===== Right Column: Sidebar ===== */
.hhpfb-pdp-sidebar {
    min-width: 0;
}
.hhpfb-pdp-sidebar-inner {
    position: sticky;
    top: 100px;
}

/* Title */
.hhpfb-pdp-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 12px;
    color: #111;
}

/* Price */
.hhpfb-pdp-price {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.hhpfb-pdp-price-current {
    font-size: 28px;
    font-weight: 700;
    color: #111;
}
.hhpfb-pdp-price-current.hhpfb-on-sale {
    color: #c62828;
}
.hhpfb-pdp-price-original {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
}

/* Rating */
.hhpfb-pdp-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}
.hhpfb-pdp-rating .star-rating {
    font-size: 14px;
}

/* Fitment / Guaranteed Fit */
.hhpfb-pdp-fitment {
    margin-bottom: 16px;
}
.hhpfb-pdp-fit {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid;
}
.hhpfb-fit-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.hhpfb-fit-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}
.hhpfb-fit-text strong {
    font-size: 15px;
}
.hhpfb-fit-text span {
    color: #555;
    font-size: 13px;
}

/* Fit: YES */
.hhpfb-pdp-fit.hhpfb-fit-yes {
    background: #e8f5e9;
    border-color: #a5d6a7;
}
.hhpfb-fit-yes .hhpfb-fit-icon {
    color: #2e7d32;
}
.hhpfb-fit-yes .hhpfb-fit-text strong {
    color: #2e7d32;
}

/* Fit: NO */
.hhpfb-pdp-fit.hhpfb-fit-no {
    background: #ffebee;
    border-color: #ef9a9a;
}
.hhpfb-fit-no .hhpfb-fit-icon {
    color: #c62828;
}
.hhpfb-fit-no .hhpfb-fit-text strong {
    color: #c62828;
}

/* Fit: Unknown */
.hhpfb-pdp-fit.hhpfb-fit-unknown {
    background: #f5f5f5;
    border-color: #ddd;
}
.hhpfb-fit-unknown .hhpfb-fit-icon {
    color: #666;
}

.hhpfb-pdp-change-vehicle {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    color: #1565c0;
    text-decoration: none;
}
.hhpfb-pdp-change-vehicle:hover {
    text-decoration: underline;
}

/* Add to Cart */
.hhpfb-pdp-cart {
    margin-bottom: 16px;
}
.hhpfb-pdp-cart .single_add_to_cart_button {
    width: 100%;
    background: #FEDD00 !important;
    color: #111 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hhpfb-pdp-cart .single_add_to_cart_button:hover {
    background: #e5c800 !important;
    transform: translateY(-1px);
}
.hhpfb-pdp-cart .single_add_to_cart_button:active {
    transform: translateY(0);
}
.hhpfb-pdp-cart .quantity {
    margin-bottom: 10px;
}
.hhpfb-pdp-cart .quantity .qty {
    width: 70px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

/* Availability */
.hhpfb-pdp-availability {
    margin-bottom: 16px;
}
.hhpfb-avail-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}
.hhpfb-avail-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.hhpfb-avail-status strong {
    display: block;
    margin-bottom: 2px;
}
.hhpfb-avail-detail {
    font-size: 13px;
    color: #555;
    display: block;
}

.hhpfb-avail-instock {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}
.hhpfb-avail-instock strong {
    color: #2e7d32;
}

.hhpfb-avail-contact {
    background: #fff8e1;
    border: 1px solid #ffe082;
    flex-direction: column;
    gap: 2px;
}
.hhpfb-avail-contact strong {
    color: #e65100;
}

/* Short description */
.hhpfb-pdp-short-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ===== Related Products ===== */
.hhpfb-pdp-related {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #eee;
}
.hhpfb-pdp-related .related.products > h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #111;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hhpfb-pdp-layout {
        grid-template-columns: 1fr 360px;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .hhpfb-pdp-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hhpfb-pdp-sidebar-inner {
        position: static;
    }

    .hhpfb-pdp-sidebar {
        order: -1;
        margin-bottom: 24px;
    }

    .hhpfb-pdp-gallery {
        flex-direction: column-reverse;
        margin-bottom: 24px;
    }

    .hhpfb-gallery-thumbs {
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .hhpfb-thumb {
        width: 56px;
        height: 56px;
    }

    .hhpfb-thumb-more {
        width: 56px;
        height: 56px;
    }

    .hhpfb-gallery-main img {
        max-height: 350px;
    }

    .hhpfb-pdp-title {
        font-size: 20px;
    }

    .hhpfb-pdp-price-current {
        font-size: 24px;
    }

    .hhpfb-specs-table th {
        width: 120px;
    }
}

@media (max-width: 480px) {
    .hhpfb-pdp {
        padding: 0 12px 24px;
    }

    .hhpfb-gallery-main img {
        max-height: 280px;
    }

    .hhpfb-pdp-section h2 {
        font-size: 18px;
    }

    .hhpfb-specs-table th,
    .hhpfb-specs-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    .hhpfb-specs-table th {
        width: auto;
    }
}
