/* ============================================================
   WDG Elcor Products — Frontend Styles v1.0
   ============================================================ */

/* ── Variables ── */
:root {
    --wdg-red: #E8192C;
    --wdg-red-dark: #C41222;
    --wdg-red-light: #FFF0F2;
    --wdg-dark: #111827;
    --wdg-text: #1F2937;
    --wdg-muted: #6B7280;
    --wdg-border: #E5E7EB;
    --wdg-bg: #F9FAFB;
    --wdg-white: #ffffff;
    --wdg-shadow: 0 4px 20px rgba(0,0,0,.10);
    --wdg-shadow-hover: 0 8px 40px rgba(0,0,0,.16);
    --wdg-radius: 14px;
    --wdg-radius-sm: 8px;
    --wdg-transition: all 0.28s cubic-bezier(.4,0,.2,1);
}

/* ── Wrap ── */
.wdg-products-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--wdg-text);
    max-width: 100%;
}

/* ── Title ── */
.wdg-products-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 800;
    color: var(--wdg-dark);
    margin: 0 0 28px;
    letter-spacing: -0.5px;
}

/* ── Filter Strip ── */
.wdg-filter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--wdg-border);
}
.wdg-filter-btn {
    padding: 8px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--wdg-border);
    background: var(--wdg-white);
    color: var(--wdg-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wdg-transition);
    font-family: inherit;
}
.wdg-filter-btn:hover {
    border-color: var(--wdg-red);
    color: var(--wdg-red);
}
.wdg-filter-btn.active {
    background: var(--wdg-red);
    border-color: var(--wdg-red);
    color: #fff;
}

/* ── Grid ── */
.wdg-products-grid {
    display: grid;
    gap: 24px;
}
.wdg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wdg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wdg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.wdg-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* ── Product Card ── */
.wdg-product-card {
    background: var(--wdg-white);
    border: 1px solid var(--wdg-border);
    border-radius: var(--wdg-radius);
    overflow: hidden;
    box-shadow: var(--wdg-shadow);
    transition: var(--wdg-transition);
    animation: wdgFadeIn 0.5s ease both;
    display: flex;
    flex-direction: column;
}
.wdg-product-card:hover {
    box-shadow: var(--wdg-shadow-hover);
    transform: translateY(-4px);
    border-color: rgba(232,25,44,.2);
}

@keyframes wdgFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Card Image ── */
.wdg-card-image-wrap {
    position: relative;
    overflow: hidden;
    background: var(--wdg-bg);
    aspect-ratio: 4/3;
}
.wdg-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    filter: grayscale(20%);
}
.wdg-product-card:hover .wdg-card-image {
    transform: scale(1.05);
    filter: grayscale(0%);
}
.wdg-card-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

/* ── Zoom Button ── */
.wdg-card-zoom-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--wdg-transition);
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    color: var(--wdg-red);
}
.wdg-card-zoom-btn svg { width: 18px; height: 18px; }
.wdg-product-card:hover .wdg-card-zoom-btn {
    opacity: 1;
    transform: scale(1);
}
.wdg-card-zoom-btn:hover {
    background: var(--wdg-red);
    color: #fff;
}

/* ── Card Body ── */
.wdg-card-body {
    padding: 16px 18px 8px;
    flex: 1;
}
.wdg-card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--wdg-dark);
    margin: 0 0 6px;
    line-height: 1.35;
    letter-spacing: -0.2px;
}
.wdg-card-tagline {
    font-size: 12px;
    color: var(--wdg-muted);
    margin: 0 0 12px;
    line-height: 1.5;
}

/* ── Badge Icons ── */
.wdg-badge-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.wdg-badge-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 7px;
    border: 1px solid var(--wdg-border);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    color: var(--wdg-text);
    background: var(--wdg-bg);
    cursor: default;
    transition: var(--wdg-transition);
}
.wdg-badge-icon:hover {
    border-color: var(--wdg-red);
    color: var(--wdg-red);
    background: var(--wdg-red-light);
}
.wdg-badge-svg {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wdg-red);
    flex-shrink: 0;
}
.wdg-badge-svg svg {
    width: 14px;
    height: 14px;
}
.wdg-badge-label {
    white-space: nowrap;
}

/* ── Card Footer ── */
.wdg-card-foot {
    padding: 12px 18px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--wdg-border);
    margin-top: 10px;
}
.wdg-btn-book {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 50px;
    border: 2px solid var(--wdg-red);
    background: transparent;
    color: var(--wdg-red);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--wdg-transition);
    font-family: inherit;
    flex: 1;
    justify-content: center;
}
.wdg-btn-book:hover {
    background: var(--wdg-red);
    color: #fff;
}
.wdg-btn-brochure {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 14px;
    border-radius: 50px;
    background: transparent;
    color: var(--wdg-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--wdg-transition);
    border: none;
    white-space: nowrap;
}
.wdg-btn-brochure:hover {
    color: var(--wdg-dark);
    text-decoration: underline;
}

/* ── No Products ── */
.wdg-no-products {
    text-align: center;
    padding: 60px 20px;
    color: var(--wdg-muted);
    font-size: 16px;
    background: var(--wdg-bg);
    border-radius: var(--wdg-radius);
    border: 1px dashed var(--wdg-border);
}


/* ══════════════════════════════════════════════
   POPUP
══════════════════════════════════════════════ */

/* ─── Overlay ─── */
.wdg-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.62);
    z-index: 999999;
    /* desktop: centred */
    align-items: center;
    justify-content: center;
}

/* ─── Popup shell — desktop ─── */
.wdg-popup {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: calc(100% - 40px);
    max-width: 900px;
    /* key: explicit height so children can scroll */
    height: 88vh;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(.34,1.56,.64,1), opacity 0.25s ease;
}
.wdg-popup.wdg-popup-open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ─── Close button ─── */
.wdg-popup-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 36px; height: 36px;
    background: var(--wdg-bg);
    border: 1px solid var(--wdg-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: var(--wdg-transition);
    color: var(--wdg-text);
}
.wdg-popup-close:hover { background: var(--wdg-red); border-color: var(--wdg-red); color: #fff; }
.wdg-popup-close svg { width: 16px; height: 16px; }

/* ─── Two-col inner — fills the popup shell ─── */
.wdg-popup-inner {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    /* fill remaining height, allow each col to scroll */
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ─── Left col ─── */
.wdg-popup-left {
    background: var(--wdg-bg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-right: 1px solid var(--wdg-border);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.wdg-popup-image-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--wdg-border);
    flex-shrink: 0;
}
.wdg-popup-main-img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}
.wdg-popup-gallery {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.wdg-gallery-thumb {
    width: 64px; height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--wdg-transition);
    opacity: .75;
}
.wdg-gallery-thumb:hover,
.wdg-gallery-thumb.active { border-color: var(--wdg-red); opacity: 1; }
.wdg-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    flex-shrink: 0;
}
.wdg-popup-btn-book {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 50px;
    background: var(--wdg-red);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--wdg-transition);
    font-family: inherit;
    border: 2px solid var(--wdg-red);
}
.wdg-popup-btn-book:hover { background: var(--wdg-red-dark); border-color: var(--wdg-red-dark); color: #fff; text-decoration: none; }
.wdg-popup-btn-dl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 50px;
    background: transparent;
    color: var(--wdg-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--wdg-transition);
    border: 2px solid var(--wdg-border);
    font-family: inherit;
}
.wdg-popup-btn-dl:hover { border-color: var(--wdg-dark); color: var(--wdg-dark); text-decoration: none; }

/* ─── Right col ─── */
.wdg-popup-right {
    padding: 30px 28px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.wdg-popup-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--wdg-dark);
    margin: 0 0 8px;
    letter-spacing: -0.4px;
    line-height: 1.3;
    padding-right: 40px;
}
.wdg-popup-tagline {
    font-size: 13px;
    color: var(--wdg-muted);
    margin: 0 0 14px;
    font-weight: 500;
}
.wdg-popup-badge-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--wdg-border);
}
.wdg-popup-badge-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px 5px 9px;
    border: 1px solid var(--wdg-border);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--wdg-text);
    background: var(--wdg-bg);
}
.wdg-popup-badge-icon svg { width: 14px; height: 14px; color: var(--wdg-red); flex-shrink: 0; }
.wdg-popup-desc {
    font-size: 14px;
    color: var(--wdg-muted);
    line-height: 1.7;
    margin: 0 0 18px;
}

/* Features */
.wdg-popup-features { margin-bottom: 20px; }
.wdg-popup-features-title,
.wdg-popup-specs-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--wdg-muted);
    margin-bottom: 10px;
}
.wdg-popup-features-list { display: flex; flex-direction: column; gap: 6px; }
.wdg-popup-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--wdg-text);
    font-weight: 500;
}
.wdg-feat-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    background: var(--wdg-red-light);
    color: var(--wdg-red);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

/* Specs */
.wdg-popup-specs { margin-bottom: 10px; }
.wdg-popup-specs-table {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    border: 1px solid var(--wdg-border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
}
.wdg-spec-key,
.wdg-spec-val { padding: 9px 14px; border-bottom: 1px solid var(--wdg-border); }
.wdg-spec-key:nth-last-child(2),
.wdg-spec-val:last-child { border-bottom: none; }
.wdg-spec-key { background: var(--wdg-bg); font-weight: 700; color: var(--wdg-text); }
.wdg-spec-val { background: #fff; color: var(--wdg-muted); }

/* ══════════════════════════════════════════════
   RESPONSIVE — GRID
══════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .wdg-cols-5 { grid-template-columns: repeat(3, 1fr); }
    .wdg-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 780px) {
    .wdg-cols-2,.wdg-cols-3,.wdg-cols-4,.wdg-cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .wdg-cols-2,.wdg-cols-3,.wdg-cols-4,.wdg-cols-5 { grid-template-columns: 1fr; }
    .wdg-badge-icons { gap: 4px; }
    .wdg-badge-icon { font-size: 10px; padding: 3px 8px 3px 5px; }
    .wdg-badge-label { display: none; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — POPUP (mobile bottom sheet)
   The trick: on mobile the popup becomes a
   bottom sheet. The INNER div gets overflow-y:auto
   and a max-height. No body lock needed at all.
══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Overlay: sit at bottom, no centre alignment */
    .wdg-popup-overlay {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    /* Popup: full-width bottom sheet, slides up */
    .wdg-popup {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);       /* slides up from bottom */
        opacity: 1;                         /* no fade, just slide */
        /* single-column scroll: the popup itself is the scroll container */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .wdg-popup.wdg-popup-open {
        transform: translateY(0);
        opacity: 1;
    }

    /* Stack columns vertically */
    .wdg-popup-inner {
        display: flex;
        flex-direction: column;
        /* no overflow or height on inner — popup shell handles scroll */
        overflow: visible;
        min-height: unset;
        flex: none;
    }

    /* Left col: image area — no internal scroll, just shows fully */
    .wdg-popup-left {
        border-right: none;
        border-bottom: 1px solid var(--wdg-border);
        padding: 56px 16px 16px; /* top pad for close btn */
        overflow: visible;
        gap: 12px;
    }
    .wdg-popup-main-img { max-height: 200px; }

    /* Right col: content — no internal scroll, just flows naturally */
    .wdg-popup-right {
        padding: 18px 16px 32px;
        overflow: visible;
        -webkit-overflow-scrolling: unset;
    }

    /* Close button stays fixed at top-right of screen */
    .wdg-popup-close {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 1000001;
        background: #fff;
        box-shadow: 0 2px 12px rgba(0,0,0,.2);
    }

    /* Drag handle pill at top of sheet */
    .wdg-popup::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #D1D5DB;
        border-radius: 2px;
        margin: 12px auto 4px;
        flex-shrink: 0;
    }

    .wdg-popup-title { font-size: 18px; padding-right: 0; }
    .wdg-popup-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .wdg-popup-btn-book, .wdg-popup-btn-dl { flex: 1; min-width: 120px; font-size: 13px; padding: 10px 14px; }
}

/* ══════════════════════════════════════════════
   POPUP TABS
══════════════════════════════════════════════ */
.wdg-popup-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--wdg-border);
}
.wdg-ptab {
    padding: 8px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--wdg-border);
    background: #fff;
    color: var(--wdg-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--wdg-transition);
    font-family: inherit;
}
.wdg-ptab:hover { border-color: var(--wdg-red); color: var(--wdg-red); }
.wdg-ptab.active { background: var(--wdg-red); border-color: var(--wdg-red); color: #fff; }
.wdg-popup-panel { animation: wdgFadeIn 0.25s ease both; }

@media (max-width: 560px) {
    .wdg-popup-tabs { gap: 6px; flex-wrap: wrap; }
    .wdg-ptab { flex: 1; text-align: center; border-radius: 9px; font-size: 12px; padding: 8px 10px; }
}

/* ══════════════════════════════════════════════
   SHOP LINK BUTTON
══════════════════════════════════════════════ */
.wdg-popup-shop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, #FF6B00, #FF9800);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: var(--wdg-transition);
    box-shadow: 0 4px 15px rgba(255,107,0,.3);
}
.wdg-popup-shop-btn:hover { background: linear-gradient(135deg,#E55A00,#E58A00); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,107,0,.45); }

/* ══════════════════════════════════════════════
   REQUEST A DEMO FORM
══════════════════════════════════════════════ */
.wdg-demo-form-wrap { padding: 4px 0; }
.wdg-demo-intro {
    font-size: 13px;
    color: var(--wdg-muted);
    line-height: 1.6;
    margin: 0 0 18px;
    padding: 12px 16px;
    background: var(--wdg-bg);
    border-radius: 10px;
    border-left: 3px solid var(--wdg-red);
}
.wdg-demo-form { display: flex; flex-direction: column; gap: 12px; }
.wdg-df-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wdg-df-field { display: flex; flex-direction: column; gap: 5px; }
.wdg-df-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--wdg-text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.wdg-req { color: var(--wdg-red); }
.wdg-df-field input,
.wdg-df-field textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--wdg-border);
    border-radius: 9px;
    font-size: 16px; /* 16px prevents iOS auto-zoom */
    font-family: inherit;
    color: var(--wdg-text);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.wdg-df-field input:focus,
.wdg-df-field textarea:focus { border-color: var(--wdg-red); box-shadow: 0 0 0 3px rgba(232,25,44,.1); }
.wdg-df-field textarea { resize: vertical; min-height: 80px; }
.wdg-demo-error {
    background: #FEE2E2;
    color: #991B1B;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #EF4444;
}
.wdg-demo-success {
    text-align: center;
    padding: 30px 20px;
    background: #F0FDF4;
    border-radius: 14px;
    border: 2px solid #86EFAC;
}
.wdg-success-icon {
    width: 56px; height: 56px;
    background: #22C55E;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.wdg-demo-success p { font-size: 15px; font-weight: 700; color: #166534; margin: 0 0 6px; line-height: 1.5; }
.wdg-demo-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 50px;
    background: var(--wdg-red);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: var(--wdg-transition);
    font-family: inherit;
    margin-top: 6px;
    box-shadow: 0 4px 15px rgba(232,25,44,.3);
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
}
.wdg-demo-submit-btn:hover:not(:disabled) { background: var(--wdg-red-dark); box-shadow: 0 6px 20px rgba(232,25,44,.45); }
.wdg-demo-submit-btn:disabled { opacity: .65; cursor: not-allowed; }

@media (max-width: 560px) {
    .wdg-df-row { grid-template-columns: 1fr; }
}
