*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f5f7fb;
  color: #0f172a;
}

body.cart-open {
  overflow: hidden;
}

a {
  color: inherit;
}

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

/* HEADER */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.ghost-link,
.secondary-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.cart-button,
.primary-btn,
.secondary-btn,
.checkout-btn,
.close-btn,
.buy-btn,
.remove-btn,
.danger-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}

.cart-button,
.primary-btn,
.buy-btn {
  background: #0f172a;
  color: #fff;
}

.secondary-btn,
.close-btn {
  background: #e5e7eb;
  color: #111827;
}

.danger-btn,
.remove-btn {
  background: #dc2626;
  color: #fff;
}

.cart-button {
  min-height: 40px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
}

/* LAYOUT */

.container {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-copy {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: #475569;
  max-width: 820px;
}

/* FINDER */

.finder-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.finder-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px);
  gap: 16px;
}

.finder-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.finder-box select,
.card input,
.card select,
.card textarea,
.downloads-box input,
.login-card input,
.login-card select,
.login-card textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: #0f172a;
}

.card textarea {
  min-height: 120px;
  resize: vertical;
}

.folder-breadcrumb {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
  width: fit-content;
  max-width: 100%;
}

.folder-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

/* GALLERY */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.photo-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.photo-card img,
.preview-fallback {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #e5e7eb;
}

.photo-card img {
  object-fit: cover;
}

.photo-info {
  padding: 14px;
}

.photo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.photo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.photo-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}

.photo-folder {
  min-height: 34px;
  font-size: 13px;
  line-height: 1.35;
  color: #64748b;
  margin-bottom: 10px;
}

.photo-price {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.buy-btn {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
}

.preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

.preview-fallback-icon {
  font-size: 34px;
  margin-bottom: 8px;
}

.preview-fallback-text {
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
}

.preview-fallback-title {
  font-size: 12px;
  color: #64748b;
}

.empty-state {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 40px 18px;
  text-align: center;
  color: #64748b;
}

/* CART */

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  max-width: 100%;
  height: 100dvh;
  background: #fff;
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.15);
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 2000;
  transform: translateX(100%);
  transition: transform .28s ease;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-header,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-header {
  margin-bottom: 16px;
}

.close-btn {
  min-width: 40px;
  min-height: 40px;
  font-size: 18px;
}

.cart-item {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cart-item-price {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
  word-break: break-word;
}

.remove-btn {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.cart-total {
  margin: 18px 0 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.checkout-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: #111827;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.status {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.downloads-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.downloads-box-inline {
  border-top: 0;
  padding-top: 0;
  margin-top: 24px;
}

.downloads a {
  display: block;
  margin: 10px 0;
  color: #2563eb;
  text-decoration: none;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* SUCCESS */

.success-shell {
  min-height: calc(100dvh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.success-card {
  width: min(760px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 32px;
  text-align: center;
}

.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f97316;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.order-box {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #f8fbff;
}

.order-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 8px;
}

.order-id {
  font-size: 18px;
  font-weight: 900;
  word-break: break-word;
}

.success-actions {
  margin-top: 22px;
}

/* ADMIN */

.admin-page-shell {
  padding-top: 20px;
}

.login-wrap {
  min-height: calc(100dvh - 84px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.admin-topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
}

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

.admin-title {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.05;
}

.admin-welcome {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-weight: 800;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  padding: 20px;
}

.card h3 {
  margin: 0 0 14px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
}

.admin-item h4 {
  margin: 0 0 8px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.admin-photo-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
}

.admin-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.admin-photo-info {
  padding: 12px;
}

.inline-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-tools select,
.inline-tools button {
  width: auto;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.selection-summary,
.small {
  font-size: 12px;
  color: #64748b;
}

.selection-summary {
  margin-bottom: 12px;
}

/* MOBILE */

@media (max-width: 900px) {
  .admin-topbar,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-topbar-actions,
  .inline-tools {
    width: 100%;
  }

  .inline-tools select,
  .inline-tools button {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .header {
    padding: 12px 14px;
  }

  .logo {
    font-size: 20px;
  }

  .container {
    width: min(100%, calc(100% - 20px));
    padding: 14px 0 24px;
  }

  .hero {
    padding: 18px;
    border-radius: 16px;
  }

  .hero h1,
  .admin-title {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .finder-box {
    padding: 14px;
  }

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

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

  .photo-info {
    padding: 12px;
  }

  .photo-title {
    font-size: 16px;
  }

  .photo-price {
    font-size: 20px;
  }

  .buy-btn {
    min-height: 42px;
    font-size: 13px;
  }

  .cart-panel {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    box-shadow: none;
  }

  .success-card,
  .login-card,
  .card {
    padding: 18px;
  }
}

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

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .ghost-link,
  .cart-button {
    flex: 1;
  }
}