:root {
    --bg: #eef2f3;
    --bg-soft: #f6f8f8;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --surface-tint: #f3f6f6;
    --text: #162126;
    --muted: #60717a;
    --line: rgba(22, 33, 38, 0.1);
    --brand: #d94f2b;
    --brand-strong: #b53d1c;
    --accent: #17343d;
    --accent-2: #24515d;
    --accent-soft: #dce8ea;
    --warning: #f59f0b;
    --success: #16825d;
    --danger: #bb4343;
    --shadow-sm: 0 8px 18px rgba(23, 37, 42, 0.06);
    --shadow-md: 0 16px 34px rgba(23, 37, 42, 0.08);
    --shadow-lg: 0 22px 48px rgba(23, 37, 42, 0.1);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --space-section: 42px;
    --space-stack: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Vazirmatn', sans-serif;
    background:
        radial-gradient(circle at top right, rgba(217, 79, 43, 0.08), transparent 22%),
        radial-gradient(circle at top left, rgba(23, 52, 61, 0.09), transparent 24%),
        linear-gradient(180deg, #edf2f2 0%, #f8f9f9 42%, #eef2f3 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

input,
textarea,
button,
select {
    font: inherit;
}

button {
    border: 0;
}

.container {
    width: 100%;
    max-width: 1192px;
    padding-inline: 16px;
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(16px);
    background: rgba(246, 248, 248, 0.78);
    border-bottom: 1px solid rgba(22, 33, 38, 0.06);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
}

.brand small,
.menu,
.product-body p,
.product-summary p,
.site-footer p,
.site-footer li,
.section-head p {
    color: var(--muted);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 800;
    box-shadow: var(--shadow-md);
}

.menu {
    display: flex;
    gap: 20px;
}

.header-panel {
    display: contents;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 14px;
    background: rgba(23, 52, 61, 0.08);
    color: var(--accent);
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.header-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 16px;
    border-radius: 999px;
    background: rgba(23, 52, 61, 0.06);
    color: var(--accent);
}

.header-user-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(23, 52, 61, 0.08);
}

.header-user-icon svg {
    width: 20px;
    height: 20px;
}

.header-user-text {
    font-weight: 700;
    font-size: 0.92rem;
}

.menu a {
    position: relative;
    padding-bottom: 4px;
}

.menu a::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--brand);
    transition: width 0.2s ease;
}

.menu a:hover::after {
    width: 100%;
}

.cta-link,
.btn,
.back-to-top,
.category-pill,
.sort-chip,
.deals-nav {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cta-link,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.cta-link {
    padding: 11px 20px;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn {
    padding: 12px 22px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover,
.cta-link:hover,
.category-pill:hover,
.back-to-top:hover,
.sort-chip:hover,
.deals-nav:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: rgba(23, 52, 61, 0.05);
    color: var(--accent);
    border-color: rgba(23, 52, 61, 0.12);
}

.hero,
.featured-deals,
.products,
.product-page,
.similar-products,
.auth-shell,
.not-found,
.admin-shell {
    padding: var(--space-section) 0;
}

.product-layout,
.admin-grid,
.auth-grid {
    display: grid;
    gap: 22px;
    align-items: stretch;
}

.product-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.admin-grid {
    grid-template-columns: 1.08fr 0.92fr;
}

.auth-grid {
    grid-template-columns: 1.05fr 0.95fr;
}

.product-summary,
.product-gallery,
.not-found .container,
.product-card,
.footer-grid,
.admin-card,
.admin-login-card,
.auth-panel {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.product-summary,
.not-found .container,
.admin-card,
.admin-login-card,
.product-card,
.auth-panel {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.72);
}

.product-summary,
.not-found .container,
.admin-card,
.admin-login-card,
.auth-panel {
    padding: 30px;
}

.product-gallery {
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
}

.hero-banner {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    background: #dbe3e5;
}

.hero-banner picture {
    display: block;
}

.hero-banner-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.hero-banner-fade {
    display: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(23, 52, 61, 0.07);
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 1.1;
    margin-bottom: 14px;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1.2;
    margin-bottom: 8px;
}

h3 {
    font-size: 1.02rem;
    margin-bottom: 8px;
}

p,
li {
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.product-grid,
.footer-grid {
    display: grid;
    gap: 18px;
}

.section-head {
    margin-bottom: 18px;
}

.category-filter-wrap {
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 248, 248, 0.92));
    border: 1px solid rgba(23, 52, 61, 0.08);
    box-shadow: var(--shadow-sm);
}

.controls-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.controls-label span {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--muted);
    min-width: 0;
}

.products-headbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 22px;
}

.sort-box {
    display: flex;
    justify-content: flex-start;
}

.sort-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-desktop,
.sort-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(23, 52, 61, 0.08);
    box-shadow: var(--shadow-sm);
}

.sort-desktop {
    flex-wrap: wrap;
}

.sort-mobile {
    display: none;
}

.sort-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 0.94rem;
}

.sort-title small {
    color: var(--muted);
    font-size: 0.88rem;
}

.sort-title-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(23, 52, 61, 0.08);
    color: var(--accent);
    font-weight: 700;
}

.sort-chip {
    padding: 9px 13px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
}

.sort-chip:hover {
    color: var(--brand-strong);
}

.sort-chip.active {
    background: rgba(23, 52, 61, 0.08);
    color: var(--accent);
    font-weight: 700;
}

.sort-label {
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.sort-select-wrap {
    position: relative;
}

.sort-select {
    min-width: 200px;
    padding: 11px 40px 11px 14px;
    border-radius: 14px;
    border: 1px solid rgba(23, 52, 61, 0.12);
    background: var(--surface-strong);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.sort-caret {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: translateY(-65%) rotate(-45deg);
    pointer-events: none;
}

.featured-deals {
    overflow: hidden;
}

.deals-showcase {
    padding-top: 4px;
}

.deals-frame {
    position: relative;
    padding: 12px;
    border-radius: 26px;
    background: linear-gradient(135deg, #cf4928 0%, #ea6c31 100%);
    box-shadow: 0 18px 38px rgba(201, 86, 49, 0.22);
}

.deals-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 220px;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 0 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.deals-rail::-webkit-scrollbar {
    display: none;
}

.deals-intro-card,
.deal-product-card,
.deals-more-card {
    min-height: 100%;
    border-radius: 22px;
}

.deals-intro-card {
    width: 176px;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.deals-intro-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.62);
    font-size: 1.3rem;
    font-weight: 800;
}

.deals-intro-card h2 {
    margin: 16px 0 6px;
    font-size: 1.45rem;
    color: #fff;
}

.deals-intro-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.75;
}

.deal-product-card {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.48);
    box-shadow: var(--shadow-sm);
}

.deal-product-link {
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: 21px;
    background: #fff;
}

.deal-product-media {
    padding: 10px;
    background: #f3f6f6;
}

.deal-product-media img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    border-radius: 16px;
    object-fit: cover;
}

.deal-product-body {
    padding: 12px 13px 13px;
}

.deal-product-title {
    height: 50px;
    margin-bottom: 14px;
    overflow: hidden;
    font-size: 0.93rem;
    line-height: 1.7;
    color: var(--text);
}

.deal-product-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.deal-product-discount {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.deal-discount-badge {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--warning);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
}

.deal-product-discount del {
    color: rgba(22, 33, 38, 0.54);
    font-size: 0.84rem;
}

.deal-product-price {
    text-align: left;
    color: var(--brand-strong);
}

.deal-product-price strong {
    font-size: 0.98rem;
}

.deals-more-card {
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-strong);
    font-weight: 700;
}

.deals-more-arrow {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid currentColor;
    font-size: 1.7rem;
    line-height: 1;
}

.deals-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: var(--brand-strong);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    z-index: 2;
    font-size: 1.45rem;
    line-height: 1;
}

.deals-nav-prev {
    right: 10px;
}

.deals-nav-next {
    left: 10px;
}

.category-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 4px 0 8px;
    scrollbar-width: thin;
}

.category-scroll::-webkit-scrollbar {
    height: 8px;
}

.category-scroll::-webkit-scrollbar-thumb {
    background: rgba(23, 52, 61, 0.18);
    border-radius: 999px;
}

.category-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 88px;
    gap: 8px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    color: var(--text);
    min-width: 88px;
}

.category-pill-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #e6eef0 0%, #f8fbfb 100%);
    border: 1px solid rgba(23, 52, 61, 0.08);
    color: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.category-pill-icon img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    display: block;
}

.category-pill-icon-text {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.category-pill-label {
    min-height: 2.7em;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    color: var(--muted);
    width: 100%;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.category-pill.active .category-pill-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 12px 24px rgba(23, 52, 61, 0.18);
}

.category-pill.active .category-pill-label {
    color: var(--accent);
}

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

.product-card {
    overflow: hidden;
}

.product-image {
    aspect-ratio: 1 / 1;
    height: auto;
    position: relative;
    background-size: cover;
    background-position: center;
}

.product-cover {
    aspect-ratio: 1 / 1;
    min-height: 0;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
}

.product-gallery-strip {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.product-gallery-thumb {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    border: 1px solid rgba(23, 52, 61, 0.12);
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.92);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-gallery-thumb:hover,
.product-gallery-thumb.is-active {
    transform: translateY(-2px);
    border-color: rgba(217, 79, 43, 0.4);
    box-shadow: 0 14px 28px rgba(18, 39, 48, 0.12);
}

.badge,
.discount-badge {
    position: absolute;
    top: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge {
    right: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.discount-badge {
    left: 14px;
    background: rgba(217, 79, 43, 0.94);
    color: #fff;
}

.product-body {
    padding: 18px;
}

.product-category {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand-strong);
    font-size: 0.9rem;
    font-weight: 700;
}

.product-pricing {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.product-pricing del {
    color: var(--muted);
}

.product-pricing strong,
.price {
    color: var(--brand-strong);
    font-size: 1.08rem;
}

.product-pricing.single {
    margin-top: 18px;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    color: var(--muted);
}

.product-meta a {
    color: var(--accent);
    font-weight: 700;
}

.feature-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.site-footer {
    padding: 22px 0 44px;
}

.footer-grid {
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 18px;
    padding: 26px;
    border: 1px solid rgba(23, 52, 61, 0.08);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(210, 154, 108, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 247, 0.96));
    color: var(--text);
    box-shadow: var(--shadow-md);
}

.footer-grid > div {
    padding: 6px;
}

.footer-brand-block,
.footer-card {
    min-width: 0;
}

.footer-brand-block {
    padding: 8px 6px;
}

.footer-brand-block h3,
.footer-card h4 {
    margin: 0 0 10px;
    color: var(--accent);
}

.footer-brand-block h3 {
    font-size: 1.35rem;
}

.footer-brand-block p {
    margin: 0;
    max-width: 32ch;
    color: var(--muted);
    line-height: 1.9;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.footer-badges span {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(23, 52, 61, 0.08);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.footer-card {
    padding: 16px 16px 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(23, 52, 61, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.site-footer p,
.site-footer li,
.footer-card span {
    color: var(--muted);
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.footer-list li {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(23, 52, 61, 0.08);
}

.footer-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.footer-list strong {
    color: var(--text);
    font-size: 0.9rem;
}

.footer-list-simple li {
    position: relative;
    padding-right: 16px;
}

.footer-list-simple li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.7em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(36, 81, 93, 0.5);
}

.back-to-top {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.admin-stat-card {
    padding: 18px 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 247, 247, 0.96));
    border: 1px solid rgba(23, 52, 61, 0.08);
    box-shadow: var(--shadow-sm);
}

.admin-stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.admin-stat-card strong {
    font-size: 1.5rem;
    color: var(--accent);
}

.admin-form {
    display: grid;
    gap: 14px;
}

.admin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-card-head h2 {
    margin-bottom: 6px;
}

.admin-card-head p {
    margin: 0;
    color: var(--muted);
}

.admin-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-filters input,
.admin-filters select {
    width: 100%;
    border: 1px solid rgba(23, 52, 61, 0.14);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.admin-filters {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 14px;
    margin-bottom: 18px;
    align-items: end;
}

.admin-filters label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.admin-filters-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-form-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.admin-form-split-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-upload-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(23, 52, 61, 0.06);
    color: var(--accent);
    line-height: 1.8;
    font-size: 0.92rem;
    font-weight: 600;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: right;
}

.admin-table a {
    color: var(--accent);
    font-weight: 700;
}

.admin-table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-link-button {
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.admin-link-button.is-danger {
    color: var(--danger);
}

.admin-product-cell {
    display: grid;
    gap: 4px;
}

.admin-product-cell span {
    color: var(--muted);
    font-size: 0.84rem;
}

.admin-status-badge,
.product-stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-status-badge.is-available,
.product-stock-pill.is-available {
    background: rgba(22, 130, 93, 0.12);
    color: var(--success);
}

.admin-status-badge.is-unavailable,
.product-stock-pill.is-unavailable {
    background: rgba(187, 67, 67, 0.12);
    color: var(--danger);
}

.admin-status-toggle {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(23, 52, 61, 0.05);
}

.admin-login-wrap {
    display: flex;
    justify-content: center;
}

.admin-login-card {
    width: min(560px, 100%);
}

.flash {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 600;
}

.flash-success {
    background: rgba(22, 130, 93, 0.12);
    color: var(--success);
}

.flash-error {
    background: rgba(187, 67, 67, 0.12);
    color: var(--danger);
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .product-layout,
    .footer-grid,
    .admin-grid,
    .auth-grid {
        grid-template-columns: 1fr;
    }

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

    .sort-form,
    .sort-box,
    .products-headbar {
        width: 100%;
    }

    .sort-desktop {
        display: none;
    }

    .sort-mobile {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 720px) {
    :root {
        --space-section: 28px;
        --space-stack: 14px;
        --radius-xl: 24px;
        --radius-lg: 18px;
        --radius-md: 14px;
    }

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

    .container {
        width: 100%;
        max-width: 100%;
        padding-inline: 10px;
    }

    .hero,
    .featured-deals,
    .products,
    .product-page,
    .similar-products,
    .auth-shell,
    .not-found,
    .admin-shell {
        padding: 24px 0;
    }

    .products-headbar,
    .sort-form,
    .sort-mobile,
    .product-meta,
    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-stats,
    .admin-form-split-3,
    .admin-filters {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        gap: 10px;
    }

    .hero-actions .btn,
    .hero-actions .cta-link {
        width: 100%;
    }

    .site-header {
        backdrop-filter: blur(12px);
    }

    .nav {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
        padding: 10px 0;
    }

    .brand {
        min-width: 0;
        gap: 10px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 0.92rem;
    }

    .brand strong {
        font-size: 0.95rem;
    }

    .menu-toggle {
        display: inline-flex;
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .header-panel {
        display: none;
        grid-column: 1 / -1;
        padding: 12px;
        border-radius: 18px;
        background: rgba(252, 250, 246, 0.96);
        box-shadow: var(--shadow-md);
        border: 1px solid rgba(31, 26, 23, 0.06);
    }

    .header-panel.is-open {
        display: grid;
        gap: 14px;
    }

    .menu,
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .menu a,
    .header-user,
    .header-actions .cta-link {
        width: 100%;
    }

    .menu a {
        padding: 8px 0;
    }

    .header-user {
        justify-content: center;
        padding-inline: 14px;
    }

    .header-user-text {
        font-size: 0.88rem;
    }

    .hero-banner {
        border-radius: 20px;
    }

    .hero-banner-image {
        min-height: 360px;
        object-fit: cover;
        object-position: center top;
    }

    .hero-banner-fade {
        display: block;
        position: absolute;
        inset: auto 0 0 0;
        height: 110px;
        background: linear-gradient(180deg, rgba(238, 242, 243, 0) 0%, rgba(238, 242, 243, 0.52) 48%, rgba(238, 242, 243, 0.96) 100%);
    }

    .product-summary,
    .not-found .container,
    .product-gallery,
    .footer-grid,
    .admin-card,
    .admin-login-card,
    .auth-panel {
        padding: 18px;
    }

    .product-layout,
    .admin-grid,
    .auth-grid {
        gap: 16px;
    }

    .product-gallery {
        padding: 14px;
    }

    .product-summary h1 {
        margin-bottom: 10px;
        font-size: 1.55rem;
    }

    .product-summary .eyebrow {
        margin-bottom: 8px;
    }

    .feature-list {
        margin-top: 14px;
    }

    .feature-list li {
        padding: 8px 0;
        line-height: 1.7;
    }

    .section-head {
        margin-bottom: 14px;
    }

    .section-head h2 {
        margin-bottom: 4px;
        font-size: 1.45rem;
    }

    .section-head p,
    .product-body p,
    .product-summary p,
    .site-footer p {
        line-height: 1.65;
    }

    .category-filter-wrap {
        gap: 12px;
        margin-bottom: 18px;
        padding: 14px;
        border-radius: 20px;
        overflow: hidden;
    }

    .controls-label {
        margin-bottom: 6px;
    }

    .category-filter-wrap,
    .products-headbar {
        width: 100%;
        min-width: 0;
    }

    .category-scroll {
        display: flex;
        gap: 10px;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 0 8px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .category-pill {
        flex: 0 0 80px;
        min-width: 80px;
        gap: 6px;
        scroll-snap-align: start;
    }

    .category-pill-icon {
        width: 60px;
        height: 60px;
    }

    .deals-frame {
        padding: 10px 8px;
        border-radius: 22px;
    }

    .deals-nav {
        display: none;
    }

    .deals-rail {
        grid-auto-columns: 174px;
        gap: 10px;
    }

    .deals-intro-card {
        width: 146px;
        padding: 18px 12px;
    }

    .deals-more-card {
        width: 174px;
    }

    .category-pill-icon img {
        width: 46px;
        height: 46px;
    }

    .sort-box,
    .sort-form,
    .sort-mobile,
    .sort-select-wrap,
    .sort-select {
        width: 100%;
    }

    .sort-mobile {
        gap: 10px;
        padding: 10px;
        border-radius: 16px;
        align-items: stretch;
    }

    .sort-label {
        font-size: 0.84rem;
        white-space: normal;
        line-height: 1.5;
    }

    .sort-select {
        min-width: 0;
        padding: 12px 38px 12px 12px;
    }

    h1 {
        font-size: 1.75rem;
    }

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

    .product-card {
        border-radius: 20px;
    }

    .product-image {
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .product-body {
        padding: 12px;
    }

    .product-body h3 {
        margin-bottom: 6px;
        font-size: 0.92rem;
        line-height: 1.55;
        min-height: 2.9em;
    }

    .product-body p {
        display: -webkit-box;
        min-height: 3.3em;
        overflow: hidden;
        font-size: 0.82rem;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .product-category {
        margin-bottom: 6px;
        font-size: 0.78rem;
    }

    .product-pricing {
        gap: 6px;
        margin-top: 10px;
    }

    .product-pricing strong,
    .price {
        font-size: 0.95rem;
    }

    .product-pricing del {
        font-size: 0.75rem;
    }

    .product-meta {
        gap: 8px;
        margin-top: 12px;
        font-size: 0.78rem;
    }

    .product-meta span {
        display: none;
    }

    .badge,
    .discount-badge {
        top: 10px;
        padding: 6px 9px;
        font-size: 0.72rem;
    }

    .badge {
        right: 10px;
    }

    .discount-badge {
        left: 10px;
    }

    .product-cover {
        aspect-ratio: 1 / 1;
        min-height: 0;
    }

    .product-gallery-thumb {
        flex-basis: 76px;
        width: 76px;
        height: 76px;
        border-radius: 18px;
    }

    .footer-grid,
    .admin-form-split {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        gap: 14px;
        padding: 20px 22px;
        border-radius: 24px;
    }

    .site-footer {
        padding: 18px 10px 28px;
    }

    .footer-card {
        padding: 15px 14px;
        border-radius: 20px;
    }

    .footer-brand-block p {
        max-width: none;
    }

    .admin-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .back-to-top {
        left: 12px;
        bottom: 12px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 540px) {
    .container {
        padding-inline: 7px;
    }
}

@media (max-width: 420px) {
    .container {
        max-width: 100%;
        padding-inline: 10px;
    }

    html,
    body {
        overflow-x: clip;
    }

    .site-header,
    .hero,
    .featured-deals,
    .products,
    .product-page,
    .similar-products,
    .site-footer {
        overflow-x: clip;
    }

    .site-footer {
        padding-inline: 10px;
    }

    .footer-grid {
        padding: 18px 16px;
    }

    .nav,
    .brand,
    .brand > div,
    .category-filter-wrap,
    .deals-frame,
    .footer-grid,
    .product-summary,
    .product-gallery {
        min-width: 0;
        max-width: 100%;
    }

    .brand {
        gap: 8px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .brand > div {
        overflow: hidden;
    }

    .brand strong,
    .brand small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand small {
        display: none;
    }

    .deals-showcase,
    .hero-banner-wrap {
        overflow-x: clip;
    }

    .hero-banner-image {
        min-height: 320px;
    }

    .category-scroll {
        display: flex;
        gap: 8px;
    }

    .category-pill {
        flex-basis: 72px;
        min-width: 72px;
    }

    .category-pill-icon {
        width: 56px;
        height: 56px;
    }

    .category-pill-icon img {
        width: 40px;
        height: 40px;
    }

    .category-pill-label {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .controls-label span,
    .sort-label {
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .sort-mobile {
        gap: 8px;
        padding: 9px;
    }

    .sort-select {
        font-size: 0.84rem;
    }

    .deals-rail {
        grid-auto-columns: 166px;
    }

    .deals-intro-card,
    .deals-more-card {
        width: 166px;
    }

    .product-grid {
        gap: 10px;
    }

    .product-image {
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .product-body {
        padding: 10px;
    }

    .product-body h3 {
        font-size: 0.86rem;
        min-height: 3.1em;
    }

    .product-body p {
        font-size: 0.78rem;
        min-height: 3.1em;
    }

    .product-pricing strong,
    .price {
        font-size: 0.9rem;
    }

    .product-gallery-thumb {
        flex-basis: 68px;
        width: 68px;
        height: 68px;
        border-radius: 16px;
    }
}
