/* Roboto Variable Font (wdth, wght) - for hero heading */
/*@font-face {*/
/*    font-family: 'Roboto';*/
/*    src: url('/fonts/roboto-variable.ttf') format('truetype');*/
/*    font-weight: 100 900;*/
/*    font-stretch: 75% 100%;*/
/*    font-display: swap;*/
/*}*/

@font-face {
    font-family: 'Covered By Your Grace';
    src: url('/fonts/CoveredByYourGrace-Regular.ttf') format('truetype');
    font-display: swap;
}

:root {
    --aps-teal: #00f5c4;
    --aps-dark-bg: #002d2f;
    --aps-card-bg: #ffffff;
    --aps-text-gray: #4a5568;
}

html, body {
    /* Prevent ANY child from producing horizontal scroll */
    overflow-x: clip;
    max-width: 100%;
}

body {
    /* The specific radial gradient from the PDF */
    /* background: radial-gradient(circle at 70% 20%, #17bfae 0%, #004d4f 35%, #002d2f 100%); */
    background-color: #f7f8f9;
    /*background-attachment: fixed;*/
    font-family: 'Inter', sans-serif;
    color: white;
    margin: 0;
}

body.homepage {
    min-height: 100vh;
    min-height: 100dvh;
    /* Match gradient bottom so tall mobile content (open accordion) never falls onto #f7f8f9 */
    background-color: #002d2f;
    background-image: url("../images/urg_aps background gradient.png");
    background-repeat: no-repeat;
    background-size: cover;
    /* Anchor image to top; body grows with content so cover extends down the page */
    background-position: center top;
    background-attachment: scroll;
    /*background: radial-gradient(circle at 70% 20%, #17bfae 0%, #004d4f 35%, #002d2f 100%);*/
}

html:has(body.homepage) {
    min-height: 100%;
    overflow-y: scroll;
}

input,
select {
    color: black !important;
}

.part-search-input {
    color: white !important;
}

.part-search-wrapper {
    text-align: end;
}

.font-marker {
    font-family: 'Permanent Marker', cursive;
}

.font-covered-by-grace {
    font-family: 'Covered By Your Grace', cursive;
}


/* Header Styles */
.top-nav-link {
    font-size: 11px;
    /*text-transform: uppercase;*/
    letter-spacing: 0.05em;
    /*opacity: 0.8;*/
}

.top-nav-link:hover {
    opacity: 1;
}

.top-nav-link a {
    transition: opacity 0.2s;
}

/* Desktop header (1024px+) — full search bar + login row */
@media (min-width: 1024px) {
    .aps-main-header-wrap--mobile-v2 .aps-main-header {
        flex-wrap: nowrap;
    }

    .aps-main-header-wrap--mobile-v2 .aps-header-desktop-start {
        flex: 0 0 auto;
        min-width: 0;
    }

    .aps-main-header-wrap--mobile-v2 .aps-header-desktop-actions #global-search-wrap,
    .aps-main-header-wrap--mobile-v2 .aps-header-desktop-start #global-search-wrap {
        flex: 0 0 auto;
        width: 18rem;
        min-width: 18rem;
        max-width: 18rem;
    }

    @media (min-width: 1536px) {
        .aps-main-header-wrap--mobile-v2 .aps-header-desktop-actions #global-search-wrap,
        .aps-main-header-wrap--mobile-v2 .aps-header-desktop-start #global-search-wrap {
            width: 24rem;
            min-width: 24rem;
            max-width: 24rem;
        }
    }

    .aps-main-header-wrap--mobile-v2 .aps-mobile-header__actions {
        flex-shrink: 0;
        flex-wrap: nowrap;
    }

    .aps-main-header-wrap--mobile-v2 .top-header-extra-links,
    .aps-main-header-wrap--mobile-v2 .top-header-extra-links a {
        color: #fff;
    }

    .aps-main-header-wrap--mobile-v2:not(.fixed) {
        border-bottom: none !important;
    }
}

/* Search Cards */
.search-box {
    background: var(--aps-card-bg);
    border-radius: 0;
    color: #1a202c;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.search-box-cart {
    background: var(--aps-card-bg);
    border-radius: 0;
    color: #1a202c;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.search-input {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    width: 100%;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--aps-teal);
    box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.1);
}

/* Select2 Custom Styling */
.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-height: 48px;
    padding: 4px;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--aps-teal);
    color: #002d2f;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 2px;
    font-weight: 600;
    font-size: 13px;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: #002d2f;
    margin-right: 6px;
    font-weight: bold;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #001a1c;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--aps-teal);
    box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.1);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: rgba(0, 245, 196, 0.1);
    color: #002d2f;
}

.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
    background-color: var(--aps-teal);
    color: #002d2f;
}

.btn-aps-primary {
    background-color: var(--aps-teal);
    color: #002d2f;
    font-weight: 700;
    text-transform: uppercase;
    padding: 14px;
    border-radius: 50px;
    letter-spacing: 1px;
    transition: 0.2s;
    margin-top: auto;
    border: none;
    cursor: pointer;
}

.btn-aps-primary:hover {
    background-color: #00d4a8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 245, 196, 0.3);
}

/* Checkout / quote success (default APS theme) */
.checkout-success__icon {
    color: var(--aps-teal);
}

.checkout-success__title {
    color: #004d4f;
}

.checkout-success__amount {
    color: #004d4f;
}

.checkout-success__status {
    color: var(--aps-teal);
}

.checkout-success__btn-secondary {
    background: #fff;
    color: #004d4f;
    border: 2px solid #004d4f;
    border-radius: 9999px;
    text-decoration: none;
}

.checkout-success__btn-secondary:hover {
    background: #004d4f;
    color: #fff;
    text-decoration: none;
}

.btn-aps-disabled {
    background-color: #e2e8f0;
    color: #a0aec0;
    font-weight: 700;
    text-transform: uppercase;
    padding: 14px;
    border-radius: 50px;
    letter-spacing: 1px;
    margin-top: auto;
    border: none;
    cursor: not-allowed;
}

/* Recent Searches */
.recent-search-row__icon {
    color: var(--ms-primary, var(--aps-teal, #00FFB5));
    flex-shrink: 0;
    text-align: center;
}

.recent-search-row {
    position: relative;
    background: #FFFFFF14;
    border-radius: 15px;
    padding: 12px 64px 12px 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.recent-search-row:hover {
    background: rgba(255, 255, 255, 0.15);
}

.recent-search-row .remove-search-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* opacity: 0; */
    transition: all 0.2s ease;
    z-index: 10;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.recent-search-row:hover .remove-search-btn {
    opacity: 1;
}

.recent-search-row .remove-search-btn:hover {
    color: #ff4d4d !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) scale(1.1);
}

/* Keep wrapped recent-search text away from the absolute "x" button */
.recent-search-row > .flex-1 {
    min-width: 0;
    max-width: calc(100% - 62px);
}

.recent-search-row > .flex-1 > div {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.last-search-item .remove-search-btn-horizontal {
    transition: all 0.2s ease;
    color: rgba(0, 0, 0, 0.4);
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: 8px;
}

.last-search-item:hover .remove-search-btn-horizontal {
    opacity: 1;
}

/* Feature Bar */
.feature-bar {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Video Section */
.video-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
}

.play-button {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Global Search Input */
.global-search-input {
    transition: all 0.2s;
}

.global-search-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.2);
}

/* Parts Page Specific Styles */
.parts-grid .search-box {
    min-height: auto;
    display: flex;
    flex-direction: column;
}

.parts-grid .search-box .btn-aps-primary {
    margin-top: 0;
    width: auto;
    padding: 10px 20px;
    white-space: nowrap;
}

.parts-grid .search-box .btn-aps-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .search-box {
        min-height: 350px;
    }

    .parts-grid .search-box {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .search-box {
        min-height: 300px;
    }

    .parts-grid .search-box {
        min-height: auto;
    }
}

/* Location Drawer Styles */
#location-drawer-overlay {
    transition: opacity 0.3s ease-in-out;
}

#location-drawer {
    transition: transform 0.3s ease-in-out;
}

#location-drawer-overlay.flex {
    display: flex !important;
}

#location-drawer-overlay.opacity-100 {
    opacity: 1 !important;
}

#location-drawer.translate-x-0 {
    transform: translateX(0) !important;
}

/* Full-screen overlays: stop swipe scroll from chaining to the page (esp. iOS) */
#mobile-menu-overlay,
#cart-drawer-overlay,
#location-drawer-overlay,
#modal-overlay.flex {
    overscroll-behavior: none;
    touch-action: none;
}

#modal-content {
    touch-action: auto;
}

#modal-list {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#mobile-menu-drawer .overflow-y-auto,
#cart-drawer .flex-1.overflow-y-auto {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Legacy / non-redesign mobile menu: always slides from the right (<1024px) */
@media (max-width: 1023px) {
    body:not(.aps-mobile-redesign) #mobile-menu-drawer {
        right: 0;
        left: auto;
        transform: translateX(100%);
    }

    body:not(.aps-mobile-redesign) #mobile-menu-drawer.translate-x-0 {
        transform: translateX(0) !important;
    }
}

/* Mobile quick-nav pill (header hamburger) — mobile/tablet only */
.mobile-quick-nav {
    position: fixed;
    top: 4.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    z-index: 56;
    display: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    width: calc(100% - 1.5rem);
    max-width: 22.5rem;
    padding: 0.7rem 0.85rem 0.55rem;
    background: #002d2f;
    border-radius: 9999px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.mobile-quick-nav.is-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.mobile-quick-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-quick-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #00FFB5;
    color: #002d2f;
    font-size: 0.95rem;
    position: relative;
}

.mobile-quick-nav__icon--cart {
    overflow: visible;
}

.mobile-quick-nav__badge {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    border-radius: 9999px;
    background: #002d2f;
    color: #00FFB5;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    box-sizing: border-box;
}

.mobile-quick-nav__label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    color: #fff;
}

@media (min-width: 768px) {
    .mobile-quick-nav,
    #mobile-quick-nav-backdrop {
        display: none !important;
    }
}

/* Cart Drawer Styles */
#cart-drawer-overlay {
    transition: opacity 0.3s ease-in-out;
}

#cart-drawer {
    transition: transform 0.3s ease-in-out;
}

#cart-drawer-overlay.flex {
    display: flex !important;
}

#cart-drawer-overlay.opacity-100 {
    opacity: 1 !important;
}

#cart-drawer.translate-x-0 {
    transform: translateX(0) !important;
}

/* Cart Drawer Responsive */
@media (max-width: 768px) {
    #cart-drawer {
        max-width: 100%;
        width: 100%;
    }

    #cart-drawer .p-6 {
        padding: 16px;
    }

    #cart-drawer h2 {
        font-size: 1.25rem;
    }

    #cart-drawer-items .space-y-4>* {
        padding: 12px;
    }
}

/* Best Offer badge tooltip (fixed via homepage.js) */
#cart-drawer-items [data-row-id] {
    overflow: visible;
}

.cart-offer-price-info-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-offer-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    transition: opacity 0.15s ease;
}

.cart-offer-info-icon:hover,
.cart-offer-info-icon:focus-visible {
    opacity: 0.85;
    outline: none;
}

.cart-offer-price-info-wrap .cart-offer-tooltip {
    display: none;
}

.cart-offer-tooltip-fixed {
    position: fixed;
    width: 14rem;
    max-width: min(14rem, calc(100vw - 2rem));
    padding: 0.625rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.45;
    color: #f8fafc;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    text-align: left;
    z-index: 10000;
    pointer-events: auto;
}

/* Premium Filter Bar */
.horizontal-filters-premium {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group-premium {
    flex: 1;
    min-width: 150px;
}

.filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #718096;
    margin-bottom: 6px;
    display: block;
}

.filter-trigger {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    min-height: 48px;
}

.filter-trigger:hover:not(:disabled) {
    background: #f7fafc;
    border-color: var(--aps-teal);
}

.filter-trigger:focus:not(:disabled) {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 245, 196, 0.2);
}

/*.filter-trigger:disabled {*/
/*    opacity: 0.5;*/
/*    cursor: not-allowed;*/
/*    background: #f8fafc;*/
/*}*/

.filter-trigger i {
    color: #a0aec0;
    font-size: 12px;
    transition: color 0.2s;
}

.filter-trigger:hover:not(:disabled) i {
    color: var(--aps-teal);
}

#part-type-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow: hidden;
    /* max-height: 33px; */
}

.part-chip-small {
    background: #e6fffa;
    color: #2c7a7b;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Order tracking — theme tokens (APS teal / microsite branding) */
.ot-icon {
    background: var(--ms-primary, #054f59);
    color: var(--aps-teal, #00FFB5);
}
.ot-accent {
    color: var(--ms-primary, #004d4f);
}
.ot-badge {
    color: var(--ms-primary, #054f59);
    background: color-mix(in srgb, var(--aps-teal, #00d98a) 20%, transparent);
}
.ot-btn-primary {
    background: var(--ms-button, var(--aps-teal, #00d98a));
    color: #fff;
}
.ot-btn-primary:hover {
    filter: brightness(0.92);
}
.ot-btn-primary:focus {
    --tw-ring-color: var(--ms-button, var(--aps-teal, #00d98a));
}
.ot-btn-secondary {
    background: var(--ms-primary, #054f59);
}
.ot-btn-secondary:hover {
    filter: brightness(0.92);
}
.ot-btn-secondary:focus {
    --tw-ring-color: var(--ms-primary, #054f59);
}
.ot-input:focus {
    --tw-ring-color: var(--aps-teal, #00f5c4);
    box-shadow: 0 0 0 2px var(--aps-teal, #00f5c4);
}
.ot-back-link {
    color: var(--aps-link, var(--aps-teal, #004d4f));
}
.ot-back-link:hover {
    color: var(--ms-primary, #004d4f);
}

/* Template 01 — ensure track-order CTAs use orange/navy even without branding inject */
body.ms-forge .ot-icon {
    background: var(--ms-navy, #0F172A);
    color: var(--ms-orange, #FF6B00);
}
body.ms-forge .ot-accent {
    color: var(--ms-navy, #0F172A);
}
body.ms-forge .ot-badge {
    color: var(--ms-navy, #0F172A);
    background: color-mix(in srgb, var(--ms-orange, #FF6B00) 18%, transparent);
}
body.ms-forge .ot-btn-primary {
    background: var(--ms-orange, #FF6B00);
    color: #fff;
}
body.ms-forge .ot-btn-secondary {
    background: var(--ms-navy, #0F172A);
}
body.ms-forge .ot-input:focus {
    box-shadow: 0 0 0 2px var(--ms-orange, #FF6B00);
}
body.ms-forge .ot-back-link {
    color: var(--ms-orange, #FF6B00);
}
body.ms-forge .ot-back-link:hover {
    color: var(--ms-navy, #0F172A);
}
