/* =========================================================
   style.css — استایل اصلی «دوچ بلوچ»
   فهرست: پایه · هدر · هیرو · عنوان بخش · دسته‌بندی‌ها ·
          کارت محصول · سبد · سفارش‌ها · موفقیت · فوتر · موبایل
========================================================= */


/* =========================
   BASE
========================= */

body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text);
    line-height: 1.9;
    font-size: 1rem;
}

main {
    width: min(92%, var(--container-width));
    margin: 48px auto 72px;
    min-height: 60vh;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

::selection {
    background: var(--primary);
    color: var(--on-primary);
}

/* نوار نقش بلوچی؛ امضای بصری فروشگاه */
.header::after,
.categories::before,
footer::before {
    content: "";
    display: block;
    height: 10px;
    background: var(--band) repeat-x center / 20px 10px;
}


/* =========================
   HEADER
========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(18, 13, 20, 0.94);
    backdrop-filter: blur(10px);
}

.header__container {
    width: min(94%, var(--container-width));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    white-space: nowrap;
}

.header__logo svg {
    width: 40px;
    height: 40px;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header__link {
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    color: var(--text-light);
    font-size: 0.95rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.header__link:hover {
    color: var(--text);
    border-bottom-color: var(--primary);
}

.header__search {
    flex: 1;
    max-width: 360px;
    display: flex;
    align-items: center;
    margin-right: auto;
}

.header__search input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--surface);
    outline: none;
    font-size: 0.92rem;
    transition: border-color 0.2s ease;
}

.header__search input::placeholder {
    color: var(--text-light);
}

.header__search input:focus {
    border-color: var(--primary);
}

.header__search button {
    width: 46px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--surface-2);
    color: var(--primary);
    transition: background 0.2s ease, color 0.2s ease;
}

.header__search button:hover {
    background: var(--primary);
    color: var(--on-primary);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.header__action,
.header__cart {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.header__action:hover,
.header__cart:hover {
    color: var(--primary);
}

/* دکمه خروج شبیه لینک‌های هدر دیده می‌شود */
.header__logout {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.header__user span {
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header__action svg,
.header__cart svg {
    width: 22px;
    height: 22px;
}

.header__cart {
    position: relative;
}

.header__cart-count {
    position: absolute;
    top: -8px;
    left: -10px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}


/* =========================
   HERO
========================= */

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 64px;
    align-items: center;
    padding: 16px 0 72px;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
}

.hero__description {
    max-width: 44ch;
    margin: 12px 0 36px;
    color: var(--text-light);
    font-size: 1.12rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero__button {
    display: inline-block;
    padding: 13px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hero__button--primary {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--on-primary);
}

.hero__button--primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.hero__button--secondary {
    color: var(--text);
}

.hero__button--secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* قاب محرابی؛ شکل پیشانی‌ی سوزن‌دوزی روی لباس */
.hero__visual {
    width: min(100%, 400px);
    justify-self: center;
}

.hero__figure {
    aspect-ratio: 4 / 5;
    padding: 10px;
    border: 1px solid var(--primary);
    border-radius: 999px 999px 10px 10px;
}

.hero__figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 999px 999px 4px 4px;
}


/* =========================
   SECTION HEADING
========================= */

.section-heading {
    margin-bottom: 32px;
}

.section-heading__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.4vw, 2.7rem);
    font-weight: 700;
    line-height: 1.5;
}

.section-heading__description {
    color: var(--text-light);
}


/* =========================
   CATEGORIES
========================= */

.categories {
    margin-bottom: 72px;
}

.categories::before {
    margin-bottom: 56px;
}

.categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 28px 18px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.category-card:hover {
    border-color: var(--primary);
    background: var(--surface-2);
    transform: translateY(-3px);
}

.category-card__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
    font-size: 1.1rem;
}

.category-card__title {
    font-size: 1.08rem;
    font-weight: 700;
}

.category-card__count {
    color: var(--text-light);
    font-size: 0.85rem;
}


/* =========================
   PRODUCT CARDS
========================= */

.products__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.2s ease;
}

.product-card:hover {
    border-color: var(--primary-dark);
}

.product-card__image {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--surface-2) var(--lattice);
    font-size: 4.2rem;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__discount {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    background: var(--ruby);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
}

.product-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px 20px;
}

.product-card__category {
    color: var(--text-light);
    font-size: 0.8rem;
}

.product-card__title {
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.7;
}

.product-card__title a:hover {
    color: var(--primary);
}

.product-card__rating {
    color: var(--primary);
    font-size: 0.85rem;
}

.product-card__rating::before {
    content: "★ ";
}

.product-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-top: 6px;
}

.product-card__price del {
    color: var(--text-light);
    font-size: 0.82rem;
}

.product-card__price strong {
    font-size: 1.12rem;
    font-weight: 700;
}

.product-card__stock {
    margin-bottom: 12px;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ایموجی جای‌نگهدار (تا وقتی عکس واقعی نگذاشته‌ای): تک‌رنگ و کم‌رنگ، نه رنگارنگ */
.product-image__placeholder {
    filter: grayscale(1);
    opacity: 0.4;
}

.product-card__button {
    width: 100%;
    margin-top: auto;
    padding: 11px 16px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}

.product-card__button:hover:not(:disabled) {
    background: var(--primary);
    color: var(--on-primary);
}

.product-card__button:disabled {
    border-color: var(--border);
    color: var(--text-light);
    cursor: not-allowed;
}


/* =========================
   CART
========================= */

.cart__container {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 32px;
    align-items: start;
}

.cart__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.cart-item__image {
    display: grid;
    place-items: center;
    width: 72px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--surface-2) var(--lattice);
    font-size: 1.8rem;
}

.cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item h3 {
    font-size: 1rem;
    font-weight: 500;
}

.cart-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.cart-item__quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item__minus,
.cart-item__plus {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 1.1rem;
    line-height: 1;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.cart-item__minus:hover,
.cart-item__plus:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cart-item__quantity span {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
}

.cart-item__remove {
    margin-right: 8px;
    border: none;
    background: none;
    color: var(--text-light);
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cart-item__remove:hover {
    color: var(--danger);
}

.cart__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 56px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-light);
    text-align: center;
}

.cart__summary {
    position: sticky;
    top: 110px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.cart__summary h2 {
    margin-bottom: 14px;
    font-family: var(--font-display);
    font-size: 1.6rem;
}

.cart__summary p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

.cart__summary p strong {
    color: var(--text);
}

.cart__summary .cart__payable {
    border-bottom: none;
    color: var(--text);
    font-size: 1.1rem;
}

.cart__summary .cart__payable strong {
    color: var(--primary);
}

.cart__checkout,
.checkout__confirm {
    width: 100%;
    margin-top: 12px;
    padding: 13px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cart__checkout {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.cart__checkout:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.checkout__confirm {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--on-primary);
}

.checkout__confirm:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.checkout__confirm:disabled {
    opacity: 0.6;
    cursor: wait;
}


/* =========================
   CHECKOUT (آدرس و روش ارسال، داخل صفحه سبد)
========================= */

.cart__main {
    display: grid;
    gap: 28px;
    align-content: start;
    min-width: 0;
}

.checkout {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.checkout h2 {
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-size: 1.6rem;
}

.checkout__form {
    display: grid;
    gap: 10px;
}

.checkout__form label,
.checkout__methods legend {
    color: var(--text-light);
    font-size: 0.9rem;
}

.checkout__form input,
.checkout__form select,
.checkout__form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text);
    font: inherit;
}

.checkout__form input,
.checkout__form select {
    height: 48px;
    padding-block: 0;
}

.checkout__form textarea {
    resize: vertical;
    min-height: 88px;
}

.checkout__form input[dir="ltr"] {
    text-align: right;
}

.checkout__form input:focus-visible,
.checkout__form select:focus-visible,
.checkout__form textarea:focus-visible {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 169, 90, 0.35);
}

.checkout__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.checkout__row label {
    display: block;
    margin-bottom: 10px;
}

.checkout__hint {
    margin-top: -4px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.checkout__methods {
    display: grid;
    gap: 10px;
    margin: 8px 0 0;
    padding: 0;
    border: none;
}

.checkout__methods legend {
    margin-bottom: 10px;
    padding: 0;
}

.checkout__methods-list {
    display: grid;
    gap: 10px;
}

.checkout__method {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text);
    cursor: pointer;
}

.checkout__method:has(input:checked) {
    border-color: var(--primary);
}

.checkout__method input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.checkout__method small {
    display: block;
    color: var(--text-light);
    font-size: 0.82rem;
}

.checkout__method strong {
    color: var(--primary);
    white-space: nowrap;
}

.checkout__error {
    padding: 10px 14px;
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.92rem;
}

/* جزئیات تحویل در صفحه سفارش */
.order-details__delivery {
    margin: 20px 0;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.order-details__delivery h3 {
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 1.3rem;
}

/* =========================
   ORDERS
========================= */

.orders__list {
    display: grid;
    gap: 16px;
}

.order-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 2px 24px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.2s ease;
}

.order-card:hover {
    border-color: var(--primary-dark);
}

.order-card h2 {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.order-card p {
    color: var(--text-light);
    font-size: 0.92rem;
}

.order-card__link,
.order-details__back {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.order-card__link {
    grid-column: 1 / -1;
    margin-top: 8px;
}

.orders__empty {
    padding: 48px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-light);
    text-align: center;
}

.order-details__content {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.order-details__content h2 {
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 1.7rem;
}

.order-details__content > p {
    color: var(--text-light);
}

.order-details__items {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.order-details__item {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.order-details__item h3 {
    margin-bottom: 4px;
    font-size: 1rem;
}

.order-details__item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.order-details__total {
    color: var(--primary);
    font-size: 1.25rem;
}

.order-details__back {
    display: inline-block;
    margin-top: 24px;
}


/* =========================
   SUCCESS
========================= */

.success {
    max-width: 540px;
    margin: 24px auto 0;
    padding: 40px 32px 36px;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.success h1 {
    margin-bottom: 18px;
    font-family: var(--font-display);
    font-size: 2.4rem;
    line-height: 1.5;
}

.success p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    text-align: start;
}

.success p strong {
    color: var(--text);
    text-align: end;
    overflow-wrap: anywhere;
}

.success__button {
    display: inline-block;
    margin-top: 28px;
    padding: 13px 32px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

.success__button:hover {
    background: var(--primary-dark);
}

button.success__button {
    margin-inline-end: 8px;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button.success__button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.success p.success__message {
    display: block;
    border: 0;
    color: var(--text);
    text-align: center;
}

.success--paid { border-color: #2e7d32; }
.success--problem { border-color: #b3261e; }
.success--paid h1 { color: #2e7d32; }
.success--problem h1 { color: #b3261e; }


/* =========================
   FOOTER
========================= */

footer {
    background: var(--surface);
    text-align: center;
}

.footer__inner {
    padding: 36px 20px 40px;
}

.footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
}

.footer__brand svg {
    width: 30px;
    height: 30px;
}

footer p {
    color: var(--text-light);
    font-size: 0.88rem;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {

    main {
        margin-top: 32px;
    }

    .header__container {
        flex-wrap: wrap;
        gap: 10px 16px;
        padding: 12px 0;
    }

    .header__nav {
        order: 3;
        width: 100%;
        gap: 22px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .header__search {
        order: 4;
        flex: 1 1 100%;
        max-width: none;
        margin-right: 0;
    }

    .header__actions {
        margin-right: auto;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding-bottom: 48px;
    }

    .hero__visual {
        width: min(100%, 320px);
    }

    .cart__container {
        grid-template-columns: 1fr;
    }

    .cart__summary {
        position: static;
    }
}

@media (max-width: 600px) {

    .products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-card__body {
        padding: 12px 12px 14px;
    }

    .product-card__title {
        font-size: 0.92rem;
    }

    .product-card__button {
        padding: 9px 8px;
        font-size: 0.85rem;
    }

    .categories__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
    }

    .cart-item__image {
        width: 60px;
    }

    .cart-item__quantity {
        grid-column: 1 / -1;
    }

    .header__logo {
        font-size: 1.6rem;
    }
}

@media (max-width: 560px) {

    .checkout__row {
        grid-template-columns: 1fr;
    }
}
