/* Part Detail Page Styles — same hero background as other homepage routes */
body.homepage {
    min-height: 100vh;
    background-image: url("../images/urg_aps background gradient.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
    background-attachment: scroll;
}
.part-detail-container {
    /*background: #f8f9fa;*/
    min-height: calc(100vh - 200px);
    padding: 20px;
    border-radius: 0;
}

.detail-card {
    background: #ffffff;
    border-radius: 0;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.detail-card-header {
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.detail-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.part-title {
    font-size: 24px;
    font-weight: 700;
    color: #004d4f;
    margin: 0;
    line-height: 1.3;
}

/* Image Gallery Styles */
.image-gallery-card {
    position: sticky;
    top: 160px;
}

.main-image,
.main-detail-image {
    width: 100%;
    /* height: 500px; */
    height: fit-content;
    object-fit: cover;
    border-radius: 16px;
    cursor: pointer;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.main-image:hover,
.main-detail-image:hover {
    border-color: rgba(0, 245, 196, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.main-image img,
.main-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.main-image:hover img,
.main-detail-image:hover img {
    transform: scale(1.03);
}

.image-thumbnails,
.image-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-right: 4px;
}

.image-thumbnails>a,
.image-thumbnails-grid>a {
    display: block;
    width: 100%;
}

.image-thumbnails::-webkit-scrollbar,
.image-thumbnails-grid::-webkit-scrollbar {
    width: 6px;
}

.image-thumbnails::-webkit-scrollbar-track,
.image-thumbnails-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.image-thumbnails::-webkit-scrollbar-thumb,
.image-thumbnails-grid::-webkit-scrollbar-thumb {
    background: var(--aps-teal);
    border-radius: 10px;
}

.image-thumbnail,
.thumbnail-image {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-thumbnail:hover,
.thumbnail-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.image-thumbnail.active,
.thumbnail-image.active {
    border-color: var(--aps-teal);
    box-shadow: 0 4px 12px rgba(0, 245, 196, 0.3);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s ease;
}

/* .info-item:hover {
        background: #f0fdfa;
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    } */

.info-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 16px;
    color: #1f2937;
    font-weight: 700;
}

/* Price Section */
.price-section {
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f7f4 100%);
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
    border: 2px solid rgba(0, 245, 196, 0.2);
}

.price-main {
    font-size: 42px;
    font-weight: 800;
    color: #004d4f;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.price-math {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    font-weight: 500;
}

.price-breakdown-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.price-breakdown-item {
    padding: 10px 0;
    font-size: 13px;
    color: #4b5563;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.price-breakdown-item:last-child {
    border-bottom: none;
}

.price-breakdown-item::before {
    content: "•";
    color: var(--aps-teal);
    font-weight: bold;
    margin-right: 10px;
    font-size: 18px;
}

/* Yard Info */
.yard-info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.yard-name {
    font-size: 20px;
    font-weight: 700;
    color: #004d4f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.yard-name::before {
    content: "🏢";
    font-size: 24px;
}

.yard-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4b5563;
    padding: 8px;
    background: white;
    border-radius: 8px;
}

.yard-detail i {
    color: var(--aps-teal);
    width: 20px;
    font-size: 16px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.badge-primary {
    background: rgba(0, 245, 196, 0.15);
    color: #004d4f;
    border: 1px solid rgba(0, 245, 196, 0.3);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #92400e;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Button */
.btn-add-cart {
    background-color: var(--aps-teal);
    color: #002d2f;
    font-weight: 700;
    text-transform: uppercase;
    padding: 16px 32px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 245, 196, 0.3);
    width: fit-content;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 245, 196, 0.4);
    opacity: 0.95;
}

.btn-add-cart:active {
    transform: translateY(0);
}

.core-deposit {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 0;
    font-weight: 500;
}

.price-breakdown-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    overflow: visible;
}

/* Desktop hover — show tooltip on hover */
@media (min-width: 1024px) {
    .price-breakdown-icon-wrapper:hover .price-breakdown-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.price-breakdown-icon {
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-breakdown-icon:hover {
    transform: scale(1.05);
}

.price-breakdown-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    top: auto;
    right: 0;
    left: auto;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 260px;
    max-width: min(350px, calc(100vw - 32px));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    font-size: 12px;
    line-height: 1.6;
    color: #374151;
    pointer-events: none;
}

.price-breakdown-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.price-breakdown-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    bottom: auto;
    right: 20px;
    border: 6px solid transparent;
    border-top-color: #ffffff;
    border-bottom-color: transparent;
}

.price-breakdown-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    bottom: auto;
    right: 19px;
    border: 7px solid transparent;
    border-top-color: #e5e5e5;
    border-bottom-color: transparent;
}

@media (max-width: 787px) {
    /* Anchor tooltip to the icon’s right edge so it grows left into the viewport (left:0 pushed it off-screen). */
    .part-detail-summary-bar .price-breakdown-tooltip {
        left: auto !important;
        right: 0 !important;
        width: min(280px, calc(100vw - 32px)) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 32px) !important;
        bottom: calc(100% + 5px) !important;
        top: auto !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(5px) !important;
        pointer-events: none !important;
    }

    .part-detail-summary-bar .price-breakdown-tooltip.show {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }

    .part-detail-summary-bar .price-breakdown-icon-wrapper:hover .price-breakdown-tooltip:not(.show) {
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .part-detail-summary-bar .price-breakdown-tooltip::after {
        right: 20px !important;
        left: auto !important;
    }

    .part-detail-summary-bar .price-breakdown-tooltip::before {
        right: 19px !important;
        left: auto !important;
    }

    .part-detail-summary-bar {
        overflow: visible;
    }

    /* JS sets --pb-tip-left/--pb-tip-top so the popover stays inside the viewport (body overflow-x: clip) */
    .part-detail-summary-bar .price-breakdown-tooltip.price-breakdown-tooltip--fixed-viewport {
        position: fixed !important;
        left: var(--pb-tip-left, 16px) !important;
        top: var(--pb-tip-top, 16px) !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
    }
}


.delivery-section {
    display: flex;
    flex-direction: column;
}

.delivery-label {
    font-size: 10px;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delivery-value {
    font-size: 13px;
    color: #1f2937;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 24px 0;
}

.detail-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #004d4f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-section-title::before {
    content: "";
    width: 4px;
    height: 24px;
    background: var(--aps-teal);
    border-radius: 2px;
}

.parts-detail-page-section {
    max-width: 1320px;
}

.detail-page-dropdowns>div {
    width: 48%;
    margin-top: 0 !important;
}

.detail-page-dropdowns>div.core-charge-dropdown {
    width: 48%;
}

.breadcrumb-bar {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.breadcrumb-bar a:not(.btn-back) {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-back {
    background: #6b7280;
    color: white;
}

.main-img-count-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 9;
}

/* Responsive */
@media (max-width: 1024px) {
    .image-gallery-card {
        position: relative;
        top: 0;
    }

    .main-image,
    .main-detail-image {
        height: 400px;
    }

    .part-detail-container {
        margin-top: 20px;
        padding: 16px;
    }

    .detail-card {
        padding: 16px;
    }

    .part-title {
        font-size: 24px !important;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-page-dropdowns {
        flex-direction: column;
    }

    .detail-page-dropdowns>div {
        width: 100% !important;
    }

    .add-to-cart-wrapper {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 16px !important;
    }

    .btn-add-cart {
        width: 100%;
    }
}

@media (max-width: 787px) {
    .part-detail-wrapper {
        overflow-x: visible;
    }

    .fitment-dropdown,
    .warranty-dropdown {
        min-width: 0 !important;
    }

    .part-detail-container {
        margin-top: 70px;
        padding: 12px;
    }

    .detail-card {
        padding: 12px;
    }

    .part-title {
        font-size: 20px !important;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .price-main {
        font-size: 32px;
    }

    .breadcrumb-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .breadcrumbs {
        flex-wrap: wrap;
        font-size: 12px;
    }

    .main-image,
    .main-detail-image {
        height: 300px;
    }
}

.lb-outerContainer {
    width: 600px !important;
    height: 505px !important;
    background-color: black !important;
}

.lb-dataContainer {
    width: 600px !important;
}

.lb-container {

    display: flex !important;
    justify-content: center !important;
}

.lightbox .lb-image{
    border: none !important;
}

.lb-image{
    width: 600px !important;
    height: 505px !important;
}

/* Keep desktop lightbox size unchanged; make only mobile/tablet responsive */
@media (max-width: 1024px) {
    .lb-outerContainer {
        width: min(600px, calc(100vw - 24px)) !important;
        height: auto !important;
        max-height: calc(100vh - 170px) !important;
    }

    .lb-dataContainer {
        width: min(600px, calc(100vw - 24px)) !important;
    }

    .lb-image {
        width: min(600px, calc(100vw - 24px)) !important;
        height: auto !important;
        max-height: calc(100vh - 220px) !important;
        object-fit: contain !important;
    }
}
.order-status-badge{
    background: var(--aps-teal);
}

.new-add-to-cart-button {
    background-color: var(--aps-teal);
    border-radius: 30px;
}

.delivery-card__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.delivery-card__label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

.delivery-card__date {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
}

.delivery-card__status {
    font-size: 11px;
    color: #374151;
    font-weight: 500;
    margin-top: 2px;
}

.delivery-card__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.delivery-card__icon svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.delivery-card__icon-svg {
    color: #0d9488;
    font-size: 1rem;
}

@media (max-width: 368px) {
    .new-add-to-cart-button {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        font-size: 0.75rem !important;
    }
}

/* Below 455px and down to 425px screen width: reduce tooltip width and icon size to prevent overflow and keep it compact */
@media (max-width: 455px) and (min-width: 425px) {
    .price-breakdown-tooltip,
    .price-breakdown-tooltip.price-breakdown-tooltip--fixed-viewport {
        width: 240px !important;
        max-width: 240px !important;
        min-width: 0 !important;
        padding: 12px 12px !important;
    }

    .price-breakdown-tooltip .space-y-2 > .flex {
        gap: 8px !important;
    }

    .price-breakdown-icon {
        font-size: 11px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* Below 435px: keep the breakdown icon right-aligned */
@media (max-width: 434px) {
    .price-breakdown-icon-wrapper {
        margin-left: auto !important;
    }

    .add-to-cart-button__right > div:first-child,
    .mt-1.flex.flex-wrap.items-center {
        width: 100% !important;
    }
}

.aps-fulfillment-toggle {
    display: inline-flex;
    align-items: stretch;
    padding: 3px;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: visible;
}

.js-fulfillment-toggle-wrap.is-disabled .aps-fulfillment-toggle {
    opacity: 0.5;
    pointer-events: none;
}

.js-fulfillment-toggle-wrap.is-disabled .js-fulfillment-method-tooltip {
    display: none !important;
}

.js-fulfillment-method-tooltip {
    pointer-events: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    z-index: 20;
    margin-bottom: 0.5rem;
    width: 12rem;
    transform: translateX(-50%);
    border-radius: 0.5rem;
    background-color: #111827;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    white-space: normal;
}

.aps-fulfillment-toggle__btn:hover + .js-fulfillment-method-tooltip,
.aps-fulfillment-toggle__btn:focus-visible + .js-fulfillment-method-tooltip {
    opacity: 1;
    visibility: visible;
}

.js-fulfillment-toggle-wrap .js-fitment-tooltip {
    pointer-events: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    z-index: 10;
    margin-bottom: 0.5rem;
    width: 14rem;
    max-width: 14rem;
    transform: translateX(-50%);
    border-radius: 0.5rem;
    background-color: #111827;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    white-space: normal;
}

.js-fulfillment-toggle-wrap.is-disabled:hover .js-fitment-tooltip:not(.hidden),
.js-fulfillment-toggle-wrap.is-disabled:hover .js-fitment-tooltip-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.aps-fulfillment-toggle__btn {
    border: none;
    background: transparent;
    color: #004d4f;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.aps-fulfillment-toggle__btn:hover:not(.is-active) {
    background: rgba(0, 77, 79, 0.06);
}

.aps-fulfillment-toggle__btn.is-active {
    background: #004d4f;
    color: #fff;
}

.part-detail-container .part-detail-fulfillment-footer .delivery-card__icon svg {
    width: 48px;
    height: 48px;
}

.add-to-cart-button__delivery.hidden,
.part-detail-fulfillment-footer.hidden {
    display: none !important;
}

.oem-number-display {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    word-break: break-word;
}

.oem-number-more-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 245, 196, 0.12);
    color: #004d4f;
    border: 1px solid rgba(0, 77, 79, 0.15);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.oem-number-more-btn:hover,
.oem-number-more-btn:focus-visible {
    background: rgba(0, 245, 196, 0.22);
    border-color: rgba(0, 77, 79, 0.3);
    outline: none;
}

#oem-numbers-modal .oem-number-chip {
    list-style: none;
}
