/*
 * Door details page (door-item.jsp) redesign.
 * Loaded only by that page; every selector starts with .door-page so nothing
 * here can reach other pages, and so these rules win over the async-loaded
 * style.css regardless of load order.
 *
 * Sizes are in rem on purpose: the site scales the root font-size (18px base,
 * smaller on hi-dpi screens via script.js, 16px below 1280px), and the
 * .container width follows it. Desktop values are mockup px / 18, the
 * max-width blocks are mockup px / 16.
 */

.door-page .content {
    --yellow: #FFCA28;
    --dp-muted: #6F7480;
    --dp-icon: #AEB5C6;
    --dp-line: #E1E1E1;
}

/* ---------- Hero ---------- */

.door-page .dp-hero {
    padding-top: 0.5rem;
}

.door-page .dp-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 473fr) minmax(0, 743fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "gallery crumbs"
        "gallery info";
    column-gap: 3.556rem;
}

.door-page .dp-crumbs {
    grid-area: crumbs;
    font-family: var(--title) !important;
    font-weight: 500;
    color: var(--dp-muted);
    padding: 0 !important;
    margin: 0 0 0.556rem !important;
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

/* Each crumb is its own flex row so the text and the chevron share one centre line
   (the site-wide inline-block + baseline chevron sits a few px off). */
.door-page .dp-crumbs li {
    display: flex;
    align-items: center;
    /* style.css gives list items after the first a top margin; that was the 3px step. */
    margin: 0;
    flex: none;
    font-size: 1rem;
    line-height: 1.4;
}

.door-page .dp-crumbs li:not(:last-of-type):after {
    flex: none;
    vertical-align: middle;
}

.door-page .dp-crumbs li.current {
    color: var(--black);
    /* Fill the remaining width and ellipsis only on real overflow (no early cut-off). */
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
}

.door-page .dp-crumbs li.current span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.door-page .dp-gallery {
    grid-area: gallery;
    display: grid;
    grid-template-columns: 4.444rem minmax(0, 1fr);
    gap: 0.889rem;
    align-items: start;
    min-width: 0;
}

.door-page .dp-gallery-thumbs {
    display: grid;
    gap: 0.667rem;
}

.door-page .dp-gallery-thumb {
    display: block;
    width: 4.444rem;
    height: 6.111rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 0.222rem;
    background: var(--grey);
    overflow: hidden;
    cursor: pointer;
}

.door-page .dp-gallery-thumb.active {
    border-color: var(--blue);
}

.door-page .dp-gallery-thumb picture,
.door-page .dp-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.door-page .dp-gallery-stage {
    position: relative;
    grid-column: 2;
    border-radius: 0.222rem;
    overflow: hidden;
    background: var(--grey);
}

/* No thumbnails column when the door has a single photo. */
.door-page .dp-gallery-stage:first-child {
    grid-column: 1 / -1;
}

.door-page .dp-gallery-track {
    display: flex;
    aspect-ratio: 377 / 670;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.door-page .dp-gallery-track::-webkit-scrollbar {
    display: none;
}

.door-page .dp-gallery-slide {
    flex: 0 0 100%;
    display: block;
    height: 100%;
    scroll-snap-align: start;
    cursor: zoom-in;
}

.door-page .dp-gallery-slide picture,
.door-page .dp-gallery-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.door-page .dp-gallery-zoom {
    position: absolute;
    top: 0.778rem;
    right: 0.778rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.444rem;
    height: 2.444rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--blue);
    cursor: pointer;
}

.door-page .dp-gallery-count,
.door-page .dp-gallery-dots {
    display: none;
}

.door-page .dp-info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.door-page .dp-title {
    font-family: var(--title);
    font-size: 2.222rem;
    font-weight: 500;
    line-height: 1.1;
    color: var(--blue);
    margin: 0 0 0.556rem;
}

.door-page .dp-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.889rem;
    margin-bottom: 0.778rem;
    /* Everything from the SKU row down is pinned to the bottom edge of the photo;
       the free space above it belongs to the title, so a longer title grows into
       it instead of pushing the blocks around. */
    margin-top: auto;
}

.door-page .dp-sku {
    font-size: 1rem;
    color: var(--dp-muted);
}

.door-page .dp-sku strong {
    font-weight: 400;
    color: var(--black);
    margin-left: 2px;
}

/* Click the SKU to copy it (hero + related cards); brief "Copied" tooltip. */
.door-page .sku-inner {
    position: relative;
    cursor: pointer;
}

.door-page .sku-inner.is-copied::after {
    content: 'Copied';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.278rem);
    transform: translateX(-50%);
    padding: 0.167rem 0.444rem;
    border-radius: 0.222rem;
    background: var(--blue);
    color: var(--white);
    font-size: 0.722rem;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
}

.door-page .dp-fav-group {
    display: flex;
    gap: 0.444rem;
}

.door-page .dp-fav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.667rem;
    height: 2.667rem;
    padding: 0;
    border: 1px solid var(--dp-line);
    border-radius: 0.222rem;
    background: var(--white);
    color: var(--black);
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.door-page .dp-fav:hover {
    border-color: var(--blue);
}

/* Active state: filled icon, red heart / blue bookmark. */
.door-page .dp-fav.added {
    color: #B23A36;
}

.door-page .dp-fav.added[data-dp-fav="bookmark"] {
    color: #3478F6;
}

.door-page .dp-fav.added svg {
    fill: currentColor;
}

.door-page .dp-cta {
    display: block;
    width: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0.222rem;
    font-size: 1.111rem !important;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    margin-bottom: 0.778rem;
    height: 3.111rem;
    padding: 0;
}

.door-page .dp-google {
    display: flex;
    align-items: center;
    gap: 1.111rem;
    min-height: 7.333rem;
    padding: 1.111rem 1.556rem;
    border-radius: 0.222rem;
    background: var(--white);
    color: var(--black);
    text-decoration: none;
    margin-bottom: 0.778rem;
}

.door-page .dp-google-logo {
    flex: none;
}

.door-page .dp-google-rating {
    font-family: var(--title);
    font-size: 4.889rem;
    font-weight: 600;
    line-height: 1;
    color: var(--blue);
}

.door-page .dp-google-rating-row {
    display: flex;
    align-items: center;
    gap: 0.667rem;
}

.door-page .dp-google-stars {
    display: flex;
    gap: 0.5rem;
    color: #FBB400;
}

.door-page .dp-google-count {
    font-size: 1.111rem;
    font-weight: 400;
    line-height: 1;
    color: var(--dp-muted);
}

.door-page .dp-google-label {
    display: block;
    font-size: 1.222rem;
    line-height: 1.3;
    color: var(--dp-muted);
}

.door-page .dp-google-link {
    margin-left: auto;
    font-size: 0.889rem;
    color: var(--blue);
    text-decoration: underline;
    white-space: nowrap;
}

.door-page .dp-google:hover .dp-google-link {
    text-decoration: none;
}

.door-page .dp-benefits,
.door-page .dp-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.444rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.door-page .dp-benefits li,
.door-page .dp-stats li {
    position: relative;
    margin: 0;
    border-radius: 0.222rem;
    background: var(--white);
}

.door-page .dp-benefits li {
    padding: 0.667rem 2.889rem 0.667rem 0.889rem;
}

.door-page .dp-benefits strong {
    display: block;
    font-size: 1.556rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--blue);
}

/* Benefit titles: one line on desktop, always two lines on phones (regardless of
   screen width) so every card's title is consistent. The break is mobile-only. */
.door-page .dp-benefit-br {
    display: none;
}

.door-page .dp-benefits span {
    display: block;
    font-size: 0.833rem;
    color: var(--dp-muted);
}

.door-page .dp-benefits svg,
.door-page .dp-stats svg,
.door-page .dp-benefit-icon,
.door-page .dp-stat-icon {
    position: absolute;
    top: 0.778rem;
    right: 0.889rem;
    color: var(--dp-icon);
}

/* ---------- Yellow quote form (shared fragment, restyled here only) ---------- */

.door-page .section-request-form.dp-quote {
    margin: 3.333rem 0 5.556rem;
}

.door-page .dp-quote .request-form {
    padding: 2.444rem 3.333rem 1.556rem;
    border-radius: 0.222rem;
    background-color: var(--yellow);
    color: var(--black);
}

.door-page .dp-quote .request-form > .title {
    font-family: var(--title);
    font-size: 2.222rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.111rem !important;
}

.door-page .dp-quote .request-form-inner {
    display: grid;
    grid-template-columns: minmax(0, 380fr) minmax(0, 380fr) minmax(0, 360fr);
    gap: 1.111rem;
    align-items: start;
    margin-bottom: 0.778rem;
}

.door-page .dp-quote .form-group {
    margin: 0;
}

.door-page .dp-quote .form-group input {
    width: 100%;
    height: 3.111rem;
    padding: 0 0.778rem;
    border: 1px solid var(--white);
    border-radius: 2px;
    background: var(--white);
    font-size: 1rem;
}

.door-page .dp-quote .form-group input.invalid {
    border-color: var(--red);
}

.door-page .dp-quote .form-group-message {
    color: var(--d-red);
}

.door-page .dp-quote .btn-wrapper {
    margin: 0;
}

.door-page .dp-quote .btn {
    min-height: 3.111rem;
    padding-top: 0;
    padding-bottom: 0;
    border-radius: 2px;
    font-size: 1.111rem;
    font-weight: 700;
}

/* Privacy / cookies note hidden on the door-detail page's quote forms only
   (the shared fragment keeps it everywhere else; the quote modal keeps its own). */
.door-page .dp-quote .form-notation {
    display: none !important; /* beat the .d-block utility on the note span */
}

/* ---------- About / specs / stats ---------- */

.door-page .title-line {
    background-color: #DADADA;
    display: flex;
    align-items: center;
    min-height: 3.944rem;
    padding: 0.583rem 0;
    margin-bottom: 2.444rem;
}

.door-page .title-line .container {
    width: 100%;
}

.door-page .title-line .title {
    font-weight: 500;
    color: var(--black);
    font-size: 2.111rem;
    line-height: 1.1;
}

.door-page .title-line .btn {
    text-transform: none;
    width: 22.222rem;
    max-width: 100%;
    min-height: 2.778rem;
    padding: 0 0.889rem !important;
    font-size: 1.111rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 2.778rem;
}

.door-page .dp-about > .title-line {
    margin-top: 0;
}

.door-page .dp-about-content {
    max-width: 57.778rem;
    line-height: 1.5;
}

/* Tag chips (door categories) under the description */
.door-page .dp-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.444rem;
    margin: 1.778rem 0 0;
    padding: 0;
    list-style: none;
}

.door-page .dp-tags li {
    margin: 0;
    padding: 0;
}

.door-page .dp-tags li::before {
    content: none;
}

.door-page .dp-tag {
    display: block;
    padding: 0.389rem 0.778rem;
    border: 1px solid #DBDEE5;
    border-radius: var(--brs);
    background-color: var(--white);
    color: var(--blue);
    font-family: var(--font);
    font-size: 0.889rem;
    font-weight: 500;
    line-height: 1.255;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .2s, background-color .2s;
}

.door-page .dp-tag:hover,
.door-page .dp-tag:focus-visible {
    border-color: var(--blue);
    background-color: var(--l-grey);
    color: var(--blue);
}

.door-page .dp-spec {
    margin-top: 4rem;
}

.door-page .dp-spec .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.111rem;
    align-items: start;
}

.door-page .dp-spec .single-about-spec-table + .single-about-spec-table {
    margin-top: 2.222rem;
}

.door-page .dp-spec .title-bordered {
    margin-top: 0;
    margin-bottom: 1.889rem;
    font-size: 1.667rem;
}

.door-page .dp-spec table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.door-page .dp-spec table td {
    height: 3.667rem;
    padding: 0.556rem 1.111rem;
    border: 1px solid var(--black);
    background: transparent;
    font-size: 1rem;
    font-weight: 400;
    text-align: left;
    vertical-align: middle;
    word-break: break-word;
}

.door-page .dp-stats {
    margin-top: 4rem;
}

.door-page .dp-stats li {
    padding: 0.889rem 3.556rem 1.111rem 1.111rem;
    min-height: 6.667rem;
}

.door-page .dp-stats strong {
    display: block;
    font-family: var(--title);
    font-size: 2.444rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--green);
}

.door-page .dp-stats span {
    display: block;
    font-size: 1rem;
    color: var(--dp-muted);
}

.door-page .dp-stats svg,
.door-page .dp-stat-icon {
    top: 1rem;
    right: 1.222rem;
}

/* Second quote form sits tighter under the stats tiles. */
.door-page .dp-about .section-request-form.dp-quote {
    margin-top: 2.222rem;
}

.door-page .dp-about .config .title-bordered {
    font-size: 2rem;
}

.door-page .dp-about .config {
    margin-bottom: 0;
}

/* ---------- Related doors ---------- */

.door-page .dp-related .grid-4 {
    row-gap: 1.111rem;
}

/* ---------- Quote popup ---------- */

.door-page .dp-modal.fancybox__content {
    max-width: 32.222rem;
    padding: 0;
    border-radius: 0.222rem;
    background: var(--yellow, #FFCA28);
}

.door-page .dp-modal > .f-button.is-close-btn {
    --f-button-color: var(--black);
    --f-button-hover-color: var(--black);
    top: 0.444rem;
    right: 0.444rem;
    color: var(--black);
    opacity: 1;
}

.door-page .dp-modal .modal-inner {
    padding: 2.222rem 3.333rem 2rem;
    background: #FFCA28;
    color: var(--black);
}

.door-page .dp-modal .title {
    display: block;
    font-family: var(--title);
    font-size: 1.667rem;
    font-weight: 600;
    margin-bottom: 1.111rem;
}

.door-page .dp-modal .form-group {
    margin-bottom: 1.111rem;
}

.door-page .dp-modal .form-group input {
    width: 100%;
    height: 3.111rem;
    padding: 0 0.778rem;
    border: 1px solid var(--white);
    border-radius: 2px;
    background: var(--white);
    font-size: 1rem;
}

.door-page .dp-modal .form-group input.invalid {
    border-color: var(--red);
}

.door-page .dp-modal .btn-wrapper {
    margin: 0 0 0.667rem;
}

.door-page .dp-modal .btn {
    min-height: 3.111rem;
    border-radius: 2px;
    font-size: 1.111rem;
    font-weight: 700;
}

.door-page .dp-modal .form-notation {
    display: none !important; /* hide the privacy/terms note in this page's quote popup too */
}

/* ---------- Icon sizes (rem so they follow the root font-size scaling) ---------- */

.door-page .dp-gallery-zoom svg {
    width: 1.111rem;
    height: 1.111rem;
}

.door-page .dp-fav svg,
.door-page .dp-google-stars svg {
    width: 1.333rem;
    height: 1.333rem;
}

.door-page .dp-google-logo {
    width: 3.333rem;
    height: 3.333rem;
}

.door-page .dp-benefits svg {
    width: 1.444rem;
    height: 1.444rem;
}

.door-page .dp-stats svg {
    width: 2rem;
    height: 2rem;
}

/* Figma icon assets (img) keep their own aspect ratio: fix the height, auto width. */
.door-page .dp-benefit-icon {
    width: auto;
    height: 1.556rem;
}

.door-page .dp-stat-icon {
    width: auto;
    height: 2.111rem;
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
    .door-page .dp-hero-grid {
        column-gap: 2rem;
    }

    .door-page .dp-google-rating {
        font-size: 3.5rem;
    }

    .door-page .dp-google-logo {
        width: 2.75rem;
        height: 2.75rem;
    }

    .door-page .dp-quote .request-form {
        padding: 2rem 2rem 1.5rem;
    }
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
    .door-page .dp-hero {
        padding-top: 0.25rem;
    }

    .door-page .dp-hero .container,
    .door-page .dp-about > .container,
    .door-page .dp-quote .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .door-page .dp-hero-grid {
        display: flex;
        flex-direction: column;
    }

    /* Show the full breadcrumb trail on mobile (Main page › Exterior Doors › current),
       not just the collapsed "‹ Exterior Doors" back link; breathing room above and
       below so the links clear the header and the photo and stay easy to tap. */
    .door-page .dp-crumbs {
        margin: 0.625rem 0 0.75rem !important;
    }

    .door-page .dp-gallery {
        display: block;
    }

    .door-page .dp-gallery-thumbs,
    .door-page .dp-gallery-zoom {
        display: none;
    }

    .door-page .dp-gallery-track {
        aspect-ratio: 358 / 559;
    }

    .door-page .dp-gallery-count {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        display: block;
        padding: 0.25rem 0.625rem;
        border-radius: 999px;
        background: rgba(38, 38, 38, .75);
        font-size: 0.812rem;
        color: var(--white);
        pointer-events: none;
    }

    .door-page .dp-gallery-dots {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0.75rem;
        display: flex;
        justify-content: center;
        gap: 0.375rem;
        pointer-events: none;
    }

    .door-page .dp-gallery-dots span {
        width: 0.375rem;
        height: 0.375rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, .55);
    }

    .door-page .dp-gallery-dots span.active {
        width: 0.5rem;
        height: 0.5rem;
        margin-top: -1px;
        background: var(--white);
    }

    .door-page .dp-title {
        font-size: 1.75rem;
        line-height: 1.18;
        margin: 1.25rem 0 1rem;
    }

    /* Mockup order on phones: title, GET PRICE, then the SKU row. */
    .door-page .dp-cta {
        order: 1;
        height: 3.25rem;
        font-size: 1.125rem !important;
        margin-bottom: 1rem;
    }

    .door-page .dp-meta {
        order: 2;
        margin-bottom: 1rem;
    }

    .door-page .dp-google {
        order: 3;
        gap: 0.75rem;
        min-height: 0;
        padding: 0.875rem 1rem;
        margin-bottom: 1rem;
    }

    .door-page .dp-google-logo {
        width: 2.75rem;
        height: 2.75rem;
    }

    .door-page .dp-google-rating {
        font-size: 3.25rem;
    }

    .door-page .dp-google-stars {
        gap: 0.188rem;
    }

    .door-page .dp-google-stars svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    .door-page .dp-google-label {
        font-size: 1rem;
    }

    .door-page .dp-google-link {
        display: none;
    }

    .door-page .dp-benefits {
        order: 4;
    }

    .door-page .dp-benefits li {
        padding: 0.75rem 2.75rem 0.75rem 0.875rem;
    }

    .door-page .dp-benefits strong {
        font-size: 1.188rem;
    }

    .door-page .dp-benefit-br {
        display: inline;
    }

    .door-page .dp-benefits span {
        font-size: 0.812rem;
    }

    .door-page .dp-benefits svg,
    .door-page .dp-stats svg {
        top: 0.75rem;
        right: 0.75rem;
        width: 1.375rem;
        height: 1.375rem;
    }

    .door-page .dp-benefit-icon,
    .door-page .dp-stat-icon {
        top: 0.75rem;
        right: 0.75rem;
        width: auto;
        height: 1.5rem;
    }

    .door-page .section-request-form.dp-quote,
    .door-page .dp-about .section-request-form.dp-quote {
        margin: 2rem 0;
    }

    .door-page .title-line {
        min-height: 0;
        padding: 0.75rem 0;
        margin-bottom: 1.5rem;
    }

    .door-page .title-line .title {
        font-size: 1.625rem;
    }

    .door-page .title-line .btn {
        width: auto;
        min-height: 2.5rem;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
        line-height: 1.2;
        white-space: normal;
    }

    .door-page .dp-about .config .title-bordered,
    .door-page .dp-spec .title-bordered {
        font-size: 1.5rem;
    }

    .door-page .dp-quote .request-form {
        padding: 1.5rem 1.25rem 1.125rem;
    }

    .door-page .dp-quote .request-form > .title {
        font-size: 1.625rem;
        margin-bottom: 0.875rem !important;
    }

    .door-page .dp-quote .request-form-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }

    .door-page .dp-spec,
    .door-page .dp-stats {
        margin-top: 2.5rem;
    }

    .door-page .dp-spec .grid-2 {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.5rem;
    }

    .door-page .dp-spec table td {
        height: 3.25rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.938rem;
    }

    .door-page .dp-stats li {
        padding: 0.75rem 2.5rem 0.875rem 0.875rem;
        min-height: 0;
    }

    .door-page .dp-stats span {
        font-size: 0.875rem;
    }

    .door-page .dp-modal .modal-inner {
        padding: 2.25rem 1.25rem 1.5rem;
    }

    .door-page .dp-modal .title {
        font-size: 1.5rem;
    }
}
