/*
Theme Name: Stonepedia
Theme URI: https://stonepedia.ru
Author: Sol
Description: Кастомная тема Stonepedia — портал натурального камня
Version: 1.0.0
License: GPL v2 or later
Text Domain: stonepedia
*/

:root {
  --bg: #FFFFFF;
  --soft: #F7F6F4;
  --border: #E8E6E1;
  --text: #1A1917;
  --muted: #6B6860;
  --accent: #3D3B36;
  --green: #1A6B4A;
  --radius: 8px;
  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #F1EFE8; font-size: 16px; }
.logo-text { font-weight: 600; font-size: 16px; color: var(--text); letter-spacing: -0.02em; }
.nav { display: flex; gap: 8px; align-items: center; flex-shrink: 1; min-width: 0; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav::-webkit-scrollbar { height: 0; display: none; }
.nav a { font-size: 12px; color: var(--muted); text-decoration: none; padding: 4px 6px; transition: color 0.15s ease; white-space: nowrap; }
.nav li { display: inline-flex; }
.nav a:hover, .nav .current-menu-item a { color: var(--text); }
.login-btn { font-size: 12px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; background: var(--bg); transition: background 0.15s ease, border-color 0.15s ease; }
.login-btn:hover { background: var(--soft); border-color: #C8C5BF; }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 22px; color: var(--text); cursor: pointer; padding: 4px; }
.hero { text-align: center; padding: 44px 24px 32px; background: var(--bg); }
.hero h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 4px; }
.hero .subtitle { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.search-box { display: flex; align-items: center; gap: 10px; max-width: 480px; margin: 0 auto; border: 1px solid var(--border); border-radius: 10px; padding: 11px 16px; background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.search-box input { border: none; outline: none; flex: 1; font-size: 14px; color: var(--text); font-family: var(--font); background: transparent; }
.search-box .icon { color: var(--muted); font-size: 16px; cursor: pointer; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.tags a, .tags li a { font-size: 12px; padding: 4px 12px; border-radius: 20px; background: var(--soft); color: var(--muted); border: 1px solid var(--border); text-decoration: none; transition: background 0.15s ease, color 0.15s ease; }
.tags a:hover, .tags li a:hover { background: var(--border); color: var(--text); }
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 32px; }
.service { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; display: block; transition: box-shadow 0.15s ease; }
.service:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.service .icon { font-size: 18px; }
.service h3 { font-size: 14px; font-weight: 500; color: var(--text); margin: 8px 0 2px; }
.service p { font-size: 12px; color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.section-head h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.section-head a { font-size: 13px; color: var(--muted); text-decoration: none; }
.section-head a:hover { color: var(--text); }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 32px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: block; transition: box-shadow 0.15s ease, transform 0.15s ease; background: var(--bg); }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card .photo { height: 120px; background: #E8E6E1; overflow: hidden; }
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.card .info { padding: 10px 12px; }
.card .name { font-size: 13px; font-weight: 500; color: var(--text); }
.card .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.card .stock { font-size: 11px; color: var(--green); margin-top: 6px; }
.supplier { background: var(--soft); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.supplier h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.supplier p { font-size: 13px; color: var(--muted); }
.supplier .btn { background: var(--accent); color: #F1EFE8; border: none; border-radius: var(--radius); font-size: 13px; font-weight: 500; padding: 10px 20px; white-space: nowrap; cursor: pointer; text-decoration: none; transition: opacity 0.15s ease; display: inline-block; }
.supplier .btn:hover { opacity: 0.9; }
.site-footer { background: var(--soft); border-top: 1px solid var(--border); padding: 36px 0 24px; margin-top: 24px; }
.footer-cols { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.footer-col a { display: block; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.footer-col a:hover { color: var(--text); }
.copyright { font-size: 12px; color: var(--muted); text-align: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.woocommerce-archive { padding: 24px 0; }
.woocommerce-archive .page-title { font-size: 22px; font-weight: 600; margin-bottom: 16px; }
.woocommerce-archive .woocommerce-result-count { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.woocommerce-archive .woocommerce-ordering { margin-bottom: 16px; }
.woocommerce-archive .woocommerce-ordering select { font-size: 13px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); background: var(--bg); }
.products-archive-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.product-type-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: block; background: var(--bg); transition: box-shadow 0.15s ease, transform 0.15s ease; }
.product-type-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.product-type-card .photo { height: 140px; overflow: hidden; }
.product-type-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.product-type-card .info { padding: 10px 12px; }
.product-type-card .name { font-size: 13px; font-weight: 500; color: var(--text); }
.product-type-card .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.product-type-card .stock { font-size: 12px; color: var(--green); margin-top: 6px; }
.woocommerce-pagination { margin-top: 24px; }
.woocommerce-pagination .page-numbers { display: flex; gap: 4px; flex-wrap: wrap; }
.woocommerce-pagination .page-numbers li a, .woocommerce-pagination .page-numbers li span { font-size: 13px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); text-decoration: none; }
.woocommerce-pagination .page-numbers li span.current { background: var(--accent); color: #F1EFE8; border-color: var(--accent); }
.woocommerce-pagination .page-numbers li a:hover { background: var(--soft); }
.woocommerce-single { padding: 24px 0; }
.woocommerce-single .product { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.woocommerce-single .product .images img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.woocommerce-single .product_title { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.woocommerce-single .product .price { font-size: 18px; font-weight: 500; color: var(--accent); margin-bottom: 12px; }
.woocommerce-single .product .woocommerce-product-details__short-description { font-size: 14px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.woocommerce-single .product .cart { margin-bottom: 16px; }
.woocommerce-single .product .cart .quantity { margin-bottom: 10px; }
.woocommerce-single .product .cart .qty { width: 60px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.woocommerce-single .product .single_add_to_cart_button { background: var(--accent); color: #F1EFE8; border: none; border-radius: var(--radius); padding: 10px 24px; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity 0.15s ease; }
.woocommerce-single .product .single_add_to_cart_button:hover { opacity: 0.9; }
.woocommerce-single .product_meta { font-size: 12px; color: var(--muted); margin-top: 16px; }
.woocommerce-single .product_meta span { display: block; margin-bottom: 4px; }
.error404 .hero { min-height: 40vh; padding: 80px 24px; }
@media (max-width: 820px) { .nav { display: none; } .mobile-menu-toggle { display: block; } .services { grid-template-columns: repeat(2, 1fr); } .product-grid { grid-template-columns: repeat(2, 1fr); } .products-archive-grid { grid-template-columns: repeat(2, 1fr); } .woocommerce-single .product { grid-template-columns: 1fr; } .supplier { flex-direction: column; align-items: flex-start; } .hero h1 { font-size: 23px; } .header-inner { flex-wrap: wrap; gap: 10px; } }
/* ─── WooCommerce overrides ─── */
.woocommerce .quantity .qty {
  width: 60px; padding: 6px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px;
  font-family: var(--font); background: var(--bg); color: var(--text);
}
.woocommerce .single_add_to_cart_button,
.woocommerce button.button,
.woocommerce a.button {
  background: var(--accent); color: #F1EFE8; border: none;
  border-radius: var(--radius); padding: 10px 24px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: opacity 0.15s ease;
}
.woocommerce .single_add_to_cart_button:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover { opacity: 0.9; }
.woocommerce .stock { font-size: 13px; margin-bottom: 12px; }
.woocommerce .in-stock { color: var(--green); }
.woocommerce .out-of-stock { color: #993C1D; }

/* Variations */
.woocommerce .variations select {
  font-size: 13px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font);
  background: var(--bg); color: var(--text);
}
.woocommerce .reset_variations { font-size: 12px; color: var(--muted); }
.woocommerce .woocommerce-variation-price { margin: 8px 0; }

/* Messages */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  font-size: 13px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--soft); margin-bottom: 12px;
}
.woocommerce-message { border-color: var(--green); }
.woocommerce-error { border-color: #993C1D; }

/* Tabs */
.woocommerce-tabs { margin-top: 32px; }
.woocommerce-tabs ul.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.woocommerce-tabs ul.tabs li { font-size: 13px; }
.woocommerce-tabs ul.tabs li a {
  padding: 6px 14px; border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0; color: var(--muted);
  background: var(--soft); text-decoration: none;
}
.woocommerce-tabs ul.tabs li.active a {
  color: var(--text); background: var(--bg); border-bottom-color: var(--bg);
}
.woocommerce-tabs .panel { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Related */
.related.products { margin-top: 32px; }
.related.products h2 { font-size: 17px; font-weight: 500; margin-bottom: 12px; }

/* Catalog ordering */
.woocommerce-ordering select {
  font-size: 13px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font); background: var(--bg); color: var(--text);
}
.woocommerce-result-count { font-size: 13px; color: var(--muted); }


/* ─── Catalog Grid ─── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 820px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .catalog-grid { grid-template-columns: 1fr; }
}
.catalog-grid .card {
  border: 1px solid #E8E6E1;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  background: #fff;
}
.catalog-grid .card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.catalog-grid .card .photo {
  height: 160px;
  overflow: hidden;
  background: #E8E6E1;
}
.catalog-grid .card .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.catalog-grid .card .photo .photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: #ccc;
  font-size: 40px;
}
.catalog-grid .card .info {
  padding: 10px 12px;
}
.catalog-grid .card .info .name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1A1917);
}
.catalog-grid .card .info .meta {
  font-size: 12px;
  color: #6B6860;
  margin-top: 2px;
}
.catalog-grid .card .info .stock {
  font-size: 12px;
  color: #1A6B4A;
  margin-top: 6px;
}

/* ─── Catalog Pagination ─── */
.catalog-pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.catalog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  font-size: 13px;
  border: 1px solid #E8E6E1;
  border-radius: 6px;
  text-decoration: none;
  color: #6B6860;
  background: #fff;
  transition: background 0.1s, color 0.1s;
}
.catalog-pagination .page-numbers.current {
  background: #3D3B36;
  color: #F1EFE8;
  border-color: #3D3B36;
}
.catalog-pagination .page-numbers:hover:not(.current) {
  background: #F7F6F4;
}
.catalog-pagination .page-numbers.dots {
  border: none;
  min-width: auto;
  background: transparent;
}

/* ─── Similar stones section ─── */
.similar-section {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}
.similar-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #1A1917);
  margin: 0 0 16px;
}
.similar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .similar-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .similar-grid { grid-template-columns: repeat(3, 1fr); } }
.sim-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #E8E6E1;
  background: #fff;
  transition: box-shadow 0.15s, transform 0.15s;
}
.sim-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.sim-card a { text-decoration: none; color: inherit; display: block; }
.sim-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.sim-card .sim-name {
  font-size: 11px;
  color: #444;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-card .photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: #ccc;
  font-size: 24px;
}


/* ─── Single Product Overrides ─── */
/* Hide WooCommerce price and meta — prices are in USD placeholder */
.product-detail .price {
  display: none !important;
}
/* Also hide the WooCommerce product_meta section (shows numeric categories) */
.product-detail .product_meta {
  display: none !important;
}

/* Stronger button color override (fix purple) */
.single_add_to_cart_button,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce .single_add_to_cart_button,
.woocommerce button.single_add_to_cart_button {
  background: #3D3B36 !important;
  color: #F1EFE8 !important;
  border: none !important;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.single_add_to_cart_button:hover,
.woocommerce button.button.alt:hover {
  opacity: 0.9 !important;
  background: #3D3B36 !important;
}

/* Product hero layout */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 820px) {
  .product-detail { grid-template-columns: 1fr; }
}
.product-detail .summary .product_title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}
.product-detail .summary .product-meta {
  font-size: 12px;
  color: var(--muted, #6B6860);
  margin-bottom: 12px;
}
.product-detail .summary .woocommerce-product-details__short-description {
  font-size: 14px;
  color: var(--muted, #6B6860);
  margin-bottom: 16px;
  line-height: 1.6;
}
.cart-target { margin: 12px 0; }
.cart-target .cart .quantity { margin-bottom: 10px; }
.cart-target .cart .qty {
  width: 60px; padding: 6px;
  border: 1px solid var(--border, #E8E6E1);
  border-radius: var(--radius, 8px);
  font-size: 14px;
  font-family: var(--font);
}

/* ─── Lightbox ─── */
.stone-lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.stone-lightbox.active {
  display: flex;
}
.stone-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.lb-close {
  position: fixed;
  top: 16px; right: 16px;
  left: auto !important;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 28px;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  line-height: 1;
}
.lb-close:hover {
  background: rgba(0,0,0,0.8);
}
