@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Ubuntu:wght@300;400;500&display=swap");

:root {
  --brand-red: #e93525;
  --dark: #242424;
  --mid: #4e4e4e;
  --accent: #9fa3a7;
  --bg: #f5f7fb;
  --card: #ffffff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Ubuntu", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(36, 36, 36, 0.06), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(159, 163, 167, 0.08), transparent 30%),
    var(--bg);
  color: var(--mid);
}

body.catalog-page {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 12%, rgba(233, 53, 37, 0.22), transparent 45%),
    radial-gradient(circle at 92% 8%, rgba(36, 36, 36, 0.2), transparent 40%),
    linear-gradient(120deg, rgba(245, 247, 251, 0.88), rgba(245, 247, 251, 0.35)),
    url("/images/woman_phone.png");
  background-size: 520px 520px, 720px 720px, cover, cover;
  background-position: -140px -80px, 110% -40px, center, center;
  background-repeat: no-repeat;
  background-attachment: scroll, scroll, scroll, fixed;
}

body.home-page {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 14%, rgba(233, 53, 37, 0.2), transparent 45%),
    radial-gradient(circle at 88% 6%, rgba(36, 36, 36, 0.18), transparent 40%),
    linear-gradient(120deg, rgba(245, 247, 251, 0.9), rgba(245, 247, 251, 0.5)),
    url("/images/helpdesk.png");
  background-size: 520px 520px, 720px 720px, cover, cover;
  background-position: -150px -90px, 110% -50px, center, center;
  background-repeat: no-repeat;
  background-attachment: scroll, scroll, scroll, fixed;
}

body.orders-page {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 14% 16%, rgba(233, 53, 37, 0.18), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(36, 36, 36, 0.2), transparent 40%),
    linear-gradient(120deg, rgba(245, 247, 251, 0.9), rgba(245, 247, 251, 0.5)),
    url("/images/shipping.png");
  background-size: 520px 520px, 720px 720px, cover, cover;
  background-position: -150px -90px, 110% -50px, center, center;
  background-repeat: no-repeat;
  background-attachment: scroll, scroll, scroll, fixed;
}

body.home-page .card {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 18px 36px rgba(20, 20, 30, 0.14);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.home-page .module-card.ghost-card {
  background: rgba(253, 243, 234, 0.58);
  border: 1px solid rgba(242, 194, 135, 0.45);
}

body.orders-page .card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 30px rgba(20, 20, 30, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.orders-page .table {
  background: rgba(255, 255, 255, 0.76);
}

body.orders-page .table thead {
  background: rgba(240, 242, 245, 0.74);
}

body.orders-page .table tbody tr + tr td {
  border-top: 1px solid rgba(237, 240, 242, 0.75);
}

h1,
h2,
h3,
h4 {
  font-family: "Montserrat", "Ubuntu", sans-serif;
  color: var(--dark);
  letter-spacing: -0.01em;
}

a {
  color: var(--brand-red);
  text-decoration: none;
}

a:hover {
  color: #c02c1f;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--card);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
}

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

.nav a {
  font-weight: 500;
  color: var(--mid);
}

.nav a.active {
  color: var(--brand-red);
}

.container {
  width: min(1440px, 100%);
  padding: 32px 28px;
  margin: 0 auto;
  flex: 1 0 auto;
}

.hero {
  background: linear-gradient(125deg, rgba(36, 36, 36, 0.04), rgba(159, 163, 167, 0.06));
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.08);
}

body.catalog-page .hero {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero h1 {
  margin: 0 0 10px;
}

.hero p {
  margin: 0;
  color: var(--mid);
  font-size: 1.05rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-family: "Montserrat", sans-serif;
}

.cards {
  display: grid;
  gap: 18px;
}

.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: start;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card small {
  color: var(--accent);
}

.stat {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark);
}

.muted {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.01em;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-red), #ff4b3a);
  color: #fff;
  box-shadow: 0 12px 30px rgba(233, 53, 37, 0.35);
}

.btn-secondary {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 10px 24px rgba(36, 36, 36, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--dark);
  border: 1px solid rgba(36, 36, 36, 0.1);
}

.btn:hover {
  transform: translateY(-1px);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  align-items: start;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.card.table-card .table {
  box-shadow: none;
  border-radius: 10px;
  margin: 0;
}

.card.table-card {
  padding: 0;
  gap: 0;
}

.card.table-card .table-card-header {
  padding: 12px 16px 8px;
}

.card.table-card .table-card-header h3 {
  margin: 0;
}

.card.table-card .table {
  border-radius: 0;
}

.save-button-hidden {
  display: none;
}

.table th,
.table td {
  padding: 14px;
  text-align: left;
}

.table thead {
  background: #f0f2f5;
  color: var(--dark);
  font-family: "Montserrat", sans-serif;
}

.table tbody tr + tr td {
  border-top: 1px solid #edf0f2;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

label {
  display: block;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e0e4e8;
  background: #fcfcfd;
  font-size: 1rem;
  font-family: "Ubuntu", sans-serif;
}

textarea {
  min-height: 120px;
}

.subscription-fields {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(233, 53, 37, 0.08);
  color: var(--brand-red);
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
}

.summary {
  background: var(--dark);
  color: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(36, 36, 36, 0.3);
}

.summary h3 {
  color: #fff;
}

.summary .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.summary .btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.totals {
  display: grid;
  gap: 8px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.alert.info {
  background: rgba(36, 36, 36, 0.08);
  color: var(--dark);
}

.alert.success {
  background: rgba(53, 167, 110, 0.1);
  color: #16845b;
}

.alert.danger {
  background: rgba(233, 53, 37, 0.12);
  color: var(--brand-red);
}

.alert.warning {
  background: rgba(255, 196, 0, 0.15);
  color: #8a6400;
}

.order-card {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 14px;
  background: #fafafa;
  border: 1px solid #ececec;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

body.catalog-page .product-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 22px 50px rgba(20, 20, 30, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: catalog-card-in 0.6s ease both;
  animation-delay: calc(var(--card-delay, 0) * 0.05s);
}

.product-image-wrap {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #f6f7fb);
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

body.catalog-page .product-image-wrap {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

body.catalog-page .product-card .muted {
  color: rgba(36, 36, 36, 0.72);
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 0 auto;
}

.product-card .price {
  font-weight: 800;
  color: var(--dark);
  font-size: 1.1rem;
}

.product-footer {
  border-top: 1px solid #eef0f4;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.catalog-page .product-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.6);
}

@keyframes catalog-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.product-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.product-actions input[type="number"] {
  max-width: 120px;
}

.subscription-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(233, 53, 37, 0.08);
  color: var(--dark);
  max-width: 100%;
  line-height: 1.35;
  word-break: break-word;
}

.subscription-chip strong {
  color: var(--dark);
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment {
  border: 1px solid #eceff4;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafbff;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.comment-body {
  margin-top: 6px;
  line-height: 1.5;
}

.reply-form {
  display: none;
}

.reply-form.is-open {
  display: block;
  margin-top: 8px;
}

.footer {
  padding: 18px 32px;
  background: #f1f3f5;
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  body.catalog-page .product-card {
    animation: none;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .order-card,
  .product-card {
    grid-template-columns: 1fr;
  }

  .product-actions input[type="number"] {
    max-width: 100%;
  }

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

  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
}
