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

:root {
  --brand-bg: #f5efe6;
  --brand-card: #fcfbf9;
  --brand-dark: #1C402E;
  --brand-dark-light: rgba(28, 64, 46, 0.7);
  --brand-dark-lightest: rgba(28, 64, 46, 0.1);
  --brand-dark-hover: #285d43;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--brand-bg);
  color: var(--brand-dark);
  min-height: 100vh;
  line-height: 1.5;
}

button { border: none; background: none; font: inherit; cursor: pointer; }
input, select { font: inherit; }

/* Layout */
.container { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px)  { .container { padding: 0 24px; } }
@media (min-width: 1280px) { .container { padding: 0 32px; } }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(245, 239, 230, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--brand-dark-lightest);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 16px;
}

.logo {
  width: 60px; height: 60px;
  border-radius: 50%;
  background-color: var(--brand-bg);
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--brand-dark-lightest);
  flex-shrink: 0;
}
.logo img { width: 100%; height: 100%; object-fit: cover; }

.search-bar {
  flex: 1;
  max-width: 672px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 32px; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--brand-dark-light);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  background-color: rgba(252, 251, 249, 0.5);
  border: 1px solid var(--brand-dark-lightest);
  border-radius: 16px;
  font-size: 15px;
  transition: all 0.2s;
}
.search-input:focus {
  background-color: #fff;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 2px var(--brand-dark);
  outline: none;
}

.nav-links { display: none; align-items: center; gap: 24px; }
@media (min-width: 768px) { .nav-links { display: flex; } }

.nav-link {
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--brand-dark-light); }

/* Main */
.main-content { margin-top: 24px; padding-bottom: 56px; }
@media (min-width: 768px) { .main-content { padding-bottom: 120px; } }

.hero {
  position: relative;
  margin-bottom: 32px;
  border-radius: 24px;
  height: 240px; width: 100%;
  background-color: #ebd8c1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  overflow: hidden;
}
@media (min-width: 768px) { .hero { height: 300px; border-radius: 32px; } }
.hero img { width: 100%; height: 100%; object-fit: cover; }

/* Controls */
.controls-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.categories-container {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; width: 100%;
}

.category-btn {
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid var(--brand-dark-lightest);
  background-color: #fff;
  color: var(--brand-dark-light);
}
.category-btn:hover { background-color: rgba(255,255,255,0.8); }
.cat-count { font-size: 0.8em; font-weight: 500; margin-left: 4px; opacity: 0.7; vertical-align: middle; }
.category-btn.active {
  background-color: var(--brand-dark);
  color: var(--brand-card);
  border-color: var(--brand-dark);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.sort-container {
  display: flex; align-items: center; gap: 12px;
  align-self: flex-end;
}

.results-count { font-size: 14px; font-weight: 500; color: rgba(28,64,46,0.6); }

.sort-select-wrapper { position: relative; }
.sort-select {
  appearance: none;
  background-color: #fff;
  border: 1px solid var(--brand-dark-lightest);
  border-radius: 12px;
  padding: 8px 40px 8px 16px;
  font-size: 14px; font-weight: 500;
}
.sort-select:focus { outline: none; box-shadow: 0 0 0 2px var(--brand-dark); }
.sort-icon {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: rgba(28,64,46,0.6);
  pointer-events: none;
}

/* Products Grid */
.products-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px)  { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; } }

.product-card {
  background-color: var(--brand-card);
  border-radius: 16px;
  padding: 16px;
  display: flex; gap: 20px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.3s ease-out;
  cursor: pointer;
  overflow: hidden;
}
.product-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  transform: translateY(-6px);
}

.product-image-cont {
  width: 110px; height: 130px;
  flex-shrink: 0;
  background-color: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  position: relative;
  cursor: zoom-in;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-dark-lightest);
}
.product-image-cont img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.product-card:hover .product-image-cont img { transform: scale(1.05); }

.product-info {
  display: flex; flex-direction: column;
  flex: 1; padding: 4px 0;
}
.product-header { display: flex; justify-content: space-between; align-items: flex-start; }
.product-category {
  font-size: 11px; text-transform: uppercase;
  font-weight: 600; color: var(--brand-dark-light);
  letter-spacing: 0.1em; margin-top: 4px;
}
.fav-btn { margin-right: -4px; transition: color 0.2s; color: var(--brand-dark-light); }
.fav-btn:hover, .fav-btn.active { color: var(--brand-dark); }

.product-title {
  font-weight: 700; font-size: 15px;
  line-height: 1.25; margin-top: 4px;
  color: rgba(28,64,46,0.95);
}
.product-price { font-size: 17px; font-weight: 600; margin-top: auto; }
.product-price .p-old {
  font-size: 13px; font-weight: 500;
  text-decoration: line-through;
  color: var(--brand-dark-light);
  margin-right: 6px;
}
.product-price .p-sale { color: #c0392b; }

.consult-bg-btn {
  position: absolute; bottom: 0; right: 0;
  background-color: var(--brand-dark);
  border-top-left-radius: 16px;
  border-bottom-right-radius: 15px;
  padding: 8px 16px;
  color: var(--brand-card);
  font-size: 13px; font-weight: 600;
  transition: background-color 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.consult-bg-btn:hover { background-color: var(--brand-dark-hover); }

/* Skeleton */
.skeleton-card {
  background-color: var(--brand-card);
  border-radius: 16px;
  padding: 16px;
  display: flex; gap: 20px;
  animation: pulse 1.5s infinite;
}
.sk-img { width: 110px; height: 130px; border-radius: 16px; background: #e8e0d6; flex-shrink: 0; }
.sk-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.sk-line { height: 14px; border-radius: 6px; background: #e8e0d6; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  border-top: 1px solid var(--brand-dark-lightest);
  background-color: rgba(245, 239, 230, 0.95);
  backdrop-filter: blur(12px);
  padding: 8px 0;
}
@media (min-width: 768px) { .footer { padding: 16px 0; } }

.footer-hide-mobile { display: none !important; }
@media (min-width: 768px) { .footer-hide-mobile { display: revert !important; } }

.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }

.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-logo-img {
  width: 32px; height: 32px;
  border-radius: 50%;
  background-color: var(--brand-bg);
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--brand-dark-lightest);
}
.footer-logo-img img { width: 100%; height: 100%; object-fit: cover; }
.footer-logo-text { font-weight: 700; font-size: 16px; letter-spacing: -0.025em; }
.footer-desc { color: var(--brand-dark-light); font-size: 14px; max-width: 320px; line-height: 1.6; }

.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-heading { font-weight: 700; margin-bottom: 4px; }
.footer-info-row {
  color: var(--brand-dark-light); font-size: 14px;
  display: flex; align-items: flex-start; gap: 8px;
}
.footer-info-row svg { margin-top: 2px; flex-shrink: 0; width: 16px; height: 16px; }
.footer-info-link {
  color: var(--brand-dark-light); font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; transition: color 0.2s;
}
.footer-info-link:hover { color: var(--brand-dark); }
.footer-socials { display: flex; align-items: center; gap: 16px; }
.social-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background-color: var(--brand-card);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid rgba(28,64,46,0.05);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-dark-light);
  transition: all 0.2s;
  text-decoration: none;
}
.social-btn:hover { color: var(--brand-dark); background-color: rgba(28,64,46,0.05); }
.copy-text {
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--brand-dark-lightest);
  color: rgba(28,64,46,0.5); font-size: 12px; font-weight: 500; text-align: center;
}
@media (min-width: 768px) { .copy-text { text-align: left; margin-top: 32px; } }

/* Modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
@media (min-width: 640px) { .modal-overlay { padding: 24px; } }

.modal-backdrop {
  position: absolute; inset: 0;
  background-color: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background-color: var(--brand-card);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%; max-width: 672px;
  max-height: 90vh; overflow-y: auto; overflow-x: hidden;
  animation: fadeInZoom 0.2s ease-out;
}

@keyframes fadeInZoom {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background-color: rgba(0,0,0,0.05);
  color: var(--brand-dark);
  transition: background-color 0.2s;
}
.modal-close-btn:hover { background-color: rgba(0,0,0,0.1); }

.modal-flex { display: flex; flex-direction: column; }
@media (min-width: 768px) { .modal-flex { flex-direction: row; } }

.modal-image-cont {
  width: 100%; aspect-ratio: 1/1;
  background-color: #fff;
  cursor: zoom-in; position: relative; overflow: hidden;
}
@media (min-width: 768px) {
  .modal-image-cont { width: 50%; aspect-ratio: auto; min-height: 400px; }
}
.modal-image-cont img {
  width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.5s;
}
.modal-image-cont:hover img { transform: scale(1.05); }

.photo-count-badge {
  position: absolute; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0,0,0,0.5);
  color: #fff; padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px; font-weight: 600;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.modal-info {
  width: 100%; padding: 24px;
  display: flex; flex-direction: column;
}
@media (min-width: 768px) { .modal-info { width: 50%; padding: 32px; } }

.modal-category {
  font-size: 12px; text-transform: uppercase;
  font-weight: 700; color: var(--brand-dark-light);
  letter-spacing: 0.1em; margin-bottom: 8px;
  display: block;
}
.modal-title { font-size: 24px; font-weight: 700; line-height: 1.25; margin-bottom: 16px; }

.modal-price-border {
  margin-bottom: 24px; padding-bottom: 24px;
  border-bottom: 1px solid var(--brand-dark-lightest);
  display: flex; flex-direction: column; gap: 8px;
}
.modal-price { font-size: 30px; font-weight: 800; }
.modal-price .p-old {
  font-size: 18px; font-weight: 500;
  text-decoration: line-through;
  color: var(--brand-dark-light); margin-right: 10px;
}
.modal-price .p-sale { color: #c0392b; }
.modal-stock { font-size: 14px; color: var(--brand-dark-light); font-weight: 500; margin-top: 4px; }

.modal-desc-wrapper { flex: 1; }
.modal-desc-title { font-weight: 600; margin-bottom: 8px; }
.modal-desc { color: rgba(28,64,46,0.8); font-size: 15px; line-height: 1.6; }

.modal-actions {
  margin-top: 32px; padding-top: 24px;
  display: flex; gap: 12px;
}
.action-consult {
  flex: 1;
  background-color: var(--brand-dark);
  color: var(--brand-card);
  padding: 16px;
  border-radius: 12px;
  font-weight: 600; letter-spacing: 0.025em; font-size: 18px;
  transition: background-color 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  text-decoration: none; display: flex; align-items: center; justify-content: center;
}
.action-consult:hover { background-color: var(--brand-dark-hover); }
.action-share {
  flex-shrink: 0; width: 56px; height: 56px;
  background-color: var(--brand-dark-lightest);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.2s;
}
.action-share:hover { background-color: rgba(28,64,46,0.2); }

/* Info Modal */
.info-modal-content {
  position: relative;
  background-color: var(--brand-card);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%; max-width: 448px;
  padding: 24px;
  animation: fadeInZoom 0.2s ease-out;
}
@media (min-width: 640px) { .info-modal-content { padding: 32px; } }

.info-title { font-size: 24px; font-weight: 700; margin-bottom: 16px; }
.info-text { color: rgba(28,64,46,0.8); font-size: 16px; line-height: 1.6; margin-bottom: 24px; }
.info-btn {
  width: 100%;
  background-color: var(--brand-dark);
  color: var(--brand-card);
  padding: 14px; border-radius: 12px;
  font-weight: 600; transition: background-color 0.2s;
}
.info-btn:hover { background-color: var(--brand-dark-hover); }

/* Viewer / Lightbox */
.viewer-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background-color: rgba(0,0,0,0.9);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.viewer-close {
  position: absolute; top: 24px; right: 24px;
  color: rgba(255,255,255,0.7); z-index: 110;
  transition: color 0.2s;
}
.viewer-close:hover { color: #fff; }

.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  padding: 12px; color: rgba(255,255,255,0.5);
  z-index: 110; transition: color 0.2s;
}
.viewer-nav:hover { color: #fff; }
.viewer-prev { left: 16px; }
.viewer-next { right: 16px; }
@media (min-width: 768px) { .viewer-prev { left: 40px; } .viewer-next { right: 40px; } }

.viewer-img {
  max-width: 95vw; max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: fadeInZoom 0.2s ease-out;
  position: relative; z-index: 105;
}

.viewer-dots {
  position: absolute; bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 110;
}
.viewer-dot {
  height: 10px; border-radius: 9999px;
  transition: all 0.2s;
  background-color: rgba(255,255,255,0.4); width: 10px;
}
.viewer-dot:hover { background-color: rgba(255,255,255,0.6); }
.viewer-dot.active { width: 32px; background-color: #fff; }

/* Stock badge */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  margin-top: 6px;
  width: fit-content;
}
.stock-badge.stock-many {
  background-color: rgba(28,64,46,0.1);
  color: var(--brand-dark);
}
.stock-badge.stock-last {
  background-color: #fef3c7;
  color: #92400e;
}

/* Empty / loading */
.empty-msg {
  text-align: center; padding: 48px 16px;
  color: var(--brand-dark-light); font-size: 16px;
}
.loading-more {
  text-align: center; padding: 24px;
  color: var(--brand-dark-light); font-size: 14px;
}
