ç/* ========================================== */
/* OFUSHI SUPPLY - ESTILOS PRINCIPALES Y EDITOR */
/* ========================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #f8fafc;
  color: #1e293b;
}

/* Acoplamiento perfecto al activar el editor flotante de 340px */
body.modo-edicion-activo {
  margin-right: 340px !important;
  width: calc(100vw - 340px) !important;
  max-width: calc(100vw - 340px) !important;
}

/* Estado cuando la barra lateral se oculta pero el modo edición sigue activo */
body.modo-edicion-activo.barra-oculta {
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.modo-edicion-activo.barra-oculta #ofushiSidebarEditor {
  transform: translateX(100%);
}

#ofushiSidebarEditor {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botón flotante para alternar la visibilidad de la barra (El Ojo 👁️) */
#btnToggleSidebarEdicion {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #0f172a;
  color: #38bdf8;
  border: 2px solid #38bdf8;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

#btnToggleSidebarEdicion:hover {
  background: #1e293b;
  transform: scale(1.05);
}

body.modo-edicion-activo .header,
body.modo-edicion-activo .store-hero,
body.modo-edicion-activo .store-info-bar,
body.modo-edicion-activo .vendor-menu-dropdown,
body.modo-edicion-activo .store-body,
body.modo-edicion-activo .quote-section-bottom {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Corrección clave: Expandir el cuerpo y el ancho de las tarjetas al ocultar la barra */
body.modo-edicion-activo.barra-oculta .store-body {
  width: 100% !important;
  max-width: 100% !important;
}

body.modo-edicion-activo.barra-oculta .catalog-card {
  max-width: calc(100vw - 60px) !important;
}

body.modo-edicion-activo .store-header-content,
body.modo-edicion-activo .info-grid,
body.modo-edicion-activo .menu-container {
  max-width: 100% !important;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box !important;
}

/* Header Principal de OFUSHI Supply */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.logo span {
  color: #2563eb;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Botones Generales */
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-outline {
  border: 1.5px solid #2563eb;
  background: transparent;
  color: #2563eb;
}

.btn-outline:hover {
  background: #eff6ff;
}

.btn-block {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4.5rem 1rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
}

.hero h1 {
  font-size: 2.3rem;
  margin-bottom: 1rem;
}

.hero p {
  color: #94a3b8;
  max-width: 620px;
  margin: 0 auto 2rem auto;
  font-size: 1.05rem;
}

.search-box {
  display: flex;
  justify-content: center;
  max-width: 580px;
  margin: 0 auto;
  gap: 0.5rem;
}

.search-box input {
  width: 70%;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  outline: none;
  font-size: 0.95rem;
}

.search-box button {
  background-color: #10b981;
  color: white;
  padding: 0 1.5rem;
}

.search-box button:hover {
  background-color: #059669;
}

/* Grid del Directorio de Proveedores */
.main-container {
  padding: 3rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.main-container h2 {
  font-size: 1.5rem;
  color: #0f172a;
}

.suppliers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card-supplier {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.supplier-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Logo con fondo blanco y borde limpio (Directorio) */
.supplier-logo {
  width: 55px;
  height: 55px;
  border-radius: 8px;
  background: #ffffff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.supplier-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.supplier-info h3 {
  font-size: 1.15rem;
  color: #0f172a;
}

.supplier-info .location {
  font-size: 0.85rem;
  color: #64748b;
}

.supplier-details {
  font-size: 0.88rem;
  color: #334155;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.supplier-details p {
  margin-bottom: 0.3rem;
}

/* Modales y Formularios de Edición/Registro */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-card {
  background: white;
  width: 90%;
  max-width: 480px;
  padding: 2rem;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-card.modal-large {
  max-width: 750px;
  max-height: 88vh;
  overflow-y: auto;
}

.btn-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.8rem;
  cursor: pointer;
  color: #94a3b8;
}

.modal-body h3 {
  font-size: 1.3rem;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.modal-sub {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.2rem;
  width: 100%;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  font-size: 0.9rem;
  background-color: white;
}

/* Sitio Web del Proveedor e Integración de Menú de Tres Líneas */
.store-hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 2rem 5% 1.5rem 5%;
  box-sizing: border-box;
  width: 100%;
}

.store-header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

/* Logo grande con fondo blanco y borde limpio (Vista de Tienda) */
.store-big-logo {
  width: 75px;
  height: 75px;
  background: #ffffff;
  color: #2563eb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  border: 2px solid #cbd5e1;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.06);
}

.hamburger-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.vendor-menu-dropdown {
  display: none;
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 5%;
  box-sizing: border-box;
  width: 100%;
}

.vendor-menu-dropdown.active {
  display: block;
}

.menu-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.menu-container a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: color 0.2s;
  display: inline-block;
}

.menu-container a:hover {
  color: #38bdf8;
}

.menu-contact-bar {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn-whatsapp {
  background-color: #25d366;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-whatsapp:hover {
  background-color: #128c7e;
}

.btn-email {
  background-color: #3b82f6;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Barra de Datos Comerciales y Layout Interno */
.store-info-bar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 5%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  box-sizing: border-box;
  width: 100%;
}

.info-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  font-size: 0.9rem;
  color: #334155;
}

.store-body {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 5%;
  position: relative;
  min-height: 1800px;
  box-sizing: border-box;
}

.catalog-card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.family-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #2563eb;
  margin: 1.2rem 0 0.6rem 0;
  border-bottom: 2px solid #eff6ff;
  padding-bottom: 0.3rem;
}

/* Productos y Stock Inteligente */
.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border: 1px solid #f1f5f9;
}

.product-unit {
  font-size: 0.78rem;
  background: #e2e8f0;
  color: #334155;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-weight: 500;
}

.stock-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 0.5rem;
}

.stock-ok {
  background: #d1fae5;
  color: #065f46;
}

.stock-warning {
  background: #fef3c7;
  color: #92400e;
}

.stock-empty {
  background: #fee2e2;
  color: #991b1b;
}

.review-card {
  font-size: 0.88rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #cbd5e1;
}

/* Sección de Cotización al Final */
.quote-section-bottom {
  max-width: 1200px;
  margin: 1rem auto 3rem auto;
  padding: 0 5%;
  box-sizing: border-box;
  width: 100%;
}

.btn-back {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.btn-back:hover { 
  color: white; 
}

/* Ocultamiento estricto para alternar entre botones y la burbuja de usuario */
.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .store-body { 
    grid-template-columns: 1fr; 
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}