/* ======================================================
   GMASH Fabric Finder Prototype Styles (Olive + Warm Sand)
   ====================================================== */

:root {
    --gimsh-olive: #303b29;
    --gimsh-olive-2: #242c1f;
    --gimsh-olive-soft: #f4f6f0;
    --gimsh-gold: #c8a078;
    --gimsh-gold-deep: #9a7146;
    --gimsh-gold-soft: #f7f1e6;
    --gimsh-gold-line: #e6dacb;
    --gimsh-cream: #faf7f2;
    --gimsh-paper: #ffffff;
    --gimsh-sand: #eee7dc;
    --gimsh-line: #e8e2d8;
    --gimsh-ink: #262a1e;
    --gimsh-muted: #726e63;
    --gimsh-wa: #1fae5a;
    --gimsh-warn-bg: #fdeee7;
    --gimsh-warn: #b4541f;
}

.gimsh-finder-wrapper {
    width: 100%;
    max-width: 960px;
    margin: 20px auto 60px;
    padding: 0 16px;
    box-sizing: border-box;
    font-family: inherit;
    color: var(--gimsh-ink);
}

.gimsh-finder-wrapper[data-is-ar="1"] {
    direction: rtl;
    text-align: right;
}

.gimsh-finder-wrapper[data-is-ar="0"] {
    direction: ltr;
    text-align: left;
}

.fnd-container {
    background: transparent;
    padding: 0;
}

/* Top Progress Bar & Counter */
.fnd-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.fnd-k-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gimsh-gold-deep);
}

.fnd-k-title .spark-icon {
    width: 16px;
    height: 16px;
}

.fnd-step-text {
    color: var(--gimsh-muted);
    font-weight: 500;
}

.fnd-progress-track {
    height: 6px;
    background: var(--gimsh-sand);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 28px;
}

.fnd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gimsh-olive), var(--gimsh-gold));
    border-radius: 6px;
    transition: width 0.35s ease;
}

/* Question Header */
.fq-header h1 {
    font-size: clamp(24px, 3.8vw, 32px);
    color: var(--gimsh-olive);
    margin: 0 0 8px;
    font-weight: 800;
    line-height: 1.35;
}

.fq-header .lead {
    color: var(--gimsh-muted);
    margin: 0 0 24px;
    font-size: 15.5px;
    line-height: 1.5;
}

/* Options Grid */
.fopts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.fopt-btn {
    border: 1.5px solid var(--gimsh-gold-line);
    background: var(--gimsh-paper);
    border-radius: 14px;
    padding: 16px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    text-align: start;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.fopt-btn:hover {
    border-color: var(--gimsh-gold);
    box-shadow: 0 8px 20px rgba(48, 59, 41, 0.08);
    transform: translateY(-2px);
}

.fopt-btn.is-selected {
    border-color: var(--gimsh-olive);
    background: var(--gimsh-olive-soft);
    box-shadow: inset 0 -3px 0 var(--gimsh-gold);
}

.fopt-btn .fopt-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gimsh-olive);
    color: var(--gimsh-gold);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.fopt-btn .fopt-icon svg {
    width: 22px;
    height: 22px;
}

.fopt-swatch-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.fopt-btn b {
    display: block;
    font-size: 15.5px;
    color: var(--gimsh-olive);
    margin-bottom: 2px;
    font-weight: 600;
}

.fopt-btn small {
    display: block;
    color: var(--gimsh-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

/* Big Season Buttons */
.fopt-btn.is-big {
    padding: 26px 20px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
}

.fopt-btn.is-big .fopt-icon {
    width: 64px;
    height: 64px;
}

.fopt-btn.is-big .fopt-icon svg {
    width: 32px;
    height: 32px;
}

.fopt-btn.is-big b {
    font-size: 19px;
}

/* Nav Controls */
.fnd-nav-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--gimsh-line);
}

.fnd-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
}

.fnd-btn-primary {
    background: var(--gimsh-olive);
    color: #ffffff;
}

.fnd-btn-primary:hover {
    background: var(--gimsh-olive-2);
}

.fnd-btn-ghost {
    background: transparent;
    border: 1.5px solid var(--gimsh-olive);
    color: var(--gimsh-olive);
}

.fnd-btn-ghost:hover:not([disabled]) {
    background: var(--gimsh-olive-soft);
}

.fnd-btn-ghost[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ccd0d4;
    color: #8c8f94;
}

.btn-ghost-wa {
    background: #ffffff;
    border: 1.5px solid #d4dec9;
    color: #3b5030;
}

.btn-ghost-wa i.fa-whatsapp,
.btn-ghost-wa i.fab {
    font-size: 18px;
    color: #25d366;
}

.btn-ghost-wa svg {
    width: 18px;
    height: 18px;
    color: #25d366;
    stroke: #25d366;
}

.btn-ghost-wa:hover {
    background: #f7faf5;
    border-color: #bad0aa;
    color: #24391d;
}

.fnd-btn-link {
    background: none;
    color: var(--gimsh-muted);
    text-decoration: underline;
    cursor: pointer;
    padding: 10px;
    font-size: 14px;
}

/* ======================================================
   Results Screen Styles (Matching Screenshot media_1793702275802_f3b4aa24)
   ====================================================== */
.fres-header {
    text-align: center;
    margin-bottom: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fres-top-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gimsh-gold-deep);
    margin-bottom: 4px;
}

.fres-top-badge .spark-icon {
    width: 16px;
    height: 16px;
}

.fres-header h1 {
    font-size: clamp(26px, 4vw, 36px);
    color: var(--gimsh-olive);
    margin: 4px 0 16px;
    font-weight: 800;
}

.fres-answers-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.fres-chip {
    font-size: 13px;
    padding: 6px 14px;
    background: var(--gimsh-gold-soft);
    border: 1px solid var(--gimsh-gold-line);
    border-radius: 20px;
    color: #5d5345;
    font-weight: 500;
}

.fbest-list {
    display: grid;
    gap: 18px;
    margin-top: 10px;
}

/* Card: In Arabic RTL, Photo on the RIGHT, Body on the LEFT */
.gimsh-finder-wrapper[data-is-ar="1"] .fcard {
    display: grid;
    grid-template-columns: 240px 1fr; /* Photo on the right in RTL, body on the left */
    background: #ffffff;
    border: 1.5px solid var(--gimsh-gold-line);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 14px rgba(48, 59, 41, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gimsh-finder-wrapper[data-is-ar="0"] .fcard {
    display: grid;
    grid-template-columns: 240px 1fr; /* Photo on the left in LTR, body on the right */
    background: #ffffff;
    border: 1.5px solid var(--gimsh-gold-line);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 14px rgba(48, 59, 41, 0.04);
}

.fcard.is-top-match {
    border: 2px solid var(--gimsh-gold);
    box-shadow: 0 8px 24px rgba(48, 59, 41, 0.08);
}

.fcard-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fcard-title-row h3 {
    font-size: 22px;
    color: var(--gimsh-olive);
    margin: 0;
    font-weight: 700;
}

.fcard-pmeta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gimsh-muted);
}

.fcard-pmeta .dot {
    color: #a4ad9f;
}

.fcard-pmeta .pmeta-price {
    color: var(--gimsh-olive);
    font-weight: 700;
    display: inline-flex;
    direction: ltr;
    unicode-bidi: isolate;
    gap: 3px;
}

/* Match percentage row */
.fcard-match-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gimsh-muted);
    margin: 2px 0;
}

.fcard-match-num {
    color: var(--gimsh-olive);
    font-weight: 800;
    font-size: 15px;
}

.fcard-match-bar {
    width: 140px;
    height: 7px;
    background: var(--gimsh-sand);
    border-radius: 6px;
    overflow: hidden;
}

.fcard-match-fill {
    display: block;
    height: 100%;
    background: var(--gimsh-olive);
}

/* Feature tags */
.fcard-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fcard-reasons span {
    font-size: 13px;
    background: var(--gimsh-olive-soft);
    color: var(--gimsh-olive);
    border-radius: 20px;
    padding: 4px 14px;
    font-weight: 500;
}

.fcard-reasons span.miss-tag {
    background: var(--gimsh-warn-bg);
    color: var(--gimsh-warn);
}

.fcard-suggested-color {
    font-size: 14px;
    color: var(--gimsh-muted);
    margin: 2px 0;
}

.fcard-suggested-color b {
    color: var(--gimsh-olive);
}

.fcard-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.fcard-actions .fnd-btn {
    height: 42px;
    padding: 0 20px;
    font-size: 14.5px;
}

/* Photo Column */
.fcard-photo {
    min-height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-inline-end: 1px solid var(--gimsh-line);
}

.fcard-rank-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--gimsh-olive);
    color: var(--gimsh-gold);
    font-weight: 700;
    font-size: 12.5px;
    border-radius: 20px;
    padding: 4px 14px;
}

/* ======================================================
   Secondary Recommendations: "خيارات ثانية ممكن تعجبك"
   ====================================================== */
.falt-section {
    margin-top: 36px;
    margin-bottom: 24px;
}

.falt-title {
    font-size: 20px;
    color: var(--gimsh-olive);
    margin: 0 0 16px;
    font-weight: 700;
}

.falt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.falt-card {
    background: #ffffff;
    border: 1px solid var(--gimsh-gold-line);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(48, 59, 41, 0.04);
}

.falt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(48, 59, 41, 0.1);
}

.falt-photo {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--gimsh-line);
}

.falt-info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.falt-name {
    font-size: 15.5px;
    color: var(--gimsh-olive);
    margin: 0;
    font-weight: 700;
    line-height: 1.35;
}

.falt-meta {
    font-size: 13px;
    color: var(--gimsh-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.falt-price {
    color: var(--gimsh-olive);
    font-weight: 700;
}

.falt-swatches {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 4px;
}

.mini-swatch-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dcdad3;
    display: inline-block;
}

.mini-swatch-plus {
    font-size: 11px;
    color: var(--gimsh-muted);
}

/* Bottom Action Bar matching user screenshot */
.fres-bottom-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn-wa-solid {
    background: #1fae5a !important; /* Authentic GMASH WA green */
    color: #ffffff !important;
    height: 44px;
    padding: 0 24px;
    font-size: 15px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 6px rgba(31, 174, 90, 0.25);
    border: none !important;
}

.btn-wa-solid:hover {
    background: #17934a !important;
    color: #ffffff !important;
}

.fnd-btn-outline {
    background: #ffffff !important;
    border: 1px solid #c8c5ba !important;
    color: #262a1e !important;
    height: 44px;
    padding: 0 22px;
    font-size: 14.5px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.fnd-btn-outline:hover {
    background: #f8f6f0 !important;
    border-color: #a8a497 !important;
    color: #000000 !important;
}

/* Mobile Screen Layout matching prototype mockup */
@media (max-width: 768px) {
    .gimsh-finder-wrapper[data-is-ar="1"] .fcard,
    .gimsh-finder-wrapper[data-is-ar="0"] .fcard,
    .fcard {
        display: flex !important;
        flex-direction: column !important;
    }

    .fcard-photo {
        min-height: 210px !important;
        height: 210px !important;
        width: 100% !important;
        order: -1 !important; /* Image stacked on TOP */
        border-inline-end: none !important;
        border-inline-start: none !important;
        border-bottom: 1px solid var(--gimsh-line) !important;
    }

    .fcard-body {
        padding: 20px 18px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .fcard-title-row h3 {
        font-size: 20px !important;
    }

    .fcard-pmeta {
        font-size: 13.5px !important;
        gap: 6px !important;
    }

    .fcard-match-row {
        gap: 8px !important;
        font-size: 13.5px !important;
    }

    .fcard-match-bar {
        flex: 1 !important;
        max-width: 140px !important;
    }

    .fcard-reasons {
        gap: 6px !important;
    }

    .fcard-reasons span {
        font-size: 12px !important;
        padding: 3px 12px !important;
    }

    .fcard-actions {
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .fcard-actions .fnd-btn {
        flex: 1 !important;
        height: 42px !important;
        padding: 0 10px !important;
        font-size: 14px !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .fopts-grid {
        grid-template-columns: 1fr !important;
    }

    .falt-grid {
        grid-template-columns: 1fr !important;
    }

    .falt-photo {
        height: 190px !important;
    }

    .fres-bottom-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .fres-bottom-actions .fnd-btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    .fres-header h1 {
        font-size: 24px !important;
    }
}

/* Fix meter price formatting and bidi ordering in alternative product cards */
.layout_12238 .usg_vwrapper_1,
.layout_12238 .usg_post_title_1,
.layout_12238 .usg_post_taxonomy_1 {
    text-align: right !important;
}

.layout_12238 .usg_hwrapper_1 {
    justify-content: flex-start !important;
    text-align: right !important;
    width: 100% !important;
}

.layout_12238 .meter-price-regular,
.w-post-elm.post_custom_field.meter-price-regular {
    text-align: right !important;
}

.layout_12238 .meter-price-regular,
.w-post-elm.post_custom_field.meter-price-regular {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 4px !important;
    direction: rtl !important;
    unicode-bidi: isolate !important;
}

.layout_12238 .meter-price-regular .w-post-elm-value,
.w-post-elm.post_custom_field.meter-price-regular .w-post-elm-value {
    order: 1 !important;
    direction: ltr !important;
    unicode-bidi: isolate !important;
    display: inline-block !important;
}

.layout_12238 .meter-price-regular .w-post-elm-after,
.w-post-elm.post_custom_field.meter-price-regular .w-post-elm-after {
    order: 2 !important;
    direction: rtl !important;
    unicode-bidi: isolate !important;
    display: inline-block !important;
}
