/*
 * Responsive commerce polish (2026-08-06).
 * Shared verbatim between CanCork and iCorkFloor.
 */

/* Product archives should start with products. Supporting buying guides stay
   in the document immediately after the result set. */
.woocommerce-page.archive .shop-container {
    display: flex;
    flex-direction: column;
}

.woocommerce-page.archive .shop-container > .woocommerce-notices-wrapper {
    order: 0;
}

.woocommerce-page.archive .shop-container > .products {
    order: 1;
}

.woocommerce-page.archive .shop-container > .container {
    order: 2;
}

.woocommerce-page.archive .shop-container > .page-load-status {
    order: 3;
}

.woocommerce-page.archive .shop-container > .cork-sample-funnel--archive {
    order: 4;
    margin-top: 32px;
}

.woocommerce-page.archive .shop-container > .cancork-google-answer-snapshot {
    order: 5;
}

.woocommerce-page.archive .shop-container > .cancork-seo-conversion-path {
    order: 6;
}

.woocommerce-page.archive .shop-container > .cancork-google-seo-faq {
    order: 7;
}

/* Stretch every product card to the height of its row. Quick-sample actions
   are direct children of .col-inner, so a flex column is required here. */
.home .products > .product-small,
.woocommerce-page.archive .products > .product-small,
.woocommerce-page.search-results .products > .product-small {
    display: flex;
    flex-direction: column;
}

.home .products > .product-small > .col-inner,
.woocommerce-page.archive .products > .product-small > .col-inner,
.woocommerce-page.search-results .products > .product-small > .col-inner {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.home .products > .product-small > .col-inner > .product-small.box,
.woocommerce-page.archive .products > .product-small > .col-inner > .product-small.box,
.woocommerce-page.search-results .products > .product-small > .col-inner > .product-small.box {
    flex: 1 1 auto;
    width: 100%;
}

.woocommerce-page.archive .products .product-small .box-image,
.woocommerce-page.search-results .products .product-small .box-image {
    width: 100%;
}

/* PDP small-print stays intentionally quiet while meeting WCAG AA. */
body.single-product .cork-box-price-line del {
    color: #55636d !important;
}

body.single-product .related-accessories-section #bundle-summary del {
    color: #4d5b65 !important;
    opacity: 1 !important;
}

body.cork-pdp-lower-v2 .cork-pdp-fact-grid dt {
    color: #52616b !important;
}

body.single-product .related-accessories-section .cork-install-kit-heading h2 {
    margin: 0 !important;
    color: var(--color-primary, #0b2f4b) !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
}

/* Checkout helper text and optional controls meet WCAG AA at their small
   rendered sizes. The optional-field trigger is a real keyboard button. */
body.woocommerce-checkout .cwl-toggle-link {
    min-height: 44px;
    margin: -4px 0 8px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: #6f4b12 !important;
    font: inherit;
    font-size: 12px;
    letter-spacing: normal;
    line-height: 1.35;
    text-align: left;
    text-decoration: underline;
    text-transform: none;
    box-shadow: none;
}

body.woocommerce-checkout .cwl-toggle-link:focus-visible {
    outline: 3px solid #236a8d;
    outline-offset: 2px;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table .quantity-unit-label {
    color: #56636d !important;
}

body.woocommerce-checkout .shipping-estimate {
    color: #52616b !important;
}

body.woocommerce-checkout label.shipping__list_label {
    opacity: 1;
}

body.woocommerce-checkout .cfs-progress-note {
    color: #526578 !important;
}

body.woocommerce-checkout .wc_payment_method > label > span[style*="#27ae60"] {
    color: #14733e !important;
}

/* iPad Safari also zooms focused controls below 16px in landscape, where the
   viewport is wider than the theme's tablet breakpoint. */
@media (hover: none) and (pointer: coarse) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }

    body.single-product #cfc-calculator-wrapper .cfc-calculation-entry .cfc-area-input,
    body.single-product #cfc-calculator-wrapper .cfc-calculation-entry .cfc-qty-display {
        font-size: 16px !important;
    }
}

@media (max-width: 849px) {
    /* Keep the brand optically centered between the viewport edges rather
       than between unequal menu and cart columns. */
    #header .header-main .header-inner {
        position: relative;
    }

    #header .header-main #logo {
        position: absolute;
        z-index: 1;
        top: 50%;
        left: 50%;
        width: min(190px, calc(100% - 132px));
        margin: 0 !important;
        transform: translate(-50%, -50%);
    }

    #header .header-main #logo > a {
        justify-content: center;
        width: 100%;
    }

    #header .header-main #logo img {
        max-width: 100% !important;
    }

    #header .header-main .show-for-medium.flex-left,
    #header .header-main .show-for-medium.flex-right {
        position: relative;
        z-index: 2;
    }

    /* One aligned catalog control row instead of a narrow centered sort box. */
    .woocommerce-page.archive .shop-page-title .woocommerce-ordering,
    .woocommerce-page.search-results .shop-page-title .woocommerce-ordering {
        display: block !important;
        width: 100%;
        margin: 8px 0 0;
    }

    .woocommerce-page.archive .shop-page-title .woocommerce-ordering select,
    .woocommerce-page.search-results .shop-page-title .woocommerce-ordering select {
        width: 100%;
        min-height: 44px;
    }

    /* iOS zooms focused controls below 16px. */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Header controls remain comfortably tappable without growing the header. */
    #header .header-main a.icon.button.round,
    #header .header-main .header-cart-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
    }

    #header #logo > a {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    .cork-home-hero-shell .button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
    }

    body.home .cork-hero-event a,
    body.woocommerce-page .woocommerce-breadcrumb a,
    body.woocommerce-page.archive .breadcrumbs a,
    body.single-product .breadcrumbs a,
    body.woocommerce-page .breadcrumbs a.current {
        display: inline-flex !important;
        align-items: center;
        min-height: 44px !important;
    }

    .woocommerce-page.archive .filter-button,
    .woocommerce-page.search-results .filter-button,
    body.single-product .flickity-prev-next-button,
    body.woocommerce-cart a.remove {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    /* Card controls are true touch targets, and two-column card copy stays
       readable without changing the established grid density. */
    .home .products .product-small .product-title a,
    .woocommerce-page.archive .products .product-small .product-title a,
    .woocommerce-page.search-results .products .product-small .product-title a {
        display: flex !important;
        align-items: center;
        min-height: 44px !important;
        font-size: 13px !important;
        line-height: 1.25;
    }

    .products .product-small .cork-card-meta {
        font-size: 11px;
        line-height: 1.3;
    }

    .products .product-small .cork-compare-toggle,
    .products .product-small .ts-quick-sample-btn {
        min-height: 44px !important;
    }

    .products .product-small .ts-quick-sample-btn {
        font-size: 12px;
    }

    /* Symmetric PDP gutters fix the 15px right-only gallery padding inherited
       from the parent theme. */
    body.single-product .product-gallery {
        padding-right: 15px !important;
        padding-left: 15px !important;
    }

    body.single-product .product-thumbnails {
        width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    body.single-product .product-info.summary {
        padding-right: 15px !important;
        padding-left: 15px !important;
    }

    body.single-product {
        padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    }

    body.single-product .cork-pdp-sticky-action:not([hidden]) {
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    body.single-product .cork-pdp-sticky-buttons button {
        min-height: 44px;
        font-size: 13px;
    }

    body.single-product #cfc-calculator-wrapper .cfc-calculation-entry .cfc-area-input,
    body.single-product #cfc-calculator-wrapper .cfc-calculation-entry .cfc-qty-display {
        font-size: 16px !important;
    }

    /* The checkout sidebar already contains its own bordered order card.
       Remove the parent's redundant 30px inset on phones. */
    body.woocommerce-checkout form.checkout .large-5.col > .col-inner.has-border {
        padding: 0 !important;
        border: 0 !important;
    }

    body.woocommerce-checkout .checkout-sidebar,
    body.woocommerce-checkout #order_review,
    body.woocommerce-checkout .woocommerce-checkout-review-order {
        width: 100% !important;
        max-width: none;
        margin-right: 0;
        margin-left: 0;
    }

    body.woocommerce-checkout #order_review,
    body.woocommerce-checkout .woocommerce-checkout-review-order {
        padding: 16px;
    }

    /* Keep the checkout's first screen focused on starting the form. */
    body.woocommerce-checkout .checkout-page-title,
    body.woocommerce-checkout .checkout-page-title .page-title-inner {
        min-height: 72px;
        height: 72px;
    }

    body.woocommerce-checkout .checkout-page-title .checkout-breadcrumbs {
        min-height: 56px;
        padding: 6px 0;
    }

    body.woocommerce-checkout .woocommerce-form-login-toggle .message-container,
    body.woocommerce-checkout .woocommerce-form-coupon-toggle .message-container {
        font-size: 14px;
        line-height: 1.35;
    }

    body.woocommerce-checkout #billing_email-description {
        display: block;
        margin-top: 6px;
        color: #52616c;
        font-size: 14px;
        line-height: 1.45;
    }

    /* Native disclosure controls keep secondary homepage and product content
       available without making phone pages needlessly long. */
    .cork-mobile-disclosure {
        width: 100%;
        margin: 12px 0 24px;
    }

    .cork-mobile-disclosure > summary {
        position: relative;
        display: flex;
        align-items: center;
        min-height: 48px;
        margin: 0 15px;
        padding: 12px 48px 12px 16px;
        border: 1px solid #d6e0e6;
        border-radius: 8px;
        background: #fff;
        color: #0b2f4b;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.35;
        cursor: pointer;
        list-style: none;
    }

    .cork-mobile-disclosure > summary::-webkit-details-marker {
        display: none;
    }

    .cork-mobile-disclosure > summary::after {
        position: absolute;
        top: 50%;
        right: 16px;
        content: "+";
        color: #946820;
        font-size: 24px;
        font-weight: 500;
        line-height: 1;
        transform: translateY(-52%);
    }

    .cork-mobile-disclosure[open] > summary::after {
        content: "\2212";
    }

    .cork-mobile-disclosure > summary:focus-visible {
        outline: 3px solid #236a8d;
        outline-offset: 3px;
    }

    .cork-mobile-disclosure--homepage_categories > .row {
        margin-top: 14px;
    }

    .cork-mobile-disclosure--homepage_reviews > section,
    .cork-mobile-disclosure--homepage_faq > section:first-of-type {
        margin-top: 14px;
    }

    body.cork-pdp-lower-v2 .product-page-sections > .cork-mobile-disclosure {
        margin: 0;
        border-top: 1px solid #dce4e9;
    }

    body.cork-pdp-lower-v2 .product-page-sections > .cork-mobile-disclosure > summary {
        margin: 0 15px;
        border: 0;
        border-radius: 0;
        padding-right: 40px;
        padding-left: 0;
        background: transparent;
        font-size: 17px;
    }

    body.cork-pdp-lower-v2 .cork-mobile-disclosure > .product-section {
        padding: 4px 0 18px;
        border: 0;
    }

    body.cork-pdp-lower-v2 .cork-mobile-disclosure > .product-section > .row {
        margin-right: 0;
        margin-left: 0;
    }

    body.cork-pdp-lower-v2 .cork-mobile-disclosure > .product-section > .row > .large-2 {
        display: none !important;
    }

    body.cork-pdp-lower-v2 .cork-mobile-disclosure > .product-section > .row > .large-10 {
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
    }

    /* Cart essentials appear first; the recovery prompt now follows the cart
       table and is intentionally compact at phone widths. */
    body.woocommerce-cart #cancork-email-capture {
        margin: 18px 0 4px !important;
        padding: 16px !important;
        text-align: left !important;
    }

    body.woocommerce-cart #cancork-email-capture > p {
        margin-bottom: 8px !important;
    }

    body.woocommerce-cart #cancork-email-capture > div {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: none !important;
    }

    body.woocommerce-cart #cancork-cart-email,
    body.woocommerce-cart #cancork-save-cart-btn {
        width: 100%;
        min-width: 0 !important;
        min-height: 44px;
        font-size: 16px !important;
    }

    body.woocommerce-cart .button-continue-shopping,
    body.woocommerce-cart .quantity .qty {
        min-height: 44px;
    }

    body.woocommerce-cart .quantity .qty {
        min-width: 44px;
    }

    /* Four footer promises become a compact 2x2 grid instead of four long
       full-width rows on every page. */
    .footer-wrapper .row.row-small > .col.medium-6.small-12.large-3 {
        flex-basis: 50%;
        max-width: 50%;
    }
}

@media (max-width: 359px) {
    #header #logo img {
        max-width: 176px;
    }
}
