/**
 * Front-end styles for enucuz.site template marketplace.
 *
 * Light, Wix-inspired layout with strong typography and card-based grid.
 */

:root {
  --tm-bg: #f3f4f6;
  --tm-bg-elevated: #ffffff;
  --tm-border: #e5e7eb;
  --tm-text: #111827;
  --tm-text-muted: #6b7280;
  --tm-primary: #4f46e5;
  --tm-primary-soft: #eef2ff;
  --tm-primary-strong: #4338ca;
  --tm-accent: #0ea5e9;
  --tm-danger: #b91c1c;
  --tm-radius-lg: 1rem;
  --tm-radius-md: 0.9rem;
  --tm-radius-sm: 0.6rem;
  --tm-shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.12);
  --tm-shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
  --tm-max-width: 1120px;
  --tm-transition-fast: 0.18s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.tm-site {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--tm-bg);
  color: var(--tm-text);
}

/* Layout helpers */

.tm-container {
  max-width: var(--tm-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.tm-main {
  padding-bottom: 3rem;
}

.tm-main-narrow .tm-container {
  max-width: 720px;
}

/* Header */

.tm-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.tm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.8rem 1.5rem;
}

.tm-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--tm-text);
}

.tm-logo-image {
  height: 30px;
}

.tm-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.tm-logo-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.tm-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.86rem;
}

.tm-nav-link {
  position: relative;
  text-decoration: none;
  color: #4b5563;
  padding: 0.25rem 0;
}

.tm-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tm-primary), var(--tm-accent));
  transition: width var(--tm-transition-fast);
}

.tm-nav-link:hover {
  color: var(--tm-text);
}

.tm-nav-link:hover::after {
  width: 100%;
}

.tm-header-cta {
  display: flex;
  align-items: center;
}

/* Buttons */

.tm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--tm-transition-fast),
    color var(--tm-transition-fast),
    box-shadow var(--tm-transition-fast),
    border-color var(--tm-transition-fast),
    transform var(--tm-transition-fast);
}

.tm-button-primary {
  background: linear-gradient(135deg, var(--tm-primary), var(--tm-accent));
  color: #f9fafb;
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.35);
}

.tm-button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.45);
}

.tm-button-outline {
  background-color: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.7);
  color: var(--tm-text);
}

.tm-button-outline:hover {
  border-color: var(--tm-primary);
  box-shadow: 0 10px 22px rgba(148, 163, 184, 0.5);
}

/* Hero */

.tm-hero {
  padding: 2.2rem 0 2.4rem;
}

.tm-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: center;
}

.tm-hero-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tm-primary);
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.tm-hero-title {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
  line-height: 1.2;
}

.tm-hero-subtitle {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  color: var(--tm-text-muted);
}

.tm-hero-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  font-size: 0.8rem;
  color: var(--tm-text-muted);
}

.tm-hero-benefits li {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
}

.tm-search-form {
  max-width: 420px;
}

.tm-search-input-wrapper {
  position: relative;
}

.tm-search-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--tm-border);
  padding: 0.55rem 0.85rem;
  padding-left: 0.9rem;
  font-size: 0.86rem;
  outline: none;
  background-color: #f9fafb;
  transition:
    border-color var(--tm-transition-fast),
    box-shadow var(--tm-transition-fast),
    background-color var(--tm-transition-fast);
}

.tm-search-input:focus {
  border-color: var(--tm-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.3);
}

/* Hero highlight card */

.tm-hero-highlight {
  position: relative;
}

.tm-hero-highlight-card {
  border-radius: var(--tm-radius-lg);
  background: radial-gradient(circle at top left, #eef2ff, #e0f2fe);
  box-shadow: var(--tm-shadow-soft);
  padding: 1.2rem 1.4rem 1.4rem;
}

.tm-hero-highlight-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.tm-hero-highlight-title {
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

.tm-hero-highlight-text {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  color: #1f2937;
}

.tm-hero-highlight-button {
  width: 100%;
  justify-content: center;
}

/* Listing */

.tm-listing {
  padding: 0.4rem 0 2.2rem;
}

.tm-listing-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.tm-listing-title {
  margin: 0;
  font-size: 1.1rem;
}

.tm-listing-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--tm-text-muted);
}

/* Category tabs */

.tm-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.tm-category-tab {
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  color: #4b5563;
  text-decoration: none;
  background-color: #f9fafb;
  transition:
    background-color var(--tm-transition-fast),
    border-color var(--tm-transition-fast),
    color var(--tm-transition-fast),
    box-shadow var(--tm-transition-fast);
}

.tm-category-tab:hover {
  background-color: #e5e7eb;
  color: var(--tm-text);
}

.tm-category-tab.is-active {
  background: linear-gradient(135deg, var(--tm-primary), var(--tm-accent));
  color: #f9fafb;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.35);
}

/* Template grid */

.tm-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.tm-template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--tm-radius-md);
  overflow: hidden;
  background-color: var(--tm-bg-elevated);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--tm-shadow-card);
  transition:
    transform var(--tm-transition-fast),
    box-shadow var(--tm-transition-fast);
}

.tm-template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.18);
}

.tm-template-thumb-wrapper {
  position: relative;
  overflow: hidden;
}

.tm-template-thumb {
  width: 100%;
  display: block;
  height: 180px;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.25s ease-out;
}

.tm-template-card:hover .tm-template-thumb {
  transform: scale(1.06);
}

.tm-template-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(17, 24, 39, 0.75),
    rgba(17, 24, 39, 0.1)
  );
  opacity: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.75rem;
  transition: opacity var(--tm-transition-fast);
}

.tm-template-thumb-cta {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background-color: rgba(249, 250, 251, 0.96);
  color: #111827;
  font-size: 0.78rem;
  font-weight: 500;
}

.tm-template-card:hover .tm-template-thumb-overlay {
  opacity: 1;
}

.tm-badge-featured {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background-color: rgba(34, 197, 94, 0.92);
  color: #ecfdf3;
}

.tm-template-body {
  padding: 0.7rem 0.9rem 0.8rem;
}

.tm-template-category {
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  color: var(--tm-text-muted);
}

.tm-template-title {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
}

.tm-template-description {
  margin: 0 0 0.5rem;
  font-size: 0.81rem;
  color: var(--tm-text-muted);
}

.tm-template-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.tm-template-price {
  display: flex;
  flex-direction: column;
}

.tm-template-price-label {
  font-size: 0.74rem;
  color: var(--tm-text-muted);
}

.tm-template-price-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tm-primary-strong);
}

.tm-template-price-muted {
  color: var(--tm-text-muted);
}

.tm-template-link-text {
  font-size: 0.8rem;
  color: var(--tm-primary-strong);
}

/* Empty state */

.tm-empty-state {
  margin: 1.5rem 0 2.5rem;
  font-size: 0.9rem;
  color: var(--tm-text-muted);
}

/* Why us */

.tm-why-us {
  padding: 1.8rem 0 2.5rem;
}

.tm-why-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
  gap: 1.7rem;
  align-items: center;
}

.tm-why-title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}

.tm-why-subtitle {
  margin: 0 0 0.8rem;
  font-size: 0.87rem;
  color: var(--tm-text-muted);
}

.tm-why-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.86rem;
  color: var(--tm-text-muted);
}

.tm-why-list li + li {
  margin-top: 0.15rem;
}

.tm-why-card {
  border-radius: var(--tm-radius-lg);
  background: radial-gradient(circle at top left, #e0f2fe, #f5f3ff);
  padding: 1.1rem 1.4rem 1.3rem;
  box-shadow: var(--tm-shadow-soft);
}

.tm-why-card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.tm-why-card-text {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  color: #1f2937;
}

.tm-why-button {
  width: 100%;
}

/* Detail hero */

.tm-detail-hero {
  position: relative;
  margin-bottom: 1.6rem;
}

.tm-detail-hero-media {
  position: relative;
  height: 260px;
  overflow: hidden;
}

.tm-detail-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tm-detail-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.82),
    rgba(15, 23, 42, 0.15)
  );
}

.tm-detail-hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 1.4rem;
  color: #e5e7eb;
}

.tm-detail-kicker {
  font-size: 0.8rem;
  margin: 0 0 0.15rem;
  color: #e5e7eb;
}

.tm-detail-title {
  margin: 0 0 0.2rem;
  font-size: 1.6rem;
}

.tm-detail-subtitle {
  margin: 0 0 0.7rem;
  font-size: 0.88rem;
  max-width: 640px;
}

.tm-detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Detail layout */

.tm-detail-main {
  padding: 0 0 2.7rem;
}

.tm-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
  gap: 1.7rem;
}

.tm-detail-content h2,
.tm-detail-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.tm-detail-content p {
  font-size: 0.9rem;
  color: var(--tm-text-muted);
}

.tm-detail-description {
  font-size: 0.9rem;
  color: var(--tm-text-muted);
  margin-bottom: 0.9rem;
}

.tm-detail-steps,
.tm-detail-bullets {
  font-size: 0.88rem;
  color: var(--tm-text-muted);
  padding-left: 1.1rem;
  margin-top: 0;
}

.tm-detail-steps li + li,
.tm-detail-bullets li + li {
  margin-top: 0.1rem;
}

/* Detail sidebar */

.tm-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tm-detail-summary-card,
.tm-detail-order-card {
  background-color: var(--tm-bg-elevated);
  border-radius: var(--tm-radius-lg);
  padding: 0.95rem 1.05rem 1.1rem;
  box-shadow: var(--tm-shadow-card);
}

.tm-detail-price-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tm-text-muted);
  margin: 0 0 0.15rem;
}

.tm-detail-price-value {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tm-primary-strong);
}

.tm-detail-meta {
  margin: 0 0 0.8rem;
  font-size: 0.83rem;
  color: var(--tm-text-muted);
}

.tm-detail-cta-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tm-detail-cta {
  width: 100%;
  justify-content: center;
}

.tm-detail-order-card h3 {
  margin-top: 0;
  margin-bottom: 0.3rem;
}

.tm-detail-order-text {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
  color: var(--tm-text-muted);
}

/* Forms */

.tm-order-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tm-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.tm-form-group label {
  font-size: 0.8rem;
  color: #374151;
}

.tm-form-group input,
.tm-form-group textarea {
  border-radius: 0.65rem;
  border: 1px solid var(--tm-border);
  padding: 0.4rem 0.55rem;
  font-size: 0.84rem;
  outline: none;
  background-color: #f9fafb;
  transition:
    border-color var(--tm-transition-fast),
    box-shadow var(--tm-transition-fast),
    background-color var(--tm-transition-fast);
}

.tm-form-group input:focus,
.tm-form-group textarea:focus {
  border-color: var(--tm-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.3);
}

.tm-order-submit {
  width: 100%;
  margin-top: 0.2rem;
}

/* Alerts */

.tm-alert {
  border-radius: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
}

.tm-alert-success {
  background-color: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.tm-alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--tm-danger);
}

.tm-alert-error ul {
  margin: 0;
  padding-left: 1.05rem;
}

/* Footer */

.tm-footer {
  border-top: 1px solid var(--tm-border);
  background-color: #ffffff;
}

.tm-footer-inner {
  max-width: var(--tm-max-width);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--tm-text-muted);
}

.tm-footer-title {
  margin: 0 0 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tm-text);
}

.tm-footer-copy a {
  color: inherit;
  text-decoration: none;
}

.tm-footer-copy a:hover {
  text-decoration: underline;
}

.tm-footer-contact p {
  margin: 0;
}

.tm-footer-contact a {
  color: inherit;
  text-decoration: none;
}

.tm-footer-contact a:hover {
  text-decoration: underline;
}

.tm-footer-actions {
  display: flex;
  align-items: center;
}

/* Responsive */

@media (max-width: 960px) {
  .tm-hero-layout,
  .tm-why-layout,
  .tm-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tm-detail-hero-media {
    height: 220px;
  }

  .tm-header-inner {
    padding-inline: 1rem;
  }

  .tm-container {
    padding-inline: 1rem;
  }

  .tm-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .tm-template-thumb {
    height: 170px;
  }

  .tm-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}