/* =========================================================
   شیدا تم — سیستم طراحی
   پالت: کرم گرم + زرشکی + طلایی عتیقه
   فونت: وزیرمتن
========================================================= */

:root {
    --ink: #2a1512;
    --ink-soft: #6b5650;
    --cream: #fbf3e6;
    --surface: #ffffff;
    --surface-alt: #f3e6d3;
    --plum: #6d1f3f;
    --plum-dark: #501530;
    --gold: #c1943f;
    --gold-light: #e7c98a;
    --wood: #8a5a34;
    --metal: #55606c;
    --wedding: #b98a2e;
    --green: #2c7a4b;
    --red: #a3323a;
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --shadow-soft: 0 10px 28px rgba(42, 21, 18, 0.09);
    --shadow-lift: 0 16px 34px rgba(42, 21, 18, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    background: var(--cream);
    color: var(--ink);
    text-align: center;
    line-height: 1.7;
}

a {
    font-family: inherit;
}

/* دسترسی‌پذیری: حالت فوکوس با کیبورد همیشه دیده بشه */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* =========================================================
   نوار بالایی
========================================================= */

.top-bar {
    width: calc(100% - 40px);
    max-width: 1100px;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.brand {
    color: var(--plum);
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
}

.cart-link,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--plum);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.25s ease;
}

.cart-link:hover,
.back-link:hover {
    background: var(--plum-dark);
    transform: translateY(-2px);
}

.cart-count {
    display: none;
    background: var(--gold-light);
    color: var(--plum-dark);
    font-weight: 800;
    border-radius: 50%;
    min-width: 20px;
    padding: 2px 6px;
    margin-inline-start: 4px;
    font-size: 12px;
}

/* =========================================================
   هیرو — با یه طاق تزئینی که یادآور استند‌های بادکنکیه
========================================================= */

.hero {
    position: relative;
    padding: 90px 20px 70px;
    margin: 25px auto;
    max-width: 1100px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    animation: hero-rise 0.6s ease both;
}

@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    top: -90px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--gold-light), transparent 70%);
    opacity: 0.55;
}

.hero::before {
    right: -60px;
}

.hero::after {
    left: -70px;
    top: -60px;
    background: radial-gradient(circle at 35% 35%, var(--plum), transparent 70%);
    opacity: 0.12;
}

.small-hero {
    padding: 50px 20px;
}

.hero h1 {
    position: relative;
    margin: 0;
    font-size: 44px;
    font-weight: 900;
    color: var(--plum);
    letter-spacing: -0.5px;
}

.hero p {
    position: relative;
    font-size: 19px;
    color: var(--ink-soft);
    margin: 16px 0 28px;
}

.main-btn {
    display: inline-block;
    background: var(--plum);
    color: white;
    text-decoration: none;
    padding: 14px 30px;
    border-radius: 999px;
    font-weight: 700;
    transition: background 0.25s ease, transform 0.25s ease;
}

.main-btn:hover {
    background: var(--plum-dark);
    transform: translateY(-2px);
}

/* =========================================================
   صفحه‌ی اصلی
========================================================= */

.home-page {
    max-width: 1100px;
    margin: 10px auto 30px;
    padding: 20px;
}

.welcome-section,
.about-section {
    background: var(--surface);
    padding: 34px 30px;
    margin-bottom: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.welcome-section h2,
.about-section h2 {
    color: var(--plum);
    font-size: 26px;
    margin-top: 0;
}

.welcome-section p,
.about-section p {
    color: var(--ink-soft);
    line-height: 2;
    font-size: 17px;
}

.categories-title {
    text-align: center;
    color: var(--plum);
    font-size: 24px;
    margin: 40px 0 22px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.phone-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.phone-link {
    display: block;
    text-decoration: none;
    color: var(--plum);
    background: var(--surface-alt);
    padding: 13px;
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-weight: 700;
    direction: ltr;
    transition: background 0.2s ease;
}

.phone-link:hover {
    background: var(--gold-light);
}

/* =========================================================
   مسیر ناوبری (Breadcrumb)
========================================================= */

.breadcrumb {
    max-width: 1100px;
    margin: 14px auto 0;
    padding: 0 22px;
    font-size: 14px;
    color: var(--ink-soft);
    text-align: right;
}

.breadcrumb a {
    color: var(--plum);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.category-intro {
    max-width: 760px;
    margin: 0 auto 30px;
    color: var(--ink-soft);
    line-height: 2;
    font-size: 15.5px;
    text-align: center;
}

.related-categories {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px dashed rgba(42, 21, 18, 0.15);
}

.related-categories h2 {
    color: var(--plum);
    font-size: 19px;
    margin-bottom: 16px;
}

.related-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.related-links a {
    display: inline-block;
    background: var(--surface-alt);
    color: var(--plum);
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.related-links a:hover {
    background: var(--gold-light);
}

/* =========================================================
   صفحات دسته‌بندی محصولات (چوبی / فلزی / عقد)
========================================================= */

.products-page {
    max-width: 1100px;
    margin: 10px auto 40px;
    padding: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .product-card {
        padding: 14px 12px 16px;
        border-top-width: 4px;
    }

    .product-card img {
        max-height: 110px;
    }

    .product-card h3 {
        font-size: 15px;
        margin: 6px 0;
        line-height: 1.4;
    }

    .product-description {
        font-size: 12.5px;
        line-height: 1.6;
        min-height: 0;
    }

    .product-price {
        font-size: 15px !important;
        margin: 8px 0;
    }

    .product-stock {
        font-size: 12px;
    }

    .add-cart-btn {
        padding: 9px 10px;
        font-size: 12.5px;
    }

    .category-intro {
        font-size: 14px;
    }
}

/* =========================================================
   کارت دسته‌بندی — هر متریال رنگ خودش رو داره
========================================================= */

.category-card,
.product-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 30px 22px 24px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-top: 5px solid var(--gold);
}

.category-card {
    width: 300px;
}

.product-card {
    width: 100%;
}

.category-card:hover,
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
}

.category-card--wood {
    border-top-color: var(--wood);
}

.category-card--metal {
    border-top-color: var(--metal);
}

.category-card--wedding {
    border-top-color: var(--wedding);
}

.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--surface-alt);
    font-size: 30px;
    margin-bottom: 14px;
}

.category-card h3,
.product-card h3 {
    font-size: 21px;
    font-weight: 800;
    color: var(--plum);
    margin: 10px 0;
}

.category-card p,
.product-card p {
    color: var(--ink-soft);
    font-size: 15.5px;
    line-height: 1.9;
}

.product-card img {
    width: 100%;
    max-height: 190px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.product-description {
    color: var(--ink-soft);
    line-height: 1.8;
    min-height: 30px;
}

.product-price,
.price {
    color: var(--gold) !important;
    font-size: 19px !important;
    font-weight: 800;
    margin: 12px 0;
}

.product-stock,
.stock {
    color: var(--green) !important;
    font-weight: 700;
    font-size: 14.5px;
}

.stock-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--green);
    border-radius: 50%;
    margin-inline-start: 5px;
}

.empty-message {
    background: var(--surface);
    padding: 34px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    color: var(--ink-soft);
}

/* =========================================================
   دکمه‌ها
========================================================= */

.category-btn,
.checkout-btn,
.submit-order,
.add-cart-btn {
    display: inline-block;
    width: auto;
    border: none;
    background: var(--plum);
    color: white;
    text-decoration: none;
    padding: 12px 26px;
    border-radius: 999px;
    margin-top: 10px;
    font-size: 15.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.category-btn:hover,
.checkout-btn:hover,
.submit-order:hover,
.add-cart-btn:hover:not(:disabled) {
    background: var(--plum-dark);
    transform: translateY(-2px);
}

.add-cart-btn {
    width: 100%;
}

.add-cart-btn:disabled {
    background: #b8aca6;
    cursor: not-allowed;
}

/* =========================================================
   سبد خرید
========================================================= */

.cart-page {
    width: min(850px, calc(100% - 30px));
    margin: 30px auto 60px;
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.cart-item {
    text-align: right;
    background: var(--surface-alt);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(42, 21, 18, 0.06);
}

.cart-item h3 {
    color: var(--plum);
    margin-top: 0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
}

.quantity-controls button {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--plum);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quantity-controls button:hover {
    background: var(--plum-dark);
}

.quantity-controls span {
    min-width: 35px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.remove-btn {
    border: none;
    background: var(--red);
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.remove-btn:hover {
    background: #7f2429;
}

.cart-total {
    border-top: 1px dashed rgba(42, 21, 18, 0.15);
    margin-top: 25px;
    padding-top: 20px;
    font-size: 21px;
    font-weight: 800;
    color: var(--plum);
}

.cart-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.disabled-link {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================================================
   ثبت سفارش
========================================================= */

.order-page {
    width: min(700px, calc(100% - 30px));
    margin: 30px auto 60px;
}

.order-form {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.order-form h2 {
    color: var(--plum);
    margin-top: 10px;
    font-size: 20px;
}

.order-form input,
.order-form textarea {
    width: 100%;
    padding: 14px;
    margin: 8px 0;
    border: 1px solid rgba(42, 21, 18, 0.15);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    background: var(--cream);
    transition: border-color 0.2s ease;
}

.order-form input:focus,
.order-form textarea:focus {
    border-color: var(--gold);
}

.order-form textarea {
    min-height: 120px;
    resize: vertical;
}

.order-summary-item {
    background: var(--surface-alt);
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: var(--radius-sm);
    text-align: right;
}

.order-total {
    margin: 20px 0;
    padding: 15px;
    border-top: 1px dashed rgba(42, 21, 18, 0.15);
    font-size: 19px;
    font-weight: 700;
    color: var(--plum);
}

.submit-order {
    width: 100%;
    margin-top: 15px;
}

.order-message {
    margin-top: 18px;
    font-weight: 700;
}

.order-message.success {
    color: var(--green);
}

.order-message.error {
    color: var(--red);
}

/* =========================================================
   فوتر
========================================================= */

footer,
.site-footer {
    max-width: 1100px;
    margin: 10px auto 30px;
    padding: 26px 20px;
    color: var(--ink-soft);
    font-size: 14px;
}

.site-footer strong {
    color: var(--plum);
}

/* =========================================================
   موبایل
========================================================= */

@media (max-width: 768px) {

    .top-bar {
        width: calc(100% - 20px);
        margin-top: 10px;
        flex-direction: row;
        gap: 10px;
        padding: 12px 16px;
    }

    .brand {
        font-size: 18px;
    }

    .cart-link,
    .back-link {
        padding: 8px 14px;
        font-size: 14px;
    }

    .hero {
        margin: 15px auto;
        padding: 60px 15px 45px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 16px;
    }

    .category-container {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        justify-content: center;
        align-items: stretch;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .category-card {
        width: auto;
        max-width: none;
        min-width: 0;
        padding: 16px 8px;
        border-top-width: 4px;
    }

    .category-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
        margin-bottom: 8px;
    }

    .category-card h3 {
        font-size: 14px;
        margin: 6px 0;
        line-height: 1.5;
    }

    .category-card p {
        font-size: 11px;
        line-height: 1.6;
    }

    .category-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .product-container {
        flex-direction: column;
        align-items: center;
    }

    .product-card {
        width: 100%;
        max-width: 360px;
    }

    .cart-page,
    .order-page {
        width: calc(100% - 20px);
    }

    .cart-page {
        padding: 20px;
    }
}

/* =========================================================
   دکمه‌ی «برو بالا»
========================================================= */

#backToTop {
    position: fixed;
    bottom: 24px;
    left: 20px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--plum);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
    z-index: 50;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    background: var(--plum-dark);
}

@media (max-width: 560px) {
    #backToTop {
        bottom: 16px;
        left: 14px;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* =========================================================
   صفحه‌ی ورود
========================================================= */

body.login-page {
    background: var(--plum-dark);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(193, 148, 63, 0.25), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(193, 148, 63, 0.18), transparent 45%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page .hero {
    background: transparent;
    box-shadow: none;
    max-width: 420px;
    margin: 30px auto;
    padding: 20px;
}

.login-page .hero::before,
.login-page .hero::after {
    display: none;
}

.login-page .hero h1 {
    color: var(--gold-light);
    font-size: 30px;
}

.login-page .form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 24px;
    margin-top: 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    animation: login-form-rise 0.5s ease both;
}

@keyframes login-form-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-page .input {
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    background-color: var(--cream);
    border: 2px solid transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.login-page .input::placeholder {
    color: var(--ink-soft);
}

.login-page .input:hover,
.login-page .input:focus {
    border-color: var(--gold);
    outline: none;
}

.login-page button {
    padding: 13px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--plum);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.login-page button:hover {
    background-color: var(--plum-dark);
    transform: translateY(-2px);
}

.login-page #message {
    color: var(--gold-light);
    font-weight: 600;
}
