
:root {
  --bg: #101010;
  --surface: #191919;
  --surface-2: #222222;
  --red: #e32636;
  --red-dark: #b91525;
  --white: #ffffff;
  --muted: #999999;
  --border: #303030;
  --radius: 12px;
  --font: "Vazirmatn", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.8;
  direction: rtl;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

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

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

/* HEADER */

.header {
  height: 78px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(16, 16, 16, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -1px;
  direction: ltr;
  white-space: nowrap;
}

.logo span {
  color: var(--red);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  color: #bcbcbc;
  font-size: 14px;
  transition: 0.2s;
}

.main-nav a:hover {
  color: var(--red);
}

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

.cart-button,
.menu-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: white;
  padding: 9px 15px;
  border-radius: 7px;
  font-size: 13px;
}

.cart-button span:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  margin-right: 5px;
}

.menu-button:hover,
.cart-button:hover {
  border-color: var(--red);
}

/* HERO */

.hero {
  min-height: 530px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(227, 38, 54, 0.17), transparent 45%),
    linear-gradient(120deg, #171717, #0d0d0d 70%);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-block: 85px;
}

.hero-label,
.section-kicker {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  direction: ltr;
}

.hero h1 {
  font-size: clamp(46px, 8vw, 86px);
  line-height: 1.3;
  font-weight: 900;
  margin: 15px 0;
  max-width: 650px;
}

.hero h1 span {
  color: var(--red);
}

.hero p {
  color: #aaa;
  font-size: 15px;
  margin-bottom: 30px;
}

.hero-decoration {
  position: absolute;
  left: -50px;
  bottom: -90px;
  color: rgba(255,255,255,0.025);
  font-size: clamp(100px, 22vw, 300px);
  font-weight: 900;
  direction: ltr;
  pointer-events: none;
}

/* BUTTONS */

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 7px;
  padding: 12px 24px;
  background: var(--red);
  color: white;
  font-weight: 700;
  font-size: 14px;
  transition: 0.2s;
}

.primary-button:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
}

.secondary-button {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 18px;
  background: var(--surface-2);
  color: white;
}

.secondary-button:hover {
  border-color: var(--red);
}

.full-button {
  width: 100%;
}

.text-button {
  border: none;
  background: transparent;
  color: var(--muted);
  margin-top: 15px;
  font-size: 13px;
}

.text-button:hover {
  color: var(--red);
}

/* SECTIONS */

.categories-section,
.products-section {
  padding-top: 80px;
  padding-bottom: 25px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.section-heading h2 {
  font-size: 26px;
  font-weight: 800;
  margin-top: 5px;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #bbb;
  padding: 9px 20px;
  border-radius: 5px;
  font-size: 13px;
  transition: 0.2s;
}

.category-button:hover,
.category-button.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

/* PRODUCTS */

.products-section {
  padding-bottom: 90px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: 0.25s;
  min-width: 0;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: #555;
}

.product-image {
  aspect-ratio: 4 / 5;
  background: #252525;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.4s;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-info {
  padding: 15px;
}

.product-info h3 {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.product-category {
  color: var(--muted);
  font-size: 11px;
  margin: 3px 0 8px;
}

.product-price {
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  margin: 10px 0;
}

.product-stock {
  font-size: 11px;
  color: var(--muted);
}

.product-card .add-to-cart {
  width: 100%;
  border: 1px solid var(--red);
  background: transparent;
  color: white;
  border-radius: 6px;
  padding: 9px;
  margin-top: 12px;
  font-size: 12px;
  transition: 0.2s;
}

.product-card .add-to-cart:hover {
  background: var(--red);
}

.product-card .add-to-cart:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.loading-message,
.empty-message {
  color: var(--muted);
  text-align: center;
  padding: 35px;
  grid-column: 1 / -1;
}

/* ABOUT */

.about-section {
  padding: 85px 0;
  background: #171717;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-content {
  text-align: center;
  max-width: 750px;
}

.about-content h2 {
  font-size: 34px;
  margin: 10px 0;
}

.about-content p {
  color: var(--muted);
  font-size: 14px;
}

/* FOOTER */

.footer {
  padding: 40px 0;
  background: #090909;
  text-align: center;
}

.footer-inner p {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0;
}

.footer-inner small {
  color: #666;
  font-size: 11px;
}

/* CART */

.overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.75);
  opacity: 0;
  visibility: hidden;
  transition: 0.25s;
}

.overlay.active,
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: -450px;
  z-index: 201;
  width: min(420px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 25px;
  display: flex;
  flex-direction: column;
  transition: 0.3s;
}

.cart-panel.active {
  right: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.panel-heading h2 {
  font-size: 19px;
}

.icon-button {
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--surface-2);
  color: white;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item h4 {
  font-size: 13px;
}

.cart-item p {
  font-size: 12px;
  color: var(--muted);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cart-item-actions button {
  width: 27px;
  height: 27px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: white;
}

.cart-footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 17px;
  font-size: 14px;
}

.total-row strong {
  color: var(--red);
}

/* MODALS */

.modal-overlay {
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal {
  width: min(550px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 25px;
  transform: translateY(15px);
  transition: 0.25s;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.checkout-modal {
  width: min(650px, 100%);
}

/* FORMS */

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 15px;
  min-width: 0;
}

.form-group label {
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 11px 13px;
  background: #111;
  color: white;
  outline: none;
  font-size: 13px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--red);
}

.form-group input[type="file"] {
  padding: 9px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #666;
}

.form-group small {
  color: var(--muted);
  font-size: 11px;
}

.full-width {
  grid-column: 1 / -1;
}

.checkout-summary {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  margin: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.checkout-summary strong {
  color: var(--red);
}

.form-message {
  font-size: 12px;
  color: var(--red);
  margin-top: 10px;
}

.payment-details {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 17px;
  margin-bottom: 20px;
  font-size: 13px;
}

.payment-details p {
  margin-bottom: 8px;
  color: #ccc;
}

.payment-details strong {
  color: var(--white);
  overflow-wrap: anywhere;
}

.payment-warning {
  color: var(--muted);
  font-size: 11px;
  margin-top: 15px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ADMIN */

.admin-page {
  display: none;
  min-height: 75vh;
  padding: 65px 0;
}

.admin-page.active {
  display: block;
}

.admin-login-card {
  width: min(420px, calc(100% - 30px));
  margin: 35px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px;
  text-align: center;
}

.admin-login-card h2 {
  margin-top: 15px;
  font-size: 22px;
}

.admin-login-card > p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 25px;
}

.admin-login-card form {
  text-align: right;
}

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

.admin-header h1 {
  font-size: 27px;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 25px;
}

.admin-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 13px 18px;
  color: var(--muted);
  font-size: 13px;
}

.admin-tab.active {
  color: white;
  border-color: var(--red);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
  overflow: hidden;
}

.admin-card h2 {
  font-size: 18px;
  margin-bottom: 20px;
}

.admin-product-item,
.admin-order-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.admin-product-item:last-child,
.admin-order-item:last-child {
  border-bottom: 0;
}

.admin-item-info {
  min-width: 0;
}

.admin-item-info h3 {
  font-size: 14px;
}

.admin-item-info p {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.admin-item-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.admin-item-actions button {
  padding: 7px 12px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: white;
  font-size: 11px;
}

.admin-item-actions .delete-button {
  border-color: #6d2028;
  color: #ff707b;
}

.admin-order-item {
  align-items: flex-start;
  flex-direction: column;
}

.admin-order-item select {
  background: #111;
  color: white;
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 5px;
}

.status-label {
  color: var(--red);
  font-size: 12px;
}

/* TOAST */

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 500;
  background: #242424;
  color: white;
  border: 1px solid var(--border);
  border-right: 3px solid var(--red);
  padding: 12px 20px;
  border-radius: 7px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: 0.25s;
  max-width: calc(100% - 30px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* RESPONSIVE */

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

  .main-nav {
    gap: 16px;
  }
}

@media (max-width: 650px) {
  .header {
    height: 68px;
  }

  .header-inner {
    gap: 8px;
  }

  .logo {
    font-size: 19px;
  }

  .main-nav {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .cart-button,
  .menu-button {
    padding: 8px 10px;
    font-size: 11px;
  }

  .hero {
    min-height: 450px;
  }

  .hero-content {
    padding-block: 70px;
  }

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

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

  .categories-section,
  .products-section {
    padding-top: 55px;
  }

  .section-heading h2 {
    font-size: 22px;
  }

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

  .product-info {
    padding: 11px;
  }

  .product-info h3 {
    font-size: 13px;
  }

  .product-price {
    font-size: 13px;
  }

  .category-list {
    gap: 7px;
  }

  .category-button {
    padding: 8px 12px;
    font-size: 11px;
  }

  .about-section {
    padding: 60px 0;
  }

  .about-content h2 {
    font-size: 27px;
  }

  .admin-page {
    padding: 35px 0;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header h1 {
    font-size: 22px;
  }

  .admin-card {
    padding: 17px;
  }

  .modal {
    padding: 18px;
  }
}

@media (max-width: 390px) {
  .container {
    width: calc(100% - 24px);
  }

  .products-grid {
    gap: 9px;
  }

  .product-info {
    padding: 9px;
  }

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

  .full-width {
    grid-column: auto;
  }

  .admin-product-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
