:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f7f7f8;
    --text: #262626;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #f4b455;
    --accent-dark: #d88d2f;
    --accent-soft: #fff7e8;
    --ink: #171717;
    --mint: #dff6ee;
    --lavender: #f0ecff;
    --peach: #ffe6da;
    --warning: #b45309;
    --danger: #b42318;
    --success: #067647;
    --shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
.checkout-link {
    align-items: center;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

button:hover,
.checkout-link:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-1px);
}

button:disabled {
    background: #94a3b8;
    border-color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
    text-align: right;
}

[dir="ltr"] body,
[dir="ltr"] input,
[dir="ltr"] select,
[dir="ltr"] textarea {
    text-align: left;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(244, 180, 85, 0.2);
    outline: 0;
}

.site-header {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    padding: 16px clamp(16px, 4vw, 56px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    font-size: 1.45rem;
    font-weight: 900;
    gap: 10px;
}

.brand::before {
    background: var(--accent);
    border-radius: 8px;
    content: "";
    display: inline-block;
    height: 28px;
    width: 28px;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

[dir="rtl"] .nav {
    justify-content: flex-start;
}

.nav a,
.nav-form button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
    min-height: 38px;
    padding: 8px 10px;
}

.nav a:hover,
.nav-form button:hover {
    background: var(--surface-soft);
    color: var(--text);
    transform: none;
}

.nav span {
    background: var(--ink);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.75rem;
    justify-content: center;
    min-width: 22px;
    padding: 1px 7px;
}

.nav-form {
    display: inline-flex;
}

main {
    margin: 0 auto;
    max-width: 1200px;
    padding: 38px clamp(16px, 4vw, 56px) 64px;
}

.hero {
    align-items: center;
    background: linear-gradient(180deg, #fff7e8 0, #ffffff 100%);
    border: 1px solid #ffe4b7;
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    min-height: 260px;
    overflow: hidden;
    padding: 46px 24px;
    text-align: center;
}

.hero h1,
.page-heading h1,
.confirmation h1 {
    font-size: 3.25rem;
    font-weight: 750;
    line-height: 1.08;
    margin: 0 auto 16px;
    max-width: 760px;
}

.hero p {
    color: var(--muted);
    margin-left: auto;
    margin-right: auto;
    max-width: 560px;
}

.eyebrow,
.category {
    color: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.toolbar {
    margin: 24px 0 18px;
}

.filters {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 220px auto;
    padding: 12px;
}

.category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 28px;
}

.category-strip a,
.pagination a {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 800;
    padding: 9px 13px;
}

.category-strip a:hover,
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}

.product-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card,
.cart-row,
.summary,
.checkout-form,
.confirmation,
.admin-stats article,
.admin-table,
.admin-form,
.order-card,
.review-card,
.invoice {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.product-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
    border-color: rgba(244, 180, 85, 0.7);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.product-image,
.detail-image,
.gallery-image {
    align-items: center;
    background-position: center;
    background-size: cover;
    color: #fff;
    display: flex;
    font-size: 2.2rem;
    font-weight: 900;
    justify-content: center;
}

.product-image {
    aspect-ratio: 1 / 1;
    min-height: 0;
}

.product-card:nth-child(3n + 1) .product-image span {
    background: rgba(244, 180, 85, 0.9);
}

.product-card:nth-child(3n + 2) .product-image span {
    background: rgba(167, 139, 250, 0.9);
}

.product-card:nth-child(3n + 3) .product-image span {
    background: rgba(125, 211, 190, 0.9);
}

.product-image span,
.detail-image span {
    border-radius: 999px;
    padding: 10px 18px;
}

.product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.product-info h2,
.cart-row h2,
.summary h2,
.admin-form h2,
.order-card h2 {
    color: var(--ink);
    font-size: 1.08rem;
    margin: 0 0 8px;
}

.product-info p,
.cart-row p,
.page-heading p,
.admin-title-row p,
.order-card p {
    color: var(--muted);
    margin: 0 0 16px;
}

.meta {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 750;
}

.old-price {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 6px;
    text-decoration: line-through;
}

.card-footer {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: auto;
}

.card-footer strong,
.price {
    color: var(--ink);
    font-weight: 950;
}

.product-detail {
    display: grid;
    gap: 34px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
}

.detail-image {
    border-radius: 8px;
    min-height: 520px;
}

.detail-copy {
    align-self: center;
}

.detail-copy h1 {
    color: var(--ink);
    font-size: 3.2rem;
    line-height: 1;
    margin: 0 0 18px;
}

.price {
    font-size: 1.8rem;
}

.buy-box,
.checkout-form,
.admin-form {
    display: grid;
    gap: 14px;
}

.buy-box {
    max-width: 300px;
}

.page-heading {
    margin-bottom: 24px;
}

.cart-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr 340px;
}

.cart-items,
.orders-list,
.gallery-grid,
.reviews-list {
    display: grid;
    gap: 16px;
}

.cart-row {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 110px 120px auto;
    padding: 16px;
}

.link-button {
    background: transparent;
    border-color: transparent;
    color: var(--danger);
    min-height: auto;
    padding: 0;
}

.link-button:hover {
    background: transparent;
    border-color: transparent;
    color: #7a271a;
    transform: none;
}

.summary,
.checkout-form,
.confirmation,
.admin-form,
.order-card {
    padding: 22px;
}

.summary-line {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    margin: 16px 0;
    padding-top: 16px;
}

.total {
    font-size: 1.2rem;
}

.summary .checkout-link,
.summary button {
    margin-top: 10px;
    width: 100%;
}

.checkout-form {
    max-width: 660px;
}

.confirmation {
    max-width: 760px;
}

.empty {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    padding: 28px;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 24px clamp(16px, 4vw, 56px);
    text-align: center;
}

.notice {
    background: #fff0f5;
    border: 1px solid #ffc9dd;
    border-radius: 8px;
    color: #9d315f;
    font-weight: 800;
    margin-top: 0;
    padding: 14px 16px;
}

.login-panel {
    margin: 0 auto;
    max-width: 430px;
}

.admin-stats {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-stats article {
    display: grid;
    gap: 8px;
    padding: 20px;
}

.admin-stats span {
    color: var(--muted);
    font-weight: 800;
    margin: 0;
}

.admin-stats strong {
    color: var(--ink);
    font-size: 2rem;
}

.admin-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 390px;
}

.admin-title-row {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.admin-title-row h1,
.admin-title-row h2 {
    color: var(--ink);
    margin: 0 0 8px;
}

.admin-table {
    overflow: hidden;
}

.admin-table-head,
.admin-table-row {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 1fr) 140px 100px 170px;
    padding: 14px 16px;
}

.admin-table-head {
    background: var(--ink);
    color: #fff;
    font-weight: 900;
}

.admin-table-row {
    align-items: center;
    border-top: 1px solid var(--line);
}

.admin-table-row:nth-child(odd) {
    background: #fbfcfd;
}

.admin-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-actions a {
    color: var(--accent-dark);
    font-weight: 900;
}

.checkbox-label {
    align-items: center;
    display: flex;
    gap: 10px;
}

.checkbox-label input {
    min-height: auto;
    width: auto;
}

.status-form {
    align-items: end;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
    margin: 16px 0;
    padding: 14px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0;
}

.pagination a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.invoice-page {
    max-width: 920px;
}

.invoice {
    padding: 28px;
}

.gallery-grid,
.reviews-list {
    margin-top: 28px;
}

.gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-image {
    aspect-ratio: 4 / 3;
    border-radius: 8px;
}

.review-card {
    padding: 18px;
}

.account-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-card ul {
    margin-bottom: 0;
    padding-left: 20px;
}

@media print {
    .site-header,
    button,
    .checkout-link {
        display: none;
    }

    body {
        background: #fff;
    }

    .invoice {
        border: 0;
        box-shadow: none;
    }
}

@media (max-width: 920px) {
    .filters,
    .product-grid,
    .product-detail,
    .cart-layout,
    .admin-stats,
    .admin-layout,
    .account-layout,
    .status-form,
    .gallery-grid,
    .admin-table-head,
    .admin-table-row {
        grid-template-columns: 1fr;
    }

    .cart-row {
        grid-template-columns: 1fr;
    }

    .detail-image {
        min-height: 320px;
    }

    .hero h1,
    .page-heading h1,
    .confirmation h1 {
        font-size: 2.6rem;
    }

    .detail-copy h1 {
        font-size: 2.4rem;
    }
}

@media (max-width: 620px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .nav {
        justify-content: flex-start;
        width: 100%;
    }

    .nav a,
    .nav-form button {
        padding-left: 8px;
        padding-right: 8px;
    }

    main {
        padding-top: 18px;
    }

    .hero {
        min-height: 390px;
        padding: 24px;
    }

    .hero h1,
    .page-heading h1,
    .confirmation h1 {
        font-size: 2.1rem;
    }

    .detail-copy h1 {
        font-size: 2rem;
    }

    .card-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .card-footer button,
    .card-footer form {
        width: 100%;
    }
}
