/* ============================================================
   The Cover Company Photo Search v3.6.1-us — Stylesheet
   thecovercompanystore.com
   ============================================================ */


/* ── Trigger button ─────────────────────────────────────── */

#cps-trigger.cps-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1A5276;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1;
    vertical-align: middle;
    position: relative;
    margin-left: 8px; /* space from search bar */
    white-space: nowrap;
}

#cps-trigger.cps-trigger-btn:hover {
    background: #154360;
}

/* Beta badge */
.cps-beta-badge {
    display: inline-block;
    background: #E67E22;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1.4;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 2px;
}

/* Search input fills whatever space the form gives it after the camera button */
form.woocommerce-product-search input[type="search"],
form[role="search"] input[type="search"],
form.search-form input[type="search"],
form.searchform input[type="search"] {
    flex: 1 1 auto !important;
    min-width: 80px  !important;
    max-width: none  !important;
    width: auto      !important;
    box-sizing: border-box !important;
}

/* Form grows to fill flex parent (parent is expanded by JS) */
form.woocommerce-product-search,
form[role="search"],
form.search-form,
form.searchform {
    flex: 1 1 auto !important;
}

@media (max-width: 480px) {
    .cps-btn-label {
        display: none; /* icon only on mobile */
    }
    .cps-beta-badge {
        display: none;
    }
}


/* ── Modal overlay + box ────────────────────────────────── */

.cps-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cps-modal[hidden] {
    display: none;
}

.cps-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.cps-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 94%;
    max-width: 680px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 24px 24px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}


/* ── Modal header ───────────────────────────────────────── */

.cps-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}

.cps-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #1A5276;
    margin: 0;
    line-height: 1.3;
}

.cps-close-btn {
    background: none;
    border: none;
    font-size: 26px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.cps-close-btn:hover { color: #222; }


/* ── Upload zone ────────────────────────────────────────── */

.cps-upload-zone {
    border: 2px dashed #A9CCE3;
    border-radius: 10px;
    background: #EBF5FB;
    padding: 32px 20px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.cps-upload-zone.cps-drag-over {
    border-color: #1A5276;
    background: #D6EAF8;
}

.cps-upload-label {
    font-size: 16px;
    font-weight: 600;
    color: #2C3E50;
    margin: 12px 0 4px;
}

.cps-upload-sub {
    font-size: 14px;
    color: #999;
    margin: 4px 0 10px;
}

.cps-file-label {
    display: inline-block;
    background: #1A5276;
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cps-file-label:hover { background: #154360; }

.cps-upload-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 10px;
    line-height: 1.6;
}


/* ── Crop zone ──────────────────────────────────────────── */

.cps-crop-zone {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cps-crop-hint {
    font-size: 13px;
    color: #555;
    background: #EBF5FB;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cps-cropper-wrapper {
    max-height: 340px;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
}

/* Cropper.js canvas stays within the box */
.cps-cropper-wrapper img {
    display: block;
    max-width: 100%;
}

/* Cropper.js crop-box style: dashed blue border like face recognition */
.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

.cropper-view-box {
    outline: 2.5px solid #1A5276;
    outline-color: rgba(26, 82, 118, 0.85);
}

.cropper-point {
    background-color: #1A5276;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.cropper-dashed {
    border-color: rgba(26, 82, 118, 0.5);
}

.cps-crop-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.cps-link-btn {
    background: none;
    border: none;
    color: #1A5276;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.cps-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #1A5276;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.cps-search-btn:hover { background: #154360; }


/* ── Loading ────────────────────────────────────────────── */

.cps-loading-zone {
    text-align: center;
    padding: 40px 0;
    color: #555;
    font-size: 14px;
}

.cps-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #D6EAF8;
    border-top-color: #1A5276;
    border-radius: 50%;
    animation: cps-spin 0.75s linear infinite;
    margin: 0 auto 14px;
}

@keyframes cps-spin {
    to { transform: rotate(360deg); }
}


/* ── Results ────────────────────────────────────────────── */

.cps-results-zone {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Top row: thumbnail + tawk section side by side */
.cps-results-top {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #F8F9FA;
    border-radius: 10px;
    padding: 14px 16px;
}

.cps-result-thumb-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cps-result-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: block;
}

/* Tawk section */
.cps-tawk-section {
    flex: 1;
    text-align: center;
}

.cps-tawk-heading {
    font-size: 15px;
    font-weight: 700;
    color: #2C3E50;
    margin: 0 0 12px;
    line-height: 1.4;
}

.cps-tawk-btn {
    display: inline-block;
    background: #A8D335;       /* lime green matching the screenshot */
    color: #1C1C1C;
    border: none;
    border-radius: 8px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    max-width: 240px;
}

.cps-tawk-btn:hover {
    background: #96BF2E;
    transform: translateY(-1px);
}

/* Detected labels (legacy v2 — kept for safety) */
.cps-detected-label {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin: 0;
}

.cps-detected-label strong {
    color: #1A5276;
}

/* v3: Friendly sentence headline above the results grid */
.cps-friendly-sentence {
    font-size: 17px;
    font-weight: 600;
    color: #1A5276;
    text-align: center;
    margin: 0 0 4px;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .cps-friendly-sentence {
        font-size: 15px;
    }
}

/* v3 follow-up: small grey disclaimer below the friendly sentence */
.cps-fit-disclaimer {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin: 0 0 6px;
    font-style: italic;
}

@media (max-width: 600px) {
    .cps-fit-disclaimer {
        font-size: 11px;
    }
}

/* Product grid — 12 items, 4 per row on desktop */
.cps-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.cps-product-card {
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
}

.cps-product-card:hover {
    box-shadow: 0 4px 16px rgba(26, 82, 118, 0.15);
    transform: translateY(-2px);
}

.cps-product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

.cps-product-info {
    padding: 8px 9px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cps-product-name {
    font-size: 12px;
    font-weight: 600;
    color: #2C3E50;
    line-height: 1.3;
}

.cps-product-price {
    font-size: 12px;
    color: #1A5276;
    font-weight: 700;
    margin-top: auto;
}

.cps-product-price del {
    color: #bbb;
    font-weight: 400;
    margin-right: 3px;
}

/* No results */
.cps-no-results {
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 10px 0;
    margin: 0;
}

/* Browse fallback */
.cps-browse-fallback {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.cps-browse-link {
    font-size: 14px;
    color: #1A5276;
    text-decoration: none;
    font-weight: 600;
}

.cps-browse-link:hover { text-decoration: underline; }


/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
    .cps-modal-box {
        padding: 18px 14px 16px;
    }

    .cps-modal-title {
        font-size: 16px;
    }

    .cps-results-top {
        flex-direction: column;
        text-align: center;
    }

    .cps-result-thumb {
        width: 80px;
        height: 80px;
    }

    /* 2 columns on small phones */
    .cps-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cps-cropper-wrapper {
        max-height: 260px;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    /* 3 columns on tablet */
    .cps-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ── Custom covers section ──────────────────────────────── */

.cps-custom-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px dashed #d0dce8;
}

.cps-custom-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.cps-custom-title {
    font-size: 14px;
    font-weight: 700;
    color: #1A5276;
}

.cps-custom-view-all {
    font-size: 12px;
    font-weight: 600;
    color: #1A5276;
    text-decoration: underline;
    white-space: nowrap;
}

.cps-custom-view-all:hover {
    color: #154360;
}

/* Custom Made badge — overlays top-left of product image */
.cps-custom-card {
    position: relative;
}

.cps-custom-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #1A5276;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 1;
    pointer-events: none;
}

/* ─────────────────────────────────────────────
 *  SHOP BY SHAPE landing (lives in WooCommerce
 *  category description: patio-covers-by-shape).
 *  Tiles layout + hide WooCommerce no-products
 *  notice and product-listing chrome on this
 *  one category only.
 * ───────────────────────────────────────────── */
.cps-sbs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-gap: 40px;
    max-width: 1065px;
    margin: 0 auto 60px;
    padding: 30px 15px 0;
}
@media (max-width: 1100px) { .cps-sbs-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 767px)  { .cps-sbs-grid { grid-template-columns: 1fr 1fr; grid-gap: 30px; } }
@media (max-width: 600px)  { .cps-sbs-grid { grid-template-columns: 1fr; grid-gap: 30px; } }
.cps-sbs-tile { text-align: center; }
.cps-sbs-tile .cps-sbs-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid rgba(136,192,0,.2);
    border-radius: 1px;
    background: #ffffff;
}
.cps-sbs-tile .cps-sbs-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
    background: #ffffff;
}
.cps-sbs-tile h3 {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    text-transform: uppercase;
    color: #333;
    text-align: center;
    margin: 10px 0 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #ccc;
}
.cps-sbs-tile h3 a { color: inherit; text-decoration: none; }
.cps-sbs-tile .cps-sbs-btn {
    display: inline-block !important;
    background: #4c9ae2 !important;
    color: #fff !important;
    border: 2px solid #4c9ae2;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 24px;
    border-radius: 3px;
    text-decoration: none !important;
    margin-top: 50px;
    transition: background 0.2s ease;
}
.cps-sbs-tile .cps-sbs-btn:hover { background: #3a85cc !important; border-color: #3a85cc; color: #fff !important; }

/* Hide WooCommerce empty-listing chrome ONLY on patio-covers-by-shape. */
body.tax-product_cat.term-patio-covers-by-shape .woocommerce-info,
body.tax-product_cat.term-patio-covers-by-shape .woocommerce-no-products-found,
body.tax-product_cat.term-patio-covers-by-shape ul.products,
body.tax-product_cat.term-patio-covers-by-shape .woocommerce-result-count,
body.tax-product_cat.term-patio-covers-by-shape .woocommerce-ordering,
body.tax-product_cat.term-patio-covers-by-shape nav.woocommerce-pagination,
body.term-patio-covers-by-shape .woocommerce-info,
body.term-patio-covers-by-shape .woocommerce-no-products-found,
body.term-patio-covers-by-shape ul.products,
body.term-patio-covers-by-shape .woocommerce-result-count,
body.term-patio-covers-by-shape .woocommerce-ordering,
body.term-patio-covers-by-shape nav.woocommerce-pagination {
    display: none !important;
}

/* The hero banner image is set as the background on the
 * <header class="woocommerce-products-header"> element, which contains the
 * term-description block (where the tile grid lives). Without an opaque
 * background, the hero image bleeds through behind the tiles. Give the
 * term-description a solid white background so the tiles sit on a clean
 * section below the hero, matching how product category pages look. */
/* Cap the hero banner image at a fixed 450px tall block at the top of the
 * header (matches the layout of normal category pages like grill-heating-covers).
 * Without this, the image stretches to fill the now-tall header (because the
 * tile content lives inside the header), which distorts it AND makes it appear
 * again at the bottom. Below the 450px banner, the header's white background
 * shows through, giving the tile section a clean white backdrop. */
body.term-patio-covers-by-shape .woocommerce-products-header {
    background-size: 100% 450px !important;
    background-repeat: no-repeat !important;
    background-position: center top !important;
    background-color: #ffffff !important;
    background-attachment: scroll !important;
}

/* Push the white description card BELOW the 450px banner so the tiles don't
 * overlap the banner image. The col-full title sits inside the header at its
 * natural position over the banner; the description starts well below it. */
body.term-patio-covers-by-shape .woocommerce-products-header .term-description {
    background: #ffffff;
    margin: 220px 0 0;
    padding: 30px 0 50px;
    position: relative;
    z-index: 2;
}

/* v3.5: divider between genuine matches and shape-only extras */
.cps-grid-divider {
    grid-column: 1 / -1;
    width: 100%;
    margin: 18px 0 6px;
    padding-top: 14px;
    border-top: 1px solid #dcdcde;
    font-size: 14px;
    font-weight: 600;
    color: #50575e;
    text-align: left;
}

/* v3.5.1: photo-guide tip on the upload screen */
.cps-upload-tip {
    margin: 10px auto 0;
    font-size: 13px;
    color: #50575e;
    max-width: 420px;
}


/* ── v3.6: Lead capture (no-match fallback) ─────────────────
 *  Shown instead of an empty/filler grid. The old .cps-grid-divider
 *  rule above is retired but kept harmless on purpose. */
.cps-lead-zone {
    max-width: 460px;
    margin: 18px auto 8px;
    text-align: center;
}
.cps-lead-message {
    font-size: 15px;
    line-height: 1.55;
    color: #333;
    margin: 0 0 14px;
}
.cps-lead-form input[type="text"],
.cps-lead-form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    margin: 0 0 10px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    font-size: 14px;
}
.cps-lead-form #cps-lead-website {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.cps-lead-form button[type="submit"] {
    width: 100%;
    justify-content: center;
}
.cps-lead-privacy {
    font-size: 12px;
    color: #777;
    margin: 8px 0 0;
}
.cps-lead-thanks {
    font-size: 15px;
    color: #0f5132;
    background: #d1e7dd;
    border-radius: 6px;
    padding: 12px 14px;
}
.cps-lead-error {
    font-size: 13px;
    color: #842029;
    margin: 8px 0 0;
}

/* v3.6.1: response-time assurance under the lead form button */
.cps-lead-assurance {
    font-size: 13px;
    color: #1A5276;
    font-weight: 600;
    margin: 10px 0 0;
}
