:root {
  --text-light: #ffffff;
  --text-dark: #1e1e1e;
  --overlay: rgba(0, 0, 0, 0.5);
  --footer-bg: #3f3f3f;
  --accent: #c9a227;
  --accent-dark: #a68520;
  --card-bg: #ffffff;
  --muted: #5c5c5c;
}

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

body {
  font-family: "Poppins", Arial, sans-serif;
  color: var(--text-light);
  background: #f4f4f4;
}

.hero {
  min-height: 100vh;
  background-image: url("https://images.unsplash.com/photo-1604719312566-8912e9c8a213?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  position: relative;
  display: grid;
  place-items: center;
  padding: 2rem 1rem 3rem;
}

.overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100%, 1100px);
  text-align: center;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  margin-top: 0.7rem;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 500;
  opacity: 0.95;
}

.category-grid {
  margin-top: 2.3rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 0.9rem;
}

.category {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  color: var(--text-light);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.8rem;
  background-size: cover;
  background-position: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.15));
}

.category span {
  position: relative;
  z-index: 1;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.category:hover,
.category:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.men {
  background-image: url("https://images.unsplash.com/photo-1516257984-b1b4d707412e?auto=format&fit=crop&w=900&q=80");
}

.women {
  background-image: url("https://images.unsplash.com/photo-1483985988355-763728e1935b?auto=format&fit=crop&w=900&q=80");
}

.kids {
  background-image: url("https://images.unsplash.com/photo-1519238359922-989348752efb?auto=format&fit=crop&w=900&q=80");
}

.sale {
  background-image: url("https://images.unsplash.com/photo-1607082349566-187342175e2f?auto=format&fit=crop&w=900&q=80");
}

.subpage {
  min-height: 85vh;
}

.subpage .hero-content p {
  font-weight: 600;
  letter-spacing: 0.04rem;
}

.subcat-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 0.9rem;
}

.subcat-grid .category:last-child {
  grid-column: span 2;
  max-width: 260px;
  justify-self: center;
  width: 100%;
}

.men-hero {
  background-image: url("https://images.unsplash.com/photo-1490578474895-699cd4e2cf59?auto=format&fit=crop&w=1800&q=80");
}

.women-hero {
  background-image: url("https://images.unsplash.com/photo-1445205170230-053b83016050?auto=format&fit=crop&w=1800&q=80");
}

.kids-hero {
  background-image: url("https://images.unsplash.com/photo-1503919545889-aef636e10ad4?auto=format&fit=crop&w=1800&q=80");
}

.men-tops {
  background-image: url("https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?auto=format&fit=crop&w=900&q=80");
}

.men-bottoms {
  background-image: url("https://images.unsplash.com/photo-1542272604-787c3835535d?auto=format&fit=crop&w=900&q=80");
}

.men-accessories {
  background-image: url("https://images.unsplash.com/photo-1523170335258-f5ed11844a49?auto=format&fit=crop&w=900&q=80");
}

.women-tops {
  background-image: url("https://images.unsplash.com/photo-1551163943-3f6a855d1153?auto=format&fit=crop&w=900&q=80");
}

.women-bottoms {
  background-image: url("https://images.unsplash.com/photo-1583496661160-fb5886a13d77?auto=format&fit=crop&w=900&q=80");
}

.women-accessories {
  background-image: url("https://images.unsplash.com/photo-1573408301185-9146fe634ad0?auto=format&fit=crop&w=900&q=80");
}

.kids-tops {
  background-image: url("https://images.unsplash.com/photo-1514090458221-65bb69cf63e6?auto=format&fit=crop&w=900&q=80");
}

.kids-bottoms {
  background-image: url("https://images.unsplash.com/photo-1519340241574-2cec6aef0c01?auto=format&fit=crop&w=900&q=80");
}

.kids-accessories {
  background-image: url("https://images.unsplash.com/photo-1622290291468-a28f7a7dc6a8?auto=format&fit=crop&w=900&q=80");
}

.info-section {
  background: var(--footer-bg);
  color: var(--text-light);
  padding: 2rem 1rem;
  display: grid;
  gap: 1.2rem;
}

.map-block h2 {
  margin-bottom: 0.7rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.map-wrapper {
  border-radius: 12px;
  overflow: hidden;
  min-height: 250px;
}

.map-wrapper iframe {
  width: 100%;
  height: 100%;
  min-height: 250px;
  border: 0;
}

.details-block {
  display: grid;
  gap: 1rem;
}

.detail-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
}

.detail-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
  font-weight: 700;
}

.detail-card p {
  font-size: 1rem;
  line-height: 1.5;
}

/* --- Catalog (product listing) --- */
.page-catalog {
  background: linear-gradient(180deg, #ececec 0%, #f7f7f9 40%);
  color: var(--text-dark);
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 1.25rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.site-title {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  color: var(--text-dark);
  text-decoration: none;
}

.site-title:hover {
  color: var(--accent-dark);
}

.catalog-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 1rem;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

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

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

.breadcrumb .sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.catalog-heading {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
}

.catalog-empty {
  color: var(--muted);
  font-size: 1rem;
  padding: 2rem 0;
}

.item-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  padding-bottom: 2rem;
}

.item-card {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.item-image-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0f0f0;
}

.item-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-legend {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02rem;
  color: var(--text-dark);
  padding: 0.65rem 0.75rem 0.35rem;
  line-height: 1.35;
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.75rem;
}

.item-price {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
}

.btn-buy {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  padding: 0.45rem 0.7rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.4);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-buy:hover {
  filter: brightness(1.05);
}

.btn-buy:active {
  transform: scale(0.98);
}

/* --- Admin login --- */
.page-admin {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #f7f7f7 0%, #d4d4d8 100%);
  color: var(--text-dark);
}

.admin-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.admin-card {
  width: min(100%, 400px);
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.25rem;
}

.admin-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.admin-input:focus {
  outline: none;
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.admin-btn-primary {
  font-family: inherit;
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
  color: #fff;
}

.admin-btn-primary:hover {
  opacity: 0.95;
}

.admin-foot {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.admin-foot a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.admin-foot a:hover {
  text-decoration: underline;
}

.admin-locked-msg {
  color: #b32d2d;
  font-size: 0.95rem;
  text-align: center;
  padding: 0.5rem 0;
}

.flash-list {
  list-style: none;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.flash-error {
  background: #fde8e8;
  color: #b32d2d;
}

.flash-success {
  background: #e6f7ed;
  color: #1e6b3a;
}

/* --- Admin panel --- */
.page-admin-panel {
  min-height: 100vh;
  background: #f0f0f0;
  color: var(--text-dark);
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 5;
}

.admin-panel-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.admin-logout-form {
  margin: 0;
}

.admin-btn-secondary {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

.admin-btn-secondary:hover {
  background: #f5f5f5;
}

.admin-panel-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.flash-panel {
  margin-bottom: 1.25rem;
}

.admin-add-section,
.admin-list-section {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-add-section h2,
.admin-list-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.admin-hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.admin-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 420px;
}

.admin-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-form-row label {
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-form-row input,
.admin-form-row select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.admin-form-row input:focus,
.admin-form-row select:focus {
  outline: none;
  border-color: var(--accent-dark);
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #eee;
}

.admin-table th {
  font-weight: 700;
  background: #fafafa;
}

.admin-td-thumb img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-btn-danger {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: none;
  background: #c62828;
  color: #fff;
  cursor: pointer;
}

.admin-btn-danger:hover {
  background: #a51f1f;
}

.admin-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-back-store {
  text-align: center;
  margin-top: 0.5rem;
}

.admin-back-store a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.admin-back-store a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .hero {
    padding: 3rem 2rem 4rem;
  }

  .category-grid {
    gap: 1rem;
    max-width: 760px;
    margin-inline: auto;
  }

  .subcat-grid {
    max-width: 760px;
    margin-inline: auto;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .subcat-grid .category:last-child {
    grid-column: auto;
    max-width: none;
    width: auto;
  }

  .info-section {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
    padding: 2.2rem 2rem;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
