/* ==========================================================
   GlobPay - Shopify Admin Shell (Simulación Local)
   shopify-shell.css
   
   IMPORTANTE:
   - Este componente representa el entorno de Shopify Admin en prototipos locales.
   - Si la aplicación se ejecuta dentro del iframe nativo de Shopify (App Bridge / embedded=1),
     este contenedor se oculta automáticamente para evitar barras laterales duplicadas.
   - La integración nativa de navegación con Shopify App Bridge queda identificada claramente como pendiente.
   ========================================================== */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

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

/* Layout general del shell */
.shopify-admin-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e3e3e3;
  overflow-x: hidden;
}

/* ----------------------------------------------------------
   BARRA LATERAL IZQUIERDA DE SHOPIFY (DARK THEME)
   ---------------------------------------------------------- */
.shopify-sidebar {
  width: 250px;
  min-width: 250px;
  background-color: #1a1a1a;
  border-right: 1px solid #2d2d2d;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  user-select: none;
  overflow-y: auto;
}

.shopify-sidebar::-webkit-scrollbar {
  width: 6px;
}
.shopify-sidebar::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 3px;
}

/* Cabecera del sidebar con logo y búsqueda */
.shopify-sidebar-header {
  padding: 16px 14px 12px 14px;
}

.shopify-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.shopify-logo-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.shopify-store-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Barra de búsqueda estilo Shopify */
.shopify-search-box {
  background-color: #262626;
  border: 1px solid #383838;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.shopify-search-box:hover {
  border-color: #4f4f4f;
  background-color: #2b2b2b;
}

.shopify-search-icon {
  width: 15px;
  height: 15px;
  color: #8c8c8c;
  flex-shrink: 0;
}

.shopify-search-placeholder {
  font-size: 13px;
  color: #8c8c8c;
  flex-grow: 1;
}

.shopify-search-kbd {
  font-size: 11px;
  background-color: #333333;
  color: #a0a0a0;
  border-radius: 4px;
  padding: 2px 6px;
  border: 1px solid #404040;
}

/* ----------------------------------------------------------
   LISTA DE NAVEGACIÓN
   ---------------------------------------------------------- */
.shopify-nav-list {
  list-style: none;
  margin: 0;
  padding: 4px 10px;
}

.shopify-nav-item {
  margin-bottom: 2px;
}

.shopify-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: #cccccc;
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.shopify-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.shopify-nav-icon {
  width: 17px;
  height: 17px;
  color: #999999;
  flex-shrink: 0;
}

/* Encabezados de sección (Canales de ventas, Apps) */
.shopify-nav-section-title {
  padding: 14px 10px 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #888888;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shopify-nav-section-arrow {
  width: 12px;
  height: 12px;
  color: #777777;
}

/* ----------------------------------------------------------
   ENTRADA DE GLOBPAY EN EL MENÚ DE APPS
   ---------------------------------------------------------- */
.shopify-app-entry-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.04);
}

.shopify-app-entry-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.globpay-nav-app-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
}

.shopify-app-chevron {
  width: 14px;
  height: 14px;
  color: #999999;
  transition: transform 0.2s ease;
}

/* ----------------------------------------------------------
   SUBMENÚ DE GLOBPAY (10 SECCIONES OFICIALES)
   ---------------------------------------------------------- */
.globpay-submenu-list {
  list-style: none;
  margin: 4px 0 8px 12px;
  padding: 0 0 0 8px;
  border-left: 1px solid #303030;
}

.globpay-submenu-item {
  margin-bottom: 2px;
}

.globpay-submenu-link {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  color: #b0b0b0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  border-radius: 6px;
  transition: all 0.15s ease;
  position: relative;
  cursor: pointer;
}

.globpay-submenu-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Estado Activo de Sección (Acento Turquesa Oficial) */
.globpay-submenu-link.is-active {
  background-color: #282828;
  color: #ffffff;
  font-weight: 600;
}

.globpay-submenu-link.is-active::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background-color: #0BB6B5;
  border-radius: 2px;
}

/* ----------------------------------------------------------
   PIE DEL MENÚ LATERAL (Configuración y Selector de Tienda)
   ---------------------------------------------------------- */
.shopify-sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid #2a2a2a;
  background-color: #171717;
}

.prototype-notice-pill {
  background-color: rgba(11, 182, 181, 0.12);
  border: 1px solid rgba(11, 182, 181, 0.25);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #4edcd8;
  line-height: 1.3;
}

.prototype-notice-pill strong {
  display: block;
  font-size: 11px;
  color: #80f5ec;
}

.store-switcher-group {
  margin-bottom: 10px;
}

.store-switcher-label {
  display: block;
  font-size: 11px;
  color: #888888;
  margin-bottom: 4px;
}

.store-switcher-select {
  width: 100%;
  background-color: #242424;
  border: 1px solid #383838;
  color: #e3e3e3;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.store-switcher-select:focus {
  border-color: #0BB6B5;
}

/* ----------------------------------------------------------
   BARRA MÓVIL SUPERIOR (Pantallas < 768px)
   ---------------------------------------------------------- */
.shopify-mobile-topbar {
  display: none;
  height: 52px;
  background-color: #1a1a1a;
  border-bottom: 1px solid #2d2d2d;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  box-sizing: border-box;
}

.mobile-hamburger-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.mobile-hamburger-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
}

.mobile-store-pill {
  font-size: 11px;
  background-color: #2b2b2b;
  color: #9be5e4;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #3d3d3d;
}

/* Overlay para cerrar el menú en móvil */
.shopify-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 150;
}

/* ----------------------------------------------------------
   ADAPTACIÓN RESPONSIVA DEL SHELL
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  .shopify-admin-wrapper {
    flex-direction: column;
  }

  .shopify-mobile-topbar {
    display: flex;
  }

  .shopify-sidebar {
    position: fixed;
    top: 52px;
    left: -290px;
    width: 260px;
    height: calc(100vh - 52px);
    z-index: 160;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
  }

  .shopify-sidebar.is-open {
    left: 0;
  }

  .shopify-mobile-backdrop.is-open {
    display: block;
  }
}

/* Modo Embebido Oficial de Shopify (Oculta la simulación local) */
.shopify-admin-wrapper.is-embedded .shopify-sidebar,
.shopify-admin-wrapper.is-embedded .shopify-mobile-topbar,
.shopify-admin-wrapper.is-embedded .shopify-mobile-backdrop {
  display: none !important;
}

.shopify-admin-wrapper.is-embedded {
  background-color: #F7F9FA;
}
