/*
Theme Name: RealMobile
Description: WordPress theme for the RealMobile catalog.
Version: 0.4.0
Text Domain: realmobile
*/

:root {
  --rm-bg: #f7f7f5;
  --rm-surface: #ffffff;
  --rm-media-bg: #f2f2ef;
  --rm-border: #e5e6e2;
  --rm-border-strong: #d2d5cf;
  --rm-text: #1c1f1d;
  --rm-muted: #5e6561;
  --rm-accent: #07321d;
  --rm-accent-hover: #0d492b;
  --rm-accent-text: #ffffff;
  --rm-stock-in: #157347;
  --rm-stock-pre: #8a6116;
  --rm-stock-out: #7a807c;
  --rm-radius: 14px;
  --rm-radius-sm: 10px;
  --rm-container: 1280px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--rm-bg);
  color: var(--rm-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.rm-container {
  width: 100%;
  max-width: var(--rm-container);
  margin-inline: auto;
  padding-inline: clamp(14px, 3vw, 28px);
}

/* Header */
.rm-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rm-border);
}

.rm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.rm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rm-brand .custom-logo-link,
.rm-brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.rm-brand img {
  display: block;
  width: 44px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}

.realmobile-default-logo {
  border-radius: 50%;
}

.rm-brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

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

.rm-nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rm-text);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rm-nav-link:hover,
.rm-nav-link.is-active {
  background: var(--rm-media-bg);
  color: var(--rm-accent);
}

.rm-header-search {
  margin-left: 6px;
}

.rm-header-search-input {
  width: 190px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--rm-border);
  border-radius: 999px;
  background: var(--rm-bg);
  color: var(--rm-text);
  font-size: 0.875rem;
}

.rm-header-search-input:focus {
  outline: none;
  border-color: var(--rm-accent);
  background: var(--rm-surface);
}

/* Compact Hero */
.rm-hero {
  background: var(--rm-surface);
  border-bottom: 1px solid var(--rm-border);
  padding-block: clamp(20px, 3vw, 32px);
}

.rm-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
}

.rm-hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.rm-hero-text {
  margin: 0 0 18px;
  max-width: 480px;
  font-size: 1rem;
  color: var(--rm-muted);
}

.rm-hero-media {
  background: var(--rm-media-bg);
  border-radius: var(--rm-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 250px;
  overflow: hidden;
}

.rm-hero-img {
  max-height: 218px;
  width: auto;
  object-fit: contain;
}

.rm-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-surface);
  cursor: pointer;
}

.rm-nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--rm-text);
  border-radius: 2px;
}

/* Main & Catalog Head */
.rm-main {
  padding-block: clamp(20px, 3vw, 32px) clamp(40px, 5vw, 64px);
  min-height: calc(100vh - 210px);
}

.rm-catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 22px;
}

.rm-page-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.rm-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rm-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--rm-border);
  border-radius: 999px;
  background: var(--rm-surface);
  color: var(--rm-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.rm-cat-pill:hover {
  border-color: var(--rm-border-strong);
}

.rm-cat-pill.is-active {
  background: var(--rm-accent);
  border-color: var(--rm-accent);
  color: var(--rm-accent-text);
}

/* Product Grid */
.rm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* Catalog Toolbar & Sidebar Filters */
.rm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.rm-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.rm-toolbar-search {
  flex: 1 1 240px;
  max-width: 380px;
}

.rm-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.rm-input,
.rm-select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rm-border-strong);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-surface);
  color: var(--rm-text);
  font-size: 0.875rem;
}

.rm-select {
  width: auto;
  min-width: 175px;
}

.rm-catalog-count {
  font-size: 0.875rem;
  color: var(--rm-muted);
  white-space: nowrap;
}

.rm-filter-toggle {
  display: none;
  padding: 9px 14px;
  font-size: 0.875rem;
  gap: 6px;
}

.rm-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rm-accent);
  color: var(--rm-accent-text);
  font-size: 0.75rem;
}

.rm-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.rm-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--rm-border-strong);
  border-radius: 999px;
  background: var(--rm-surface);
  color: var(--rm-text);
  font-size: 0.8125rem;
  cursor: pointer;
}

.rm-active-clear {
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--rm-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.rm-catalog-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.rm-filters {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rm-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rm-filters-title {
  font-size: 0.9375rem;
  font-weight: 700;
}

.rm-filters-close {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--rm-muted);
  cursor: pointer;
}

.rm-filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--rm-border);
}

.rm-filter-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rm-text);
  margin-bottom: 2px;
}

.rm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--rm-text);
  cursor: pointer;
}

.rm-check input {
  accent-color: var(--rm-accent);
}

.rm-price-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rm-filters-reset {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.875rem;
}

.rm-catalog-content {
  min-width: 0;
}

.rm-card {
  display: flex;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.rm-card:hover {
  border-color: var(--rm-border-strong);
  box-shadow: 0 8px 24px rgba(1, 35, 19, 0.06);
  transform: translateY(-2px);
}

.rm-card-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
}

.rm-card-media {
  aspect-ratio: 1 / 1;
  background: var(--rm-media-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}

.rm-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.rm-card:hover .rm-card-img {
  transform: scale(1.03);
}

.rm-card-placeholder {
  font-size: 0.875rem;
  color: var(--rm-muted);
}

.rm-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 14px 16px 16px;
  gap: 8px;
}

.rm-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
}

.rm-stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.rm-stock-in_stock {
  color: var(--rm-stock-in);
}

.rm-stock-preorder {
  color: var(--rm-stock-pre);
}

.rm-stock-out_of_stock {
  color: var(--rm-stock-out);
}

.rm-stock-sold {
  color: var(--rm-stock-out);
}

.rm-card-title {
  margin: 0;
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--rm-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.rm-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--rm-border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.rm-card-price {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rm-card-prices {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.rm-price-old {
  font-size: 0.875rem;
  color: var(--rm-muted);
  text-decoration: line-through;
  white-space: nowrap;
}

.rm-card-cta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rm-accent);
  white-space: nowrap;
}

/* Demo Catalog Notice & Card Details */
.rm-demo-notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  font-size: 0.875rem;
  color: var(--rm-muted);
}

.rm-card-config {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--rm-muted);
  line-height: 1.4;
}

.rm-card-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rm-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--rm-border);
  border-radius: 999px;
  background: var(--rm-bg);
  font-size: 0.75rem;
  color: var(--rm-text);
}

.rm-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rm-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--rm-muted);
  line-height: 1.35;
}

/* Buttons */
.rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--rm-radius-sm);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rm-btn-primary {
  background: var(--rm-accent);
  color: var(--rm-accent-text);
}

.rm-btn-primary:hover {
  background: var(--rm-accent-hover);
}

.rm-btn-secondary {
  background: var(--rm-surface);
  border-color: var(--rm-border-strong);
  color: var(--rm-text);
}

.rm-btn-secondary:hover {
  border-color: var(--rm-accent);
  color: var(--rm-accent);
}

.rm-card-demo .rm-card-footer {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rm-btn.rm-card-btn {
  padding: 8px 14px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.rm-btn.rm-demo-btn {
  cursor: default;
  pointer-events: none;
}

@media (max-width: 640px) {
  .rm-card-demo .rm-card-btn {
    width: 100%;
  }
}

/* Single Product */
.rm-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: var(--rm-muted);
}

.rm-breadcrumbs a {
  text-decoration: none;
}

.rm-breadcrumbs a:hover {
  color: var(--rm-accent);
}

.rm-product {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  padding: clamp(18px, 3vw, 36px);
}

.rm-product-media {
  aspect-ratio: 1 / 1;
  background: var(--rm-media-bg);
  border-radius: var(--rm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 3vw, 32px);
}

.rm-product-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rm-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rm-gallery-thumb {
  width: 64px;
  height: 64px;
  padding: 4px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-media-bg);
  cursor: pointer;
  overflow: hidden;
}

.rm-gallery-thumb.is-active,
.rm-gallery-thumb:hover {
  border-color: var(--rm-accent);
}

.rm-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.rm-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rm-product-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rm-product-cat {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rm-muted);
}

.rm-product-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.rm-product-price {
  margin: 4px 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rm-product-prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.rm-product-old-price {
  font-size: 1.125rem;
  color: var(--rm-muted);
  text-decoration: line-through;
}

.rm-variants {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rm-variant-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rm-variant-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rm-muted);
}

.rm-variant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rm-variant-pill {
  padding: 7px 14px;
  border: 1px solid var(--rm-border-strong);
  border-radius: 999px;
  background: var(--rm-surface);
  color: var(--rm-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.rm-variant-pill.is-active {
  background: var(--rm-accent);
  border-color: var(--rm-accent);
  color: var(--rm-accent-text);
}

.rm-specs {
  margin: 8px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--rm-border);
  display: grid;
  gap: 8px;
}

.rm-spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9375rem;
}

.rm-spec-row dt {
  color: var(--rm-muted);
}

.rm-spec-row dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}

.rm-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.rm-product-content {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--rm-border);
  color: var(--rm-text);
}

.rm-product-content > :first-child {
  margin-top: 0;
}

/* Empty State */
.rm-empty {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  padding: clamp(32px, 5vw, 56px) 24px;
  text-align: center;
}

.rm-empty-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.rm-empty-text {
  margin: 0 auto 20px;
  max-width: 420px;
  color: var(--rm-muted);
}

/* Pagination */
.rm-pagination {
  margin-top: 28px;
}

.rm-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rm-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-surface);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.rm-pagination .page-numbers.current {
  background: var(--rm-accent);
  border-color: var(--rm-accent);
  color: var(--rm-accent-text);
}

/* Footer */
.rm-footer {
  background: var(--rm-surface);
  border-top: 1px solid var(--rm-border);
  padding-block: 32px 24px;
}

.rm-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.rm-footer-title {
  margin: 0 0 4px;
  font-size: 1.125rem;
  font-weight: 700;
}

.rm-footer-note {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--rm-muted);
}

.rm-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rm-footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rm-border);
  font-size: 0.875rem;
  color: var(--rm-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.rm-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rm-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.rm-footer-nav a {
  text-decoration: none;
}

.rm-footer-nav a:hover {
  color: var(--rm-accent);
}

/* Responsive */
@media (max-width: 1099px) {
  .rm-header-search-input {
    width: 150px;
  }

  .rm-catalog-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .rm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .rm-catalog-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rm-filter-toggle {
    display: inline-flex;
  }

  .rm-filters {
    display: none;
  }

  .rm-filters.is-open {
    display: flex;
  }

  .rm-filters-close {
    display: inline-block;
  }
}

@media (max-width: 767px) {
  .rm-nav-toggle {
    display: inline-flex;
  }

  .rm-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 14px 16px;
    background: var(--rm-surface);
    border-bottom: 1px solid var(--rm-border);
  }

  .rm-nav.is-open {
    display: flex;
  }

  .rm-header-search {
    margin-left: 0;
    padding-top: 6px;
  }

  .rm-header-search-input {
    width: 100%;
  }

  .rm-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .rm-hero-media {
    max-height: 190px;
  }

  .rm-hero-img {
    max-height: 160px;
  }

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

  .rm-card-media {
    padding: 12px;
  }

  .rm-card-body {
    padding: 10px 10px 12px;
    gap: 6px;
  }

  .rm-card-title {
    font-size: 0.875rem;
  }

  .rm-card-price {
    font-size: 0.975rem;
  }

  .rm-card-cta {
    display: none;
  }

  .rm-product {
    grid-template-columns: 1fr;
  }
}

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