/* greenmc-hosting-v2 · estilos por página (mobile-first).
   Se carga después de layout.css en layout_default y layout_auth. */

/* ---------- Ajustes táctiles globales (≥44px en móvil / puntero grueso) ---------- */
@media (max-width: 991.98px), (pointer: coarse) {
  .btn-sm, .btn-group-sm > .btn { min-height: var(--gm-touch); padding-top: .5rem; padding-bottom: .5rem; }
  .form-control-sm, .form-select-sm { min-height: var(--gm-touch); }
  .gm-announcement__cta { min-height: var(--gm-touch); display: inline-flex; align-items: center; }
  .page-link { min-width: var(--gm-touch); min-height: var(--gm-touch); }
}
.gm-no-scroll { overflow: hidden; }

/* Botón de icono redondo de 44px */
.gm-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: var(--gm-touch); height: var(--gm-touch); flex: 0 0 var(--gm-touch);
  border-radius: 50%; border: 1px solid var(--gm-border);
  background: var(--gm-surface); color: var(--gm-text); font-size: 1.15rem;
  text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.gm-icon-btn:hover, .gm-icon-btn:focus-visible { background: var(--gm-surface-2); color: var(--gm-text); border-color: rgba(255,255,255,.16); }
.gm-icon-btn--ghost { background: transparent; border-color: transparent; color: var(--gm-muted); }
.gm-icon-btn__badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; color: #fff;
}

/* ---------- Panel (mod_index_dashboard) ---------- */
.gm-dash-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin: 0 0 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--gm-border);
}
.gm-dash-topbar .gm-brand img { height: 26px; width: auto; display: block; }
.gm-dash-topbar .topbar-search .form-control { min-width: 260px; }

.gm-dash-hello { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.gm-dash-hello__date { margin: 0 0 .25rem; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gm-muted); }
.gm-dash-hello__title { margin: 0; font-size: clamp(28px, 7vw, 36px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.gm-dash-hello .apple-alert-pill { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; max-width: 100%; }
@media (min-width: 768px) {
  .gm-dash-hello { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

.gm-balance-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .75rem;
  padding: 1.25rem; border-radius: var(--gm-radius-lg);
  background: linear-gradient(135deg, #7c3aed 0%, #9f67ff 55%, #a855f7 100%); color: #fff;
  box-shadow: 0 18px 40px -18px rgba(124,58,237,.7);
}
.gm-balance-card__label { font-size: 14px; font-weight: 600; opacity: .85; }
.gm-balance-card__amount { font-size: clamp(30px, 9vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; overflow-wrap: anywhere; }
.gm-balance-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: auto; }
.gm-balance-card__actions .btn { border-radius: 999px; font-weight: 700; }
.gm-balance-card__actions .btn-light { color: #3b0d8c; }
.gm-btn-on-accent { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.gm-btn-on-accent:hover, .gm-btn-on-accent:focus-visible { background: rgba(255,255,255,.28); color: #fff; }

.gm-stat-tile {
  display: flex; flex-direction: column; gap: .15rem; height: 100%; min-height: 96px;
  padding: 1rem; border-radius: var(--gm-radius);
  background: var(--gm-surface); border: 1px solid var(--gm-border);
  color: var(--gm-text); text-decoration: none; transition: border-color .15s ease, background .15s ease;
}
.gm-stat-tile:hover, .gm-stat-tile:focus-visible { color: var(--gm-text); background: var(--gm-surface-2); border-color: rgba(255,255,255,.16); }
.gm-stat-tile--danger { border-color: rgba(255,138,128,.35); }
.gm-stat-tile__label { font-size: 13px; color: var(--gm-muted); }
.gm-stat-tile__value { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.gm-stat-tile__hint { font-size: 12px; color: var(--gm-muted); }

/* Lista de servicios del panel: filas compactas en móvil */
@media (max-width: 767.98px) {
  .apple-bento-theme .bento-card { padding: 1rem !important; }
  .services-main-card .services-actions { width: 100%; }
  .services-main-card .services-actions .search-glass { flex: 1 1 auto; min-width: 0; }
  .services-main-card .services-actions .form-control { width: 100%; }
  .service-row-item .service-expiry-container { min-width: 0 !important; width: 100%; }
  .service-row-item .service-action { width: 100% !important; }
  .service-row-item .btn-manage { width: 100%; justify-content: center; }
  .service-row-item .service-identity { min-width: 0 !important; }
}

/* Menú lateral del panel: oculto de verdad cuando está cerrado (no recibe foco) */
@media (max-width: 991.98px) {
  .apple-sidebar { visibility: hidden; transition: transform .3s cubic-bezier(.16,1,.3,1), visibility 0s linear .3s !important; }
  .apple-sidebar.open { visibility: visible; transition: transform .3s cubic-bezier(.16,1,.3,1), visibility 0s !important; }
}

/* ---------- Autenticación ---------- */
.toggle-password, #toggle-password { min-width: var(--gm-touch); min-height: var(--gm-touch); display: inline-flex; align-items: center; justify-content: center; }
.gm-auth .form-check { min-height: var(--gm-touch); display: flex; align-items: center; gap: .5rem; }
.gm-auth .form-check-input { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; }

/* Panel: ajustes de rejilla */
.gm-balance-card .btn-light { background: #fff; border-color: #fff; color: #3b0d8c; }
.gm-balance-card .btn-light:hover, .gm-balance-card .btn-light:focus-visible { background: #f1eaff; border-color: #f1eaff; color: #3b0d8c; }
@media (min-width: 768px) {
  .gm-balance-card { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 1.5rem 1.75rem; }
  .gm-balance-card__label { flex: 1 0 100%; }
  .gm-balance-card__actions { margin-top: 0; min-width: 280px; }
  .gm-dash-side { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
}
@media (min-width: 1400px) { .gm-dash-side { display: flex !important; } }
.services-main-card .services-actions { flex-wrap: wrap; }
@media (max-width: 575.98px) { .services-main-card .services-actions .search-glass { flex: 1 1 100%; } }
.services-main-card .service-identity { min-width: 0 !important; }

/* ---------- Cabecera de sección reutilizable ---------- */
.gm-section-head { display: flex; flex-direction: column; gap: 1rem; margin: .5rem 0 1.25rem; }
.gm-section-head__eyebrow { margin: 0 0 .25rem; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gm-accent-hover); }
.gm-section-head__title { margin: 0; font-size: clamp(30px, 8vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.gm-section-head__sub { margin: .35rem 0 0; color: var(--gm-muted); font-size: 15px; max-width: 60ch; }
.gm-section-head__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.gm-section-head__actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 999px; }
@media (min-width: 768px) {
  .gm-section-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .gm-section-head__actions { display: flex; flex-wrap: wrap; }
}

/* ---------- Servicios (mod_order_list) ---------- */
.gm-service-list { list-style: none; margin: 0 0 1.5rem; padding: 0; border-radius: var(--gm-radius-lg); background: var(--gm-surface); border: 1px solid var(--gm-border); overflow: hidden; }
.gm-service-list > li + li { border-top: 1px solid var(--gm-border); }
.gm-service-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 16px; align-items: center; gap: .75rem;
  min-height: 72px; padding: .85rem 1rem; color: var(--gm-text); text-decoration: none; transition: background .15s ease;
}
.gm-service-row:hover, .gm-service-row:focus-visible { background: var(--gm-surface-2); color: var(--gm-text); }
.gm-service-row__icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(124,58,237,.16); color: #c4b5fd; font-size: 1.15rem; }
.gm-service-row__main { display: flex; flex-direction: column; min-width: 0; }
.gm-service-row__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-service-row__meta { font-size: 13px; color: var(--gm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-service-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.gm-service-row__price { font-size: 14px; font-weight: 600; white-space: nowrap; }
.gm-service-row__chev { color: var(--gm-muted); font-size: 12px; }
.gm-services .empty { padding: 3rem 1rem; border-radius: var(--gm-radius-lg); background: var(--gm-surface); border: 1px solid var(--gm-border); }

/* ---------- Mercado (mod_order_index) ---------- */
.order-catalog .tmh-tab-btn { min-height: var(--gm-touch); white-space: nowrap; padding: 8px 16px; font-size: 14px; }
.order-catalog .tmh-btn-cart { min-height: var(--gm-touch); }
.order-catalog .tmh-product-img-giant { aspect-ratio: 1 / 1; height: 125px; width: 125px; max-width: 88%; object-fit: contain; }
.gm-product-media__name { position: relative; z-index: 2; display: block; margin-top: .5rem; font-size: 13px; font-weight: 600; color: var(--gm-muted); text-align: center; }
.order-catalog .tmh-product-showcase:has(.gm-product-media__name) { flex-direction: column; }

@media (max-width: 767.98px) {
  .order-catalog .tmh-order-container h1.page-title { font-size: 1.85rem !important; }
  .order-catalog .tmh-order-container .mb-5 { margin-bottom: 2rem !important; }
  /* Pestañas de categoría en una sola fila con desplazamiento */
  .order-catalog .tmh-catalog-filters {
    flex-wrap: nowrap !important; overflow-x: auto; width: calc(100% + 2rem); margin: 0 -1rem; padding: 2px 1rem 6px;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .order-catalog .tmh-catalog-filters::-webkit-scrollbar { display: none; }
  .order-catalog .tmh-tab-btn { scroll-snap-align: start; flex: 0 0 auto; }

  /* Tarjeta compacta: miniatura 1:1 a la izquierda, nombre y precio a la derecha */
  .order-catalog .tmh-card { padding: 1rem !important; }
  .order-catalog .tmh-card > .d-flex.flex-column {
    display: grid !important; grid-template-columns: 96px minmax(0, 1fr); column-gap: .9rem;
    grid-template-areas: "badges badges" "img title" "img price" "lead lead" "desc desc"; align-items: start;
  }
  .order-catalog .tmh-card > .d-flex.flex-column > :first-child { grid-area: badges; margin-bottom: .75rem !important; flex-wrap: wrap; gap: .35rem; }
  .order-catalog .tmh-card .tmh-product-showcase { grid-area: img; width: 96px; height: auto; aspect-ratio: 1 / 1; margin: 0 !important; border-radius: 14px; }
  .order-catalog .tmh-card .tmh-product-glow { width: 80px; height: 80px; }
  .order-catalog .tmh-card .tmh-product-img-giant { width: 72px; height: 72px; max-height: none; }
  .order-catalog .tmh-card .gm-product-media__name { display: none; }
  .order-catalog .tmh-card > .d-flex.flex-column > h3 { grid-area: title; font-size: 1.1rem !important; margin: 0 0 .35rem !important; align-self: end; }
  .order-catalog .tmh-card .tmh-pricing-box { grid-area: price; margin: 0 !important; padding: .5rem .75rem !important; }
  .order-catalog .tmh-card .tmh-price-amount { font-size: 1.3rem !important; }
  .order-catalog .tmh-card > .d-flex.flex-column > p { grid-area: lead; margin: .75rem 0 0 !important; }
  .order-catalog .tmh-card > .d-flex.flex-column > ul,
  .order-catalog .tmh-card .tmh-product-desc { grid-area: desc; margin: .9rem 0 .75rem !important; }
  .order-catalog .tmh-card > .d-flex.flex-column > ul { gap: .35rem !important; }
  .order-catalog .tmh-product-desc ul { gap: 4px; }
  .order-catalog .tmh-product-desc li { font-size: 13px; }
  .order-catalog .tmh-card .btn { padding-top: .75rem !important; padding-bottom: .75rem !important; }
}

/* ---------- Correcciones táctiles puntuales ---------- */
.gm-touch-min { min-width: var(--gm-touch); min-height: var(--gm-touch); }
.island-change-plan { display: inline-flex; align-items: center; min-height: var(--gm-touch); padding: 0 .5rem; }
.btn-cart { min-height: var(--gm-touch); }
.account-radio { width: 22px !important; height: 22px !important; }
.gm-announcement__cta { min-height: var(--gm-touch); display: inline-flex; align-items: center; }
label.form-check:has(.account-radio) { min-height: var(--gm-touch); padding-top: .5rem; padding-bottom: .5rem; }
.apple-checkbox-group { display: flex; align-items: flex-start; gap: .6rem; }
.apple-checkbox-group input[type=checkbox] { width: 22px; height: 22px; flex: 0 0 22px; margin-top: .6rem; }
.apple-checkbox-group label { display: block; padding: .55rem 0; min-height: var(--gm-touch); }
.gm-auth .auth-links a, .gm-auth .forgot-link { display: inline-flex; align-items: center; min-height: var(--gm-touch); }
.gm-auth a:has(> img) { display: inline-block; }
.gm-auth a[href$="password-reset"] { display: inline-flex; align-items: center; min-height: var(--gm-touch); }

/* ---------- Productos (mod_product_index) ---------- */
.product-media.gm-product-media { border-radius: 0; }
.product-media.gm-product-media img { object-fit: contain; padding: 18%; image-rendering: pixelated; }
.gm-product-media__placeholder { flex-direction: column; gap: .5rem; color: var(--gm-muted); text-align: center; font-weight: 600; }
.gm-product-media__placeholder .bi { font-size: 2rem; }
/* Enlaces dentro de texto en autenticación: área táctil de 44px sin mover el diseño */
.apple-checkbox-group label a { display: inline-block; padding: 14px 0; margin: -14px 0; }
.gm-auth a[href$="/login"], .gm-auth a[href$="login"] { display: inline-flex; align-items: center; min-height: var(--gm-touch); }
.gm-dash-topbar .gm-brand { min-width: var(--gm-touch); min-height: var(--gm-touch); display: inline-flex; align-items: center; }
