* {

    box-sizing: border-box;

}

:root {

    --green: #176b4d;

    --green-dark: #0f4d38;

    --gold: #c5a35a;

    --gold-light: #f5ecd8;

    --white: #ffffff;

    --text: #202020;

    --muted: #777;

    --border: #e8e4dc;

    --soft: #f8f7f3;

}

html {

    scroll-behavior: smooth;

}

body {

    margin: 0;

    font-family: Tahoma, Arial, sans-serif;

    color: var(--text);

    background: var(--white);

    line-height: 1.9;

}

button,

input,

textarea {

    font-family: inherit;

}

a {

    color: inherit;

}

.wrap,

.nav,

.hero > div,

.section > *,

.tracking > div {

    width: min(1100px, 92%);

    margin-left: auto;

    margin-right: auto;

}

/* =========================================

   Header

========================================= */

header {

    position: sticky;

    top: 0;

    background: rgba(255,255,255,.97);

    border-bottom: 1px solid var(--border);

    z-index: 100;

    backdrop-filter: blur(10px);

}

.nav {

    min-height: 72px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

}

.nav > a img {

    max-height: 48px;

    width: auto;

    display: block;

}

nav {

    display: flex;

    gap: 20px;

    align-items: center;

}

nav a {

    color: #444;

    text-decoration: none;

    font-size: 14px;

    transition: .2s;

}

nav a:hover {

    color: var(--green);

}

.nav button,

.cartBtn {

    border: 1px solid var(--border);

    background: var(--white);

    border-radius: 10px;

    padding: 9px 13px;

    cursor: pointer;

}

#count {

    background: var(--green);

    color: white;

    border-radius: 20px;

    padding: 2px 7px;

    margin-right: 4px;

}

/* =========================================

   Hero

========================================= */

.hero {

    padding: 85px 0;

    background:

        linear-gradient(

            135deg,

            #ffffff 0%,

            #f7f2e7 55%,

            #edf5f1 100%

        );

}

.hero > div {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 40px;

}

.hero > div > div {

    max-width: 650px;

}

.hero small,

.section > small,

.tracking small {

    color: var(--green);

    font-weight: bold;

    letter-spacing: .5px;

}

.hero h1 {

    font-size: 46px;

    line-height: 1.35;

    margin: 12px 0;

}

.hero h1 em {

    color: var(--green);

    font-style: normal;

    display: block;

}

.hero p {

    color: var(--muted);

    max-width: 650px;

    font-size: 16px;

}

.hero-logo {

    max-width: 230px;

    max-height: 230px;

    object-fit: contain;

}

/* =========================================

   Buttons

========================================= */

.gold {

    display: inline-block;

    background: var(--green);

    color: white;

    text-decoration: none;

    border: 0;

    border-radius: 11px;

    padding: 11px 20px;

    cursor: pointer;

    font-family: inherit;

    transition: .2s;

}

.gold:hover {

    background: var(--green-dark);

}

.outline {

    display: inline-block;

    color: var(--green);

    text-decoration: none;

    border: 1px solid var(--green);

    border-radius: 11px;

    padding: 10px 20px;

    margin-right: 7px;

}

.outline:hover {

    background: var(--green);

    color: white;

}

/* =========================================

   Sections

========================================= */

.section {

    padding: 65px 0;

}

.section h2 {

    font-size: 29px;

    margin: 5px 0 20px;

}

.section > p {

    color: var(--muted);

    max-width: 850px;

}

/* =========================================

   Categories

========================================= */

.cards {

    width: min(1100px, 92%);

    margin: 25px auto 0;

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 18px;

}

.cards button,

.cards > div {

    background: var(--white);

    border: 1px solid var(--border);

    border-radius: 18px;

    padding: 28px;

    text-align: right;

    cursor: pointer;

    font-family: inherit;

    transition: .2s;

}

.cards button:hover {

    border-color: var(--green);

    transform: translateY(-2px);

}

.cards small {

    color: var(--muted);

}

/* =========================================

   Products

========================================= */

.products {

    width: min(1100px, 92%);

    margin: 25px auto;

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 20px;

}

.products article {

    border: 1px solid var(--border);

    border-radius: 18px;

    overflow: hidden;

    background: white;

    transition: .2s;

}

.products article:hover {

    transform: translateY(-3px);

    box-shadow: 0 10px 30px rgba(0,0,0,.06);

}

.pic {

    height: 270px;

    display: grid;

    place-items: center;

    background: var(--soft);

    color: var(--green);

    font-size: 20px;

    font-weight: bold;

}

.products article b,

.products article h3,

.products article p,

.products article button {

    margin-right: 18px;

    margin-left: 18px;

}

.products article b {

    display: block;

    margin-top: 15px;

    color: var(--green);

    font-size: 13px;

}

.products article h3 {

    margin-top: 5px;

    margin-bottom: 5px;

}

.products article p {

    color: var(--muted);

}

.products article button {

    margin-bottom: 18px;

}

/* =========================================

   Tracking

========================================= */

.tracking {

    padding: 70px 0;

    background: var(--soft);

}

.tracking > div {

    text-align: center;

}

.tracking input {

    width: min(350px, 100%);

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 10px;

    outline: none;

    margin: 10px 5px;

    background: white;

}

.tracking input:focus {

    border-color: var(--green);

}

#result {

    margin-top: 15px;

}

.tracking-result {

    background: white;

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 15px;

}

.track-order-link {

    display: inline-block;

    padding: 10px 18px;

    border-radius: 10px;

    background: #111;

    color: #fff;

    text-decoration: none;

    font-size: 14px;

    transition: opacity 0.2s;

}

.track-order-link:hover {

    opacity: .8;

}

/* =========================================

   Contact

========================================= */

.social {

    width: min(1100px, 92%);

    margin: 25px auto 0;

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 15px;

}

.social a {

    text-decoration: none;

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 20px;

    text-align: center;

    transition: .2s;

}

.social a:hover {

    border-color: var(--green);

    background: var(--soft);

}

.social small {

    color: var(--muted);

}

/* =========================================

   CART MODAL

   نسخه جدید

========================================= */

#modal {

    display: none;

    position: fixed;

    inset: 0;

    background: rgba(0,0,0,.58);

    align-items: center;

    justify-content: center;

    z-index: 2000;

    padding: 15px;

}

#modal.show {

    display: flex;

}

/*

 * این کلاس عمداً بزرگ‌تر از نسخه قبلی است.

 */

#modal .cart-modal-box {

    width: min(720px, 96vw);

    max-height: 92vh;

    overflow-y: auto;

    background: #fff;

    border-radius: 22px;

    padding: 28px;

    position: relative;

    box-shadow: 0 20px 60px rgba(0,0,0,.22);

}

/* =========================================

   بستن سبد

========================================= */

#modal .modal-close {

    position: absolute;

    left: 14px;

    top: 10px;

    width: 40px;

    height: 40px;

    border: 0;

    background: #f5f5f5;

    border-radius: 50%;

    font-size: 27px;

    line-height: 1;

    cursor: pointer;

    color: #444;

}

#modal .modal-close:hover {

    background: #eaeaea;

}

/* =========================================

   عنوان سبد

========================================= */

#modal .cart-modal-box > h2 {

    margin: 0 45px 20px 0;

    font-size: 25px;

}

/* =========================================

   لیست اصلی سبد

========================================= */

#items {

    display: block;

    width: 100%;

    max-height: 52vh;

    overflow-y: auto;

    padding-left: 3px;

    padding-right: 3px;

}

/*

 * هر محصول یک ردیف مستقل است.

 */

#items .cart-item {

    width: 100%;

    min-height: 90px;

    display: grid;

    grid-template-columns: minmax(0, 1fr) auto;

    align-items: center;

    gap: 18px;

    padding: 16px 4px;

    border-bottom: 1px solid var(--border);

}

/*

 * مهم:

 * هیچ cart-item داخل cart-item دیگری نیست.

 */

#items .cart-item + .cart-item {

    margin-top: 0;

}

.cart-info {

    min-width: 0;

}

.cart-product-name {

    display: block;

    font-size: 16px;

    color: #222;

    margin-bottom: 3px;

}

.cart-category {

    display: block;

    color: var(--muted);

    font-size: 12px;

}

.cart-color {

    display: inline-block;

    margin-top: 7px;

    padding: 5px 9px;

    background: var(--soft);

    border-radius: 8px;

    font-size: 12px;

}

.cart-price {

    margin-top: 7px;

    color: var(--green);

    font-size: 14px;

    font-weight: bold;

}

/* =========================================

   دکمه‌های تعداد

========================================= */

.cart-actions {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    flex-wrap: nowrap;

    white-space: nowrap;

}

.cart-actions button {

    width: 34px;

    height: 34px;

    margin: 0 !important;

    padding: 0;

    border: 1px solid var(--border);

    background: var(--soft);

    border-radius: 9px;

    cursor: pointer;

    font-size: 18px;

}

.cart-actions button:hover {

    border-color: var(--green);

}

.cart-actions .cart-qty {

    min-width: 25px;

    text-align: center;

    font-weight: bold;

}

.cart-actions .remove-item {

    width: auto;

    padding: 0 10px;

    border: 0;

    background: transparent;

    color: #a33;

    font-size: 13px;

}

/* =========================================

   جمع کل

========================================= */

#total {

    margin: 20px 0 15px;

    padding: 16px 4px;

    border-top: 1px solid var(--border);

    font-size: 19px;

    font-weight: bold;

    color: var(--green);

}

/* =========================================

   سبد خالی

========================================= */

.empty-cart {

    text-align: center;

    padding: 45px 10px;

    color: var(--muted);

}

/* =========================================

   فرم ثبت سفارش

========================================= */

.order-form {

    width: 100%;

}

.order-form h2 {

    margin: 0 45px 5px 0;

    font-size: 26px;

}

.order-intro {

    color: var(--muted);

    margin: 0 0 18px;

}

/* خلاصه سفارش */

.checkout-summary {

    width: 100%;

    background: var(--soft);

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 15px;

    margin-bottom: 18px;

}

.checkout-summary > strong {

    display: block;

    margin-bottom: 5px;

}

#checkoutItems {

    width: 100%;

}

.checkout-item {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 12px 0;

    border-bottom: 1px solid #ddd;

}

.checkout-item:last-child {

    border-bottom: 0;

}

.checkout-item-info {

    min-width: 0;

}

.checkout-item-info strong {

    display: block;

}

.checkout-item-info small {

    display: block;

    margin-top: 4px;

    color: var(--muted);

}

.checkout-color {

    margin-top: 3px;

    font-size: 12px;

}

.checkout-item-actions {

    display: flex;

    align-items: center;

    gap: 7px;

    flex-shrink: 0;

}

.checkout-item-actions button {

    width: 32px;

    height: 32px;

    border: 1px solid var(--border);

    background: #fff;

    border-radius: 8px;

    cursor: pointer;

    font-size: 17px;

}

.checkout-item-actions span {

    min-width: 25px;

    text-align: center;

    font-weight: bold;

}

#checkoutTotal {

    margin-top: 12px;

    padding-top: 12px;

    border-top: 1px solid #ddd;

    font-size: 18px;

    font-weight: bold;

    color: var(--green);

}

/* فیلدهای فرم */

.order-fields {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

}

.order-fields input,

.order-fields textarea {

    width: 100%;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 12px;

    outline: none;

    background: #fff;

    font-size: 14px;

}

.order-fields input:focus,

.order-fields textarea:focus {

    border-color: var(--green);

}

.order-fields textarea {

    min-height: 105px;

    resize: vertical;

}

.order-fields textarea:nth-of-type(1) {

    grid-column: 1 / -1;

}

.order-fields textarea:nth-of-type(2) {

    grid-column: 1 / -1;

    min-height: 80px;

}

.order-submit {

    width: 100%;

    margin-top: 15px;

}

.order-error {

    color: #b00020;

    margin-top: 12px;

}

.order-loading {

    color: var(--muted);

    margin-top: 12px;

}

.order-success {

    padding: 16px;

    margin-top: 15px;

    background: #f4fbf8;

    border: 1px solid #16805f;

    border-radius: 13px;

}

.order-success h3 {

    margin-top: 0;

}

.order-code {

    font-size: 22px;

    direction: ltr;

    text-align: center;

    font-weight: bold;

    padding: 10px;

}

.server-error {

    white-space: pre-wrap;

    direction: ltr;

    text-align: left;

    overflow-x: auto;

}

/* =========================================

   Footer

========================================= */

footer {

    text-align: center;

    padding: 35px 15px;

    border-top: 1px solid var(--border);

    color: var(--muted);

}

footer img {

    max-height: 50px;

    max-width: 150px;

}

/* =========================================

   Mobile

========================================= */

@media (max-width: 800px) {

    nav {

        display: none;

    }

    .hero {

        padding: 55px 0;

    }

    .hero > div {

        flex-direction: column;

        text-align: center;

    }

    .hero h1 {

        font-size: 34px;

    }

    .hero-logo {

        max-width: 160px;

    }

    .cards,

    .products {

        grid-template-columns: 1fr;

    }

    .social {

        grid-template-columns: repeat(2, 1fr);

    }

}

/* =========================================

   Mobile Cart

========================================= */

@media (max-width: 600px) {

    #modal {

        padding: 8px;

        align-items: center;

    }

    #modal .cart-modal-box {

        width: 100%;

        max-width: 100%;

        max-height: 94vh;

        border-radius: 18px;

        padding: 20px 15px;

    }

    #modal .cart-modal-box > h2,

    .order-form h2 {

        font-size: 22px;

        margin-right: 42px;

    }

    #items {

        max-height: 55vh;

    }

    #items .cart-item {

        grid-template-columns: 1fr;

        gap: 10px;

        padding: 14px 2px;

    }

    .cart-actions {

        justify-content: flex-start;

    }

    .cart-product-name {

        font-size: 15px;

    }

    .order-fields {

        grid-template-columns: 1fr;

    }

    .order-fields textarea:nth-of-type(1),

    .order-fields textarea:nth-of-type(2) {

        grid-column: auto;

    }

    .checkout-item {

        align-items: flex-start;

        flex-direction: column;

    }

    .checkout-item-actions {

        width: 100%;

    }

    .checkout-item-actions button {

        width: 35px;

        height: 35px;

    }

}

/* =========================================

   Small Mobile

========================================= */

@media (max-width: 480px) {

    .nav {

        min-height: 62px;

    }

    .nav > a img {

        max-width: 100px;

    }

    .hero h1 {

        font-size: 28px;

    }

    .hero p {

        font-size: 14px;

    }

    .section {

        padding: 45px 0;

    }

    .social {

        grid-template-columns: 1fr;

    }

    .outline {

        margin-right: 0;

        margin-top: 8px;

    }

    .tracking input {

        width: 100%;

        margin: 7px 0;

    }

    .tracking .gold {

        width: 100%;

    }

}