/* EZ Corners: shared responsive overrides. Load after existing styles. */
.ez-home .ez-home-image {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.ez-home .ez-home-main {
    padding: 12px;
}

/* Preserve the existing colors, typography and product image styles. */
.ez-newitems .ez-products {
    width: 100%;
    max-width: 860px;
    margin: 24px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.ez-newitems .ez-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 12px;
    align-items: start;
}

.ez-newitems .ez-product {
    min-width: 0;
    text-align: center;
    overflow-wrap: break-word;
}

.ez-newitems .ez-product a {
    display: inline-block;
    max-width: 100%;
}

.ez-newitems .ez-product img {
    width: 200px;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    .ez-newitems .ez-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ez-newitems .ez-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ez-newitems .ez-products {
        margin: 16px auto;
        padding: 0 8px;
    }
    .ez-home .ez-home-main {
        padding: 8px;
    }
    .ez-home .ez-page,
    .ez-newitems .ez-page {
        height: auto;
    }
    /* Let header/content/footer follow the natural document flow. */
    .ez-home .ez-page > tbody > tr > td,
    .ez-newitems .ez-page > tbody > tr > td {
        height: auto;
    }
}

@media (max-width: 300px) {
    .ez-newitems .ez-product-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Touch screens don't need hover previews; links still open Highslide. */
@media (hover: none), (pointer: coarse) {
    .ez-newitems #mystickytooltip {
        display: none !important;
    }
}

/* Products (ezcorners.asp). Independent of the old fixed-width tab layout. */
.ez-catalog-page .ez-catalog {
    width: 100%;
    max-width: 860px;
    margin: 24px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.ez-catalog-page .ez-catalog-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.ez-catalog-page .ez-category {
    display: block;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #777;
    border-radius: 3px;
    color: #eee;
    background: #252525;
    font: inherit;
    text-align: center;
    text-decoration: none;
}

.ez-catalog-page .ez-category.active {
    color: #171717;
    background: #ffd700;
    border-color: #ffd700;
    font-weight: bold;
}

.ez-catalog-page .ez-category:hover,
.ez-catalog-page .ez-category:focus-visible {
    text-decoration: underline;
}

.ez-catalog-page .ez-catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ez-catalog-page .ez-catalog-grid > li {
    min-width: 0;
    margin: 0;
    padding: 0;
    text-align: center;
}

.ez-catalog-page .ez-catalog-grid .linkColumn {
    display: flex;
    width: 100%;
    min-height: 84px;
    aspect-ratio: 10 / 7;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.ez-catalog-page .ez-catalog-grid img {
    display: block;
    max-width: 100%;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    .ez-catalog-page .ez-catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ez-catalog-page .ez-catalog {
        margin: 16px auto;
        padding: 0 8px;
    }
    .ez-catalog-page .ez-category {
        flex: 1 1 42%;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .ez-catalog-page .ez-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ez-catalog-page .ez-page,
    .ez-catalog-page .ez-page > tbody > tr > td {
        height: auto;
    }
}

@media (max-width: 300px) {
    .ez-catalog-page .ez-catalog-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Directions (dir.asp), including when opened inside the homepage iframe. */
.ez-directions .ez-directions-content {
    max-width: 720px;
    margin: 0 auto;
    overflow-wrap: break-word;
}

.ez-directions .ez-directions-footer {
    margin: 32px auto 12px;
    text-align: center;
    overflow-wrap: break-word;
}

.ez-directions .ez-print-directions {
    margin-top: 24px;
}

@media (max-width: 600px) {
    body.ez-directions {
        margin: 0;
        padding: 12px;
        font-size: 16px;
        line-height: 1.5;
    }
    .ez-directions .ez-directions-content h2 {
        font-size: 18px;
        line-height: 1.3;
        margin-top: 0;
    }
    .ez-directions .ez-directions-content p {
        margin: 4px 0;
    }
    .ez-directions .ez-directions-content a {
        display: flex;
        align-items: center;
        min-height: 44px;
    }
    .ez-directions .ez-directions-content .ez-print-directions {
        margin-top: 16px;
    }
}

/* Shared header and footer. Existing site palette is preserved. */
.ez-site-header {
    max-width: 100%;
    padding: 8px 12px 4px;
    box-sizing: border-box;
    text-align: center;
}
.ez-site-title,
.ez-site-subtitle {
    line-height: 1.35;
    white-space: normal;
}
.ez-site-title a {
    overflow-wrap: anywhere;
}
.ez-site-subtitle {
    margin-top: 4px;
}
.ez-site-footer {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 12px;
    box-sizing: border-box;
    text-align: center;
}
.ez-site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 12px;
    margin-bottom: 12px;
}
.ez-site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 5px 6px;
    box-sizing: border-box;
    text-decoration: none;
}
/* Animated orange underline for footer navigation. The current page is marked
   in footer.inc using aria-current="page". Existing links remain unchanged. */
.ez-site-nav a,
.ez-site-nav a:link,
.ez-site-nav a:visited {
    position: relative;
    color: #f5f5f5;
    text-decoration: none;
    transition: color 220ms ease;
}
.ez-site-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background-color: #ffa500;
    transform: translateX(-50%);
    transition: width 250ms ease;
    pointer-events: none;
}
.ez-site-nav a:hover,
.ez-site-nav a:focus-visible,
.ez-site-nav a[aria-current="page"] {
    color: #ffa500;
    text-decoration: none;
}
.ez-site-nav a:hover::after,
.ez-site-nav a:focus-visible::after,
.ez-site-nav a[aria-current="page"]::after {
    width: calc(100% - 12px);
}
.ez-site-nav a:focus-visible {
    outline: 2px solid #ffa500;
    outline-offset: 2px;
    border-radius: 3px;
}
@media (prefers-reduced-motion: reduce) {
    .ez-site-nav a,
    .ez-site-nav a::after {
        transition: none;
    }
}
.ez-site-contact {
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.ez-site-contact a,
.ez-site-contact a:visited {
    color: #c0c0c0;
}
.ez-site-contact a:hover,
.ez-site-contact a:focus-visible {
    color: gold;
}
.ez-footer-rule {
    border: 0;
    border-top: 1px solid #c0c0c0;
    margin: 0 0 12px;
}
/* Directions lives on a white background; keep secondary footer readable. */
.ez-directions .ez-site-contact {
    color: #454545;
}
.ez-directions .ez-site-contact a,
.ez-directions .ez-site-contact a:visited {
    color: #145a88;
}
/* This rule makes the old thumbnail gallery scroll *inside* its container,
   rather than stretching the whole mobile viewport. No desktop behavior change. */
@media (max-width: 700px) {
    .photo {
        max-width: 100%;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .photo ul.topic {
        min-width: 635px;
    }
}
@media (max-width: 600px) {
    .ez-site-header {
        padding: 12px 8px 6px;
    }
    .ez-site-title.pageHeader {
        font-size: 24px;
    }
    .ez-site-subtitle.pageSubHeader {
        font-size: 13px;
    }
    .ez-site-footer {
        padding: 14px 8px;
    }
    .ez-site-nav {
        gap: 6px;
    }
    .ez-site-nav a {
        flex: 1 1 42%;
        min-height: 44px;
        padding: 8px 4px;
    }
    body.ez-home,
    body.ez-newitems,
    body.ez-catalog-page {
        font-size: 14px;
    }
    .ez-site-contact {
        font-size: 14px;
        line-height: 1.65;
    }
    .ez-contact-divider {
        display: none;
    }
}

/* Product and sample detail popups (shw.asp, shwit.asp, smpl.asp).
   These classes are on the content wrapper, not only body, because Highslide
   may insert just the AJAX response body into an existing page. */
body.ez-detail-page {
    margin: 0;
    background: #fff;
}
.ez-product-detail,
.ez-sample-detail {
    box-sizing: border-box;
    width: 100%;
    max-width: 760px;
    min-width: 0;
    margin: 0 auto;
    padding: 14px;
    background: #fff;
    color: #222;
    font: 14px/1.5 Verdana, Arial, sans-serif;
    overflow-wrap: anywhere;
}
.ez-product-detail .ez-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}
.ez-detail-image-wrap,
.ez-detail-information,
.ez-sample-image-wrap {
    min-width: 0;
}
.ez-product-detail .ez-detail-image,
.ez-sample-detail .ez-sample-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
}
.ez-product-detail .ez-detail-image {
    max-height: 320px;
}
.ez-sample-detail .ez-sample-image {
    max-height: 75vh;
}
.ez-product-detail .ez-detail-list {
    margin: 0;
    padding-left: 20px;
}
.ez-product-detail .ez-detail-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}
.ez-product-detail .ez-detail-note {
    margin-top: 16px;
    text-align: center;
    line-height: 1.5;
}
.ez-product-detail .ez-detail-missing {
    color: #333;
    text-align: center;
}
.ez-sample-detail .ez-sample-description {
    text-align: center;
    line-height: 1.5;
}
.ez-sample-detail .ez-sample-rule {
    border: 0;
    border-top: 1px solid #c0c0c0;
    margin: 12px 0 18px;
}
.ez-product-detail .ez-detail-footer,
.ez-sample-detail .ez-detail-footer {
    margin-top: 16px;
    text-align: center;
}
/* Improve footer contrast when a detail is opened directly on white. */
.ez-product-detail .ez-site-contact,
.ez-sample-detail .ez-site-contact {
    color: #454545;
}
.ez-product-detail .ez-site-contact a,
.ez-product-detail .ez-site-contact a:visited,
.ez-sample-detail .ez-site-contact a,
.ez-sample-detail .ez-site-contact a:visited {
    color: #145a88;
}
@media (max-width: 600px) {
    .ez-product-detail,
    .ez-sample-detail {
        padding: 12px;
        font-size: 15px;
    }
    .ez-product-detail .ez-detail-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .ez-product-detail .ez-detail-image {
        max-height: 38vh;
    }
    .ez-product-detail .ez-detail-list li {
        margin-bottom: 8px;
    }
}
