/* ProSandoval Client Area — todo con prefijo .psv-ca para no chocar con Blocksy */
.psv-ca {
  --psv-bg: #FFFAF2;
  --psv-ink: #212121;
  --psv-red: #EA2127;
  --psv-muted: #767676;
  --psv-line: rgba(33,33,33,.30);
  --psv-line-soft: rgba(33,33,33,.28);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--psv-ink);
  width: 100%;
}
.psv-ca, .psv-ca * { box-sizing: border-box; }

.psv-ca-panel {
  background: var(--psv-bg);
  border: 1.5px solid var(--psv-line);
  border-radius: 16px;
  padding: 22px;
  margin: 0 0 20px;
  box-shadow: none;
}

/* Cabecera */
.psv-ca-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.psv-ca-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.psv-ca-iconbox { width: 38px; height: 38px; min-width: 38px; border-radius: 10px; background: var(--psv-red); color: #fff; display: flex; align-items: center; justify-content: center; }
.psv-ca-iconbox svg { width: 20px; height: 20px; }
.psv-ca .psv-ca-title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.2; color: var(--psv-ink); }
.psv-ca .psv-ca-service-name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--psv-ink); word-break: break-word; }
.psv-ca .psv-ca-sub { margin: 2px 0 0; font-size: 13px; color: var(--psv-muted); }
.psv-ca .psv-ca-section-title { margin: 26px 0 14px; font-size: 17px; font-weight: 700; color: var(--psv-ink); }

/* Badge de estado */
.psv-ca-badge { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1.5px solid var(--psv-line); border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--psv-ink); white-space: nowrap; }
.psv-ca-dot { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.psv-ca-tone-ok .psv-ca-dot { background: #2ecc71; }
.psv-ca-tone-warn .psv-ca-dot { background: #f39c12; }
.psv-ca-tone-off .psv-ca-dot { background: #999; }
.psv-ca-tone-bad .psv-ca-dot { background: var(--psv-red); }

/* Cajas de datos */
.psv-ca-stats, .psv-ca-info { display: grid; gap: 14px; }
.psv-ca-stats { grid-template-columns: repeat(3, 1fr); }
.psv-ca-info { grid-template-columns: repeat(3, 1fr); }
.psv-ca-stat { display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid var(--psv-line-soft); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.psv-ca-stat-icon { width: 38px; height: 38px; min-width: 38px; border-radius: 10px; background: rgba(234,33,39,.10); color: var(--psv-red); display: flex; align-items: center; justify-content: center; }
.psv-ca-stat-icon svg { width: 20px; height: 20px; }
.psv-ca-stat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.psv-ca-label { font-size: 11px; color: var(--psv-muted); text-transform: uppercase; letter-spacing: .03em; }
.psv-ca-value { font-size: 20px; font-weight: 700; color: var(--psv-ink); line-height: 1.2; }
.psv-ca-value-sm { font-size: 15px; }
.psv-ca-value .woocommerce-Price-amount { font-weight: 700; }
.psv-ca-left-ok { color: #1e9e57; }
.psv-ca-left-warn { color: #d97706; }

/* Botones */
.psv-ca-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.psv-ca .psv-ca-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 700; line-height: 1.2; text-decoration: none !important; border: 1.5px solid var(--psv-ink); box-shadow: none !important; cursor: pointer; transition: background .15s ease, color .15s ease; }
.psv-ca .psv-ca-btn svg { width: 16px; height: 16px; }
.psv-ca .psv-ca-btn-primary { background: var(--psv-red); border-color: var(--psv-red); color: #fff !important; }
.psv-ca .psv-ca-btn-primary:hover { background: #c81a20; border-color: #c81a20; }
.psv-ca .psv-ca-btn-outline { background: #fff; color: var(--psv-ink) !important; }
.psv-ca .psv-ca-btn-outline:hover { background: var(--psv-ink); color: #fff !important; }

/* Lista de servicios */
.psv-ca-services { display: grid; grid-template-columns: 1fr; gap: 0; }
.psv-ca-service .psv-ca-actions { margin-top: 18px; }
.psv-ca-empty { color: var(--psv-muted); font-size: 15px; }
.psv-ca-anchor { display: block; scroll-margin-top: 90px; }

/* Encabezado oficial ProSandoval: Dark Premium Gradient con Red Glow
   (saludo del escritorio y cabecera del detalle de suscripción) */
.psv-ca .psv-ca-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(560px circle at 100% 100%, rgba(234,33,39,.42) 0%, rgba(234,33,39,.14) 38%, rgba(234,33,39,0) 68%),
    linear-gradient(135deg, #121212 0%, #212121 55%, #2b2b2b 100%);
  border: 1px solid rgba(255,255,255,.10);
  color: #FFFFFF;
}
.psv-ca .psv-ca-hero .psv-ca-title { color: #FFFFFF; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.psv-ca .psv-ca-hero .psv-ca-service-name { color: #FFFFFF; }
.psv-ca .psv-ca-hero .psv-ca-sub { color: rgba(255,250,242,.78); }
.psv-ca .psv-ca-hero .psv-ca-badge { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); color: #FFFFFF; }
.psv-ca .psv-ca-hero .psv-ca-stat { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
.psv-ca .psv-ca-hero .psv-ca-stat-icon { background: rgba(234,33,39,.20); color: var(--psv-red); }
.psv-ca .psv-ca-hero .psv-ca-label { color: rgba(255,250,242,.68); }
.psv-ca .psv-ca-hero .psv-ca-value,
.psv-ca .psv-ca-hero .psv-ca-value * { color: #FFFFFF; }
.psv-ca .psv-ca-hero .psv-ca-value.psv-ca-left-ok { color: #2ecc71; }
.psv-ca .psv-ca-hero .psv-ca-value.psv-ca-left-warn { color: #f39c12; }
.psv-ca .psv-ca-hero .psv-ca-btn-outline { background: #FFFFFF; border-color: #FFFFFF; color: #212121 !important; }
.psv-ca .psv-ca-hero .psv-ca-btn-outline:hover { background: var(--psv-red); border-color: var(--psv-red); color: #FFFFFF !important; }

/* Escritorio: tarjetas de resumen fuera del encabezado (fondo natural, tarjeta blanca, icono blanco sobre rojo) */
.psv-ca .psv-ca-stats-row { margin: 0 0 6px; }
.psv-ca .psv-ca-stats-row .psv-ca-stat { background: #FFFFFF; }
.psv-ca .psv-ca-stats-row .psv-ca-stat-icon { background: var(--psv-red); color: #FFFFFF; }

/* Enlace "Ver todas las suscripciones" */
.psv-ca-more { margin: -6px 0 20px; }
.psv-ca .psv-ca-link { font-size: 14px; font-weight: 700; color: var(--psv-ink); text-decoration: underline; text-underline-offset: 3px; }
.psv-ca .psv-ca-link:hover { color: var(--psv-red); }

/* Resumen: botones debajo de las cajas */
.psv-ca-summary .psv-ca-actions { margin-top: 18px; }


/* Botón pequeño */
.psv-ca .psv-ca-btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* Notas del servicio */
.psv-ca-notelist { display: flex; flex-direction: column; gap: 12px; }
.psv-ca-note { background: #fff; border: 1.5px solid var(--psv-line-soft); border-radius: 12px; padding: 14px 16px; }
.psv-ca-note .psv-ca-label { display: block; margin-bottom: 6px; }
.psv-ca .psv-ca-note-body { font-size: 14px; line-height: 1.55; color: var(--psv-ink); word-break: break-word; overflow-wrap: anywhere; }
.psv-ca .psv-ca-note-body p { margin: 0 0 8px; }
.psv-ca .psv-ca-note-body p:last-child { margin-bottom: 0; }
.psv-ca .psv-ca-note-body a { color: var(--psv-red); font-weight: 600; }

/* Pedidos y pagos como tarjetas */
.psv-ca-orders { display: flex; flex-direction: column; gap: 10px; }
.psv-ca-order { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1.5px solid var(--psv-line-soft); border-radius: 12px; padding: 14px 16px; }
.psv-ca-order-row { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.psv-ca-order-title { font-size: 15px; font-weight: 700; color: var(--psv-ink); }
.psv-ca-order-date { font-size: 13px; color: var(--psv-muted); }
.psv-ca-order-total { font-size: 15px; font-weight: 700; color: var(--psv-ink); }
.psv-ca-order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Direcciones */
.psv-ca-addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.psv-ca-addr { align-items: flex-start; }
.psv-ca-address-text { font-style: normal; font-size: 14px; line-height: 1.55; color: var(--psv-ink); margin-top: 4px; word-break: break-word; }

/* ---------------------------------------------------------------
   Pulido de lo nativo de WooCommerce Subscriptions (solo en el
   detalle de suscripción: body.psv-ca-sub-view)
   --------------------------------------------------------------- */
/* Tablas nativas (detalles y totales) como tarjetas: mismos datos y nombres oficiales de WooCommerce, solo estilo */
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table {
  display: block !important;
  width: 100% !important;
  background: #FFFAF2 !important;
  border: 1.5px solid rgba(33,33,33,.30) !important;
  border-radius: 16px !important;
  padding: 22px !important;
  margin: 0 0 20px !important;
  box-shadow: none !important;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table thead,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table tbody,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table tfoot {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table thead + tbody,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table tbody + tfoot,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table thead + tfoot { margin-top: 10px !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table tr {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  background: #fff !important;
  border: 1.5px solid rgba(33,33,33,.28) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  margin: 0 !important;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table th,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table td {
  display: block !important;
  width: auto !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0;
  text-align: left;
  color: #212121;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table th::before,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table td::before { content: none !important; display: none !important; }

/* Cabecera "Producto / Total": solo etiquetas, sin caja */
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table thead tr { background: transparent !important; border: 0 !important; padding: 0 4px !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table thead th { font-size: 11px; font-weight: 600; color: #767676; text-transform: uppercase; letter-spacing: .03em; }

/* Totales: producto a la izquierda, importes a la derecha */
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table:not(.subscription_details) tbody td:last-child,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table:not(.subscription_details) tfoot td { text-align: right; font-weight: 700; margin-left: auto; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table:not(.subscription_details) tfoot th { font-size: 13px; font-weight: 600; color: #767676; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table:not(.subscription_details) tfoot tr:last-child { background: #212121 !important; border-color: #212121 !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table:not(.subscription_details) tfoot tr:last-child th,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table:not(.subscription_details) tfoot tr:last-child td { color: #ffffff !important; font-size: 16px; }

/* Detalles de la suscripción: cuadrícula de datos (etiqueta pequeña + valor) */
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.subscription_details tbody {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.subscription_details tr {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.subscription_details tr > *:first-child { font-size: 11px; font-weight: 600; color: #767676; text-transform: uppercase; letter-spacing: .03em; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.subscription_details tr > *:last-child { font-size: 16px; font-weight: 700; color: #212121; text-align: left !important; word-break: break-word; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.subscription_details tr:last-child { grid-column: 1 / -1; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.subscription_details td a.button { margin: 4px 8px 4px 0; }

body.psv-ca-sub-view .woocommerce-MyAccount-content h2,
body.psv-ca-sub-view .woocommerce-MyAccount-content h3 {
  color: #212121;
}

/* Botones de acciones nativos (Cancelar, Cambiar método de pago, Renovar...) */
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native),
body.psv-ca-sub-view .woocommerce-MyAccount-content .button.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid #212121;
  background: #fff;
  color: #212121;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: none;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native):hover { background: #212121; color: #fff; }
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native).cancel { border-color: #ea2127; color: #ea2127; }
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native).cancel:hover { background: #ea2127; color: #fff; }
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native).pay,
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native).renew,
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native).resubscribe,
body.psv-ca-sub-view .woocommerce-MyAccount-content a.button:not(.psv-ca-native).subscription_renewal_early {
  background: #ea2127; border-color: #ea2127; color: #fff;
}

/* Las notas nativas ("Subscription updates") ya se muestran en la tarjeta "Notas del servicio" */
body.psv-ca-sub-view .woocommerce-MyAccount-content ol.commentlist.notes,
body.psv-ca-sub-view .woocommerce-MyAccount-content ol.woocommerce-OrderUpdates { display: none; }
body.psv-ca-sub-view .woocommerce-MyAccount-content h2:has(+ ol.commentlist.notes),
body.psv-ca-sub-view .woocommerce-MyAccount-content h2:has(+ ol.woocommerce-OrderUpdates) { display: none; }

/* Refuerzo: que el tema no pise las tarjetas de pedidos y facturación */
body.psv-ca-sub-view .psv-ca .psv-ca-orders,
body.psv-ca-sub-view .psv-ca .psv-ca-addresses {
  background: #FFFAF2 !important;
  border: 1.5px solid rgba(33,33,33,.30) !important;
  border-radius: 16px !important;
  padding: 22px !important;
  margin: 0 0 20px !important;
  box-shadow: none !important;
}
body.psv-ca-sub-view .psv-ca .psv-ca-orders { display: flex !important; flex-direction: column; gap: 10px; }
body.psv-ca-sub-view .psv-ca .psv-ca-addresses { display: grid !important; }
body.psv-ca-sub-view .psv-ca .psv-ca-order,
body.psv-ca-sub-view .psv-ca .psv-ca-addr {
  background: #fff !important;
  border: 1.5px solid rgba(33,33,33,.28) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  margin: 0 !important;
  box-shadow: none !important;
}
body.psv-ca-sub-view .psv-ca .psv-ca-order { display: flex !important; flex-direction: column !important; }
body.psv-ca-sub-view .psv-ca .psv-ca-addr { display: flex !important; }

/* Títulos de sección: mismo tamaño en los nativos de WooCommerce y en los nuestros */
body.psv-ca-sub-view .woocommerce-MyAccount-content h2:not([class]),
body.psv-ca-sub-view .woocommerce-MyAccount-content h3:not([class]),
body.psv-ca-sub-view .psv-ca .psv-ca-section-title {
  margin: 26px 0 14px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: #212121;
}

/* Pedidos y pagos: columnas alineadas (Pedido / Fecha / Estado / Total / botón); el botón es el del sitio */
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table thead tr,
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table tbody tr {
  display: grid !important;
  grid-template-columns: minmax(0,1.7fr) minmax(0,1.3fr) minmax(0,1fr) minmax(0,.9fr) 170px;
  align-items: center;
  gap: 12px;
}
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table thead tr { padding: 0 16px !important; border: 1.5px solid transparent !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td { font-size: 14px !important; font-weight: 400 !important; color: #212121 !important; text-align: left !important; margin: 0 !important; overflow-wrap: anywhere; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-title { font-size: 15px !important; font-weight: 700 !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-date { color: #767676 !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-total { font-weight: 700 !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table th:nth-child(4),
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-total { text-align: right !important; }
body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-actions { display: flex !important; justify-content: flex-end; gap: 8px; }

/* Móvil: tres líneas ordenadas por pedido */
@media (max-width: 700px) {
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table thead { display: none !important; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table tbody tr { grid-template-columns: minmax(0,1fr) auto; row-gap: 8px; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-title { grid-column: 1 / -1; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-date { grid-column: 1; grid-row: 2; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-total { grid-column: 2; grid-row: 2; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-status { grid-column: 1; grid-row: 3; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.psv-ca-orders-table td.psv-order-actions { grid-column: 2; grid-row: 3; }
}

/* Responsive */
@media (max-width: 900px) {
  .psv-ca-stats, .psv-ca-info { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .psv-ca-addresses { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body.psv-ca-sub-view .psv-ca .psv-ca-orders,
  body.psv-ca-sub-view .psv-ca .psv-ca-addresses { padding: 16px !important; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table { padding: 16px !important; }
  body.psv-ca-sub-view .woocommerce-MyAccount-content table.shop_table.subscription_details tbody { grid-template-columns: 1fr; }
  .psv-ca-panel { padding: 16px; }
  .psv-ca-stats, .psv-ca-info { grid-template-columns: 1fr; }
  .psv-ca .psv-ca-btn { width: 100%; }
}
