﻿@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap");

:root {
    --ivory: #faf7f0;
    --gold: #c9a44c;
    --gold-deep: #a6812f;
    --gold-soft: #efe2bd;
    --ink: #2b2620;
    --line: #e6ddc8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Vazirmatn", sans-serif;
    background: radial-gradient(circle at 15% 10%, #fffef9 0%, var(--ivory) 45%), var(--ivory);
    color: var(--ink);
    padding: 40px 16px;
    min-height: 100vh;
}

.wrap {
    max-width: 640px;
    margin: 0 auto;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--gold-deep);
    font-weight: 600;
    margin-bottom: 6px;
}

h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 24px;
}

.box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 40px -28px rgba(166, 129, 47, 0.35);
}

.box-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .box-title::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--gold), var(--gold-deep));
        display: inline-block;
    }

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opt {
    position: relative;
}

    .opt input {
        position: absolute;
        opacity: 0;
        inset: 0;
        cursor: pointer;
    }

    .opt label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 13px 16px;
        border: 1px solid var(--line);
        border-radius: 12px;
        cursor: pointer;
        transition: 0.18s ease;
        font-size: 14px;
        font-weight: 500;
    }

        .opt label .range {
            color: var(--ink);
        }

        .opt label .count {
            font-size: 12px;
            color: #9a8f76;
            font-weight: 500;
        }

    .opt input:checked + label {
        border-color: var(--gold);
        background: linear-gradient(90deg, var(--gold-soft), #fff);
    }

        .opt input:checked + label .range {
            color: var(--gold-deep);
            font-weight: 700;
        }

    .opt input:focus-visible + label {
        outline: 2px solid var(--gold-deep);
        outline-offset: 2px;
    }

    .opt label:hover {
        border-color: #d8c894;
    }

    .opt label::after {
        content: "";
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 2px solid var(--line);
        flex-shrink: 0;
        margin-inline-start: 12px;
        transition: 0.18s ease;
    }

    .opt input:checked + label::after {
        border-color: var(--gold-deep);
        background: radial-gradient(circle, var(--gold-deep) 40%, transparent 42%);
    }

.clear-btn {
    margin-top: 14px;
    background: none;
    border: none;
    color: var(--gold-deep);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

    .clear-btn:hover {
        text-decoration: underline;
    }

.results {
    margin-top: 28px;
}

.results-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

    .results-head h2 {
        font-size: 14px;
        font-weight: 700;
        margin: 0;
    }

    .results-head span {
        font-size: 12px;
        color: #9a8f76;
    }

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

    .card .product-img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 10px;
        margin-bottom: 10px;
        background: var(--gold-soft);
        display: block;
    }

    .card .name {
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .card .price {
        font-size: 13px;
        color: var(--gold-deep);
        font-weight: 700;
        margin-bottom: 6px;
    }

.empty {
    text-align: center;
    padding: 30px 10px;
    color: #a89a78;
    font-size: 13px;
    border: 1px dashed var(--line);
    border-radius: 14px;
}

/* --- کارت به‌صورت لینک --- */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    transition: 0.18s ease;
}

.card-link:hover .card {
    border-color: var(--gold);
    box-shadow: 0 12px 24px -18px rgba(166, 129, 47, 0.45);
    transform: translateY(-2px);
}

/* --- باکس تایید (مودال) --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(43, 38, 32, 0.45);
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

    .modal-overlay.open {
        display: flex;
    }

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 48px -20px rgba(43, 38, 32, 0.4);
    border: 1px solid var(--line);
}

.modal-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 20px;
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    font-family: "Vazirmatn", sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s ease;
}

.modal-cancel {
    background: #fff;
    color: var(--ink);
}

    .modal-cancel:hover {
        background: #f6f2e7;
    }

.modal-confirm {
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: #fff;
    border: none;
}

    .modal-confirm:hover {
        opacity: 0.9;
    }
