@import url("https://fonts.googleapis.com/css2?family=Freeman&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --ink: #1a1f2e;
  --paper: #ffffff;
  --accent: #d32f2f;
  --accent-dark: #b71c1c;
  --muted: #5c6578;
  --line: rgba(26, 31, 46, 0.12);
  --card-bg: #ffffff;
  --shadow: 0 18px 40px rgba(26, 31, 46, 0.08);
  --radius-card: 16px;
  --radius-modal: 20px;
  --radius-control: 12px;
  --radius-drawer: 24px;
  --font-display: "Freeman", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: #ffffff;
  min-height: 100vh;
}

.site-header {
  --header-row: 68px;
  background: var(--accent);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .navbar {
  padding-top: 0;
  padding-bottom: 0;
}

.site-header-bar {
  position: relative;
  min-height: var(--header-row);
}

.brand-logo {
  position: absolute;
  left: 50%;
  top: calc(var(--header-row) / 2);
  transform: translate(-50%, -50%);
  z-index: 2;
  line-height: 0;
}

.brand-logo img {
  display: block;
  height: 52px;
  width: auto;
  max-width: min(280px, 50vw);
  object-fit: contain;
}

.navbar-toggler {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: var(--header-row);
  border: 0;
  background: transparent;
  padding: 0.35rem 0.55rem;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 992px) {
  .site-header .navbar-collapse {
    min-height: var(--header-row);
    align-items: center;
  }
}

@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    flex-basis: 100%;
    width: 100%;
  }
}

.navbar-toggler:focus {
  outline: 0;
  box-shadow: none;
}

.navbar-toggler:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.35);
}

.navbar-toggler-icon {
  width: 1.25rem;
  height: 1.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-header .navbar-collapse {
  position: relative;
  z-index: 3;
}

.site-header .nav-link {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 600;
  text-decoration: none;
}

.site-header .nav-link:hover {
  color: #ffffff !important;
  opacity: 0.85;
}

.nav-link {
  color: var(--muted) !important;
  font-weight: 600;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--accent) !important;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  margin: 0 0 0.5rem;
  animation: rise 0.7s ease both;
}

.hero-lead {
  color: var(--muted);
  max-width: 36rem;
  margin-bottom: 2rem;
  animation: rise 0.7s ease 0.1s both;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-tile {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.25s ease;
}

.product-tile:hover {
  box-shadow: 0 22px 48px rgba(26, 31, 46, 0.12);
}

.product-carousel {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f0eaea;
  overflow: hidden;
}

.product-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transition: transform 0.5s ease;
}

.product-carousel img.is-active {
  display: block;
  animation: fadeIn 0.35s ease;
}

.product-tile:hover .product-carousel img.is-active {
  transform: scale(1.06);
}

.carousel-nav {
  position: absolute;
  inset: auto 0 0.75rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.75rem;
  pointer-events: none;
}

.carousel-nav button {
  pointer-events: auto;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  width: 2rem;
  height: 2rem;
  font-weight: 700;
}

.carousel-counter {
  background: rgba(26, 31, 46, 0.7);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
}

.product-body {
  padding: 1rem 1.1rem 1.25rem;
}

.product-body h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.price {
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.btn-accent,
.btn-outline-ink,
.btn-outline-danger,
.qty-control button,
.size-options button,
.carousel-nav button {
  border-radius: var(--radius-control);
}

.btn-accent {
  background: var(--accent);
  border: 0;
  color: #fff;
  font-weight: 700;
  padding: 0.65rem 1.1rem;
}

.btn-accent:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn-outline-ink {
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  border-radius: var(--radius-control);
}

.modal-content {
  border: 0;
  border-radius: 0;
  background: var(--card-bg);
}

.modal-header,
.modal-footer {
  border-color: var(--line);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.qty-control button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.cart-table th,
.cart-table td {
  vertical-align: middle;
}

.cart-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: #f0eaea;
  border-radius: var(--radius-control);
}

.admin-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: #f0eaea;
}

.admin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.admin-image-card {
  border: 1px solid var(--line);
  background: var(--card-bg);
  padding: 0.5rem;
}

.admin-image-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  margin-bottom: 0.5rem;
}

.admin-image-card .form-control {
  font-size: 0.8rem;
}

.nav-tabs .nav-link {
  color: var(--muted) !important;
  font-weight: 600;
}

.nav-tabs .nav-link.active {
  color: var(--accent-dark) !important;
  border-color: var(--line) var(--line) #fff;
}

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.qty-value {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.btn-accent:disabled,
.qty-control button:disabled,
.btn-outline-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.size-options button {
  min-width: 2.75rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.size-options button.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.06);
}

.product-description {
  white-space: pre-line;
}

.store-modal-root,
.cart-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.store-modal-root {
  height: 100vh;
  height: 100dvh;
}

.store-modal-backdrop,
.cart-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(26, 31, 46, 0.45);
}

.store-modal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: 1rem auto;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: var(--radius-modal);
}

.store-modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.store-modal-header,
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.store-modal-header h2,
.cart-drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0;
}

.store-modal-header,
.store-modal-footer {
  flex-shrink: 0;
}

.store-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1.25rem;
}

.store-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.store-modal-footer,
.cart-drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}

.cart-drawer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: var(--radius-drawer) 0 0 var(--radius-drawer);
  overflow: hidden;
}

.cart-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 0.5rem 1.25rem 1rem;
}

.cart-drawer-footer {
  flex-direction: column;
  align-items: stretch;
}

.cart-drawer-footer .btn {
  width: 100%;
}

.cart-lines {
  display: flex;
  flex-direction: column;
}

.cart-line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.cart-line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.cart-line-subtotal {
  font-weight: 700;
}

.cart-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (max-width: 576px) {
  .cart-table thead {
    display: none;
  }

  .btn-accent,
  .btn-outline-ink,
  .modal-footer .btn {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .qty-control {
    width: 100%;
    justify-content: space-between;
  }

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

  .admin-actions .btn {
    width: 100%;
  }

  .store-modal-grid,
  .cart-line {
    grid-template-columns: 1fr;
  }

  .store-modal-footer {
    flex-direction: column;
  }

  .store-modal .product-carousel {
    max-height: 42vh;
    max-height: 42dvh;
  }

  .cart-line-actions {
    align-items: flex-start;
  }

  .cart-drawer {
    border-radius: 0;
  }
}
