/*
 Theme Name:   Logistic Child
 Theme URI:    https://opelsacr.com
 Description:  Tema hijo de Logistic Business
 Author:       Oscar
 Author URI:   https://opelsacr.com
 Template:     logistic-business
 Version:      1.0.0
*/

/* Importa estilos del padre automáticamente */
@import url("../logistic-business/style.css");


/* Botones de Editar y Eliminar en Mis Envíos */
.mis-envios-actions {
    display: flex;
    gap: 10px; /* Espacio entre botones */
    margin-top: 8px;
}

.mis-envios-actions a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.mis-envios-actions a.edit {
    background-color: #0073aa; /* Azul */
    color: #fff;
}

.mis-envios-actions a.delete {
    background-color: #d63638; /* Rojo */
    color: #fff;
}




/* Mis envíos — móvil con encabezado por tarjeta */
.mis-envios-table { width:100%; border-collapse:separate; border-spacing:0; }
.mis-envios-table th, .mis-envios-table td { vertical-align:middle; }

.mis-envios-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.mis-envios-actions a { display:inline-block; padding:6px 12px; border-radius:5px; text-decoration:none; font-size:14px; font-weight:500; }
.mis-envios-actions a.edit { background:#0073aa; color:#fff; }
.mis-envios-actions a.delete { background:#d63638; color:#fff; }

/* Desktop: ocultamos el mini-encabezado por tarjeta */
@media (min-width:769px){
  .mis-card-head-row { display:none; }
}

/* Mobile: tarjetas + encabezado por tarjeta */
@media (max-width:768px){
  .mis-envios-table thead { display:none; }

  .mis-card-head-row { display:table-row; }
  .mis-card-head-row td {
    padding:8px 12px; background:#f8fafc; border:1px solid #e5e7eb; border-bottom:0;
    border-radius:8px 8px 0 0; font-weight:600; color:#374151;
  }
  .mis-card-head { display:flex; flex-wrap:wrap; gap:10px 16px; font-size:13px; }
  .mis-card-head span { display:inline-block; }

  .mis-data-row { display:block; border:1px solid #e5e7eb; border-top:0; border-radius:0 0 8px 8px; margin-bottom:14px; background:#fff; }
  .mis-data-row td { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border:0; border-bottom:1px solid #f1f5f9; }
  .mis-data-row td:last-child { border-bottom:0; }
  .mis-data-row td::before {
    content: attr(data-label);
    font-weight:600; color:#374151; margin-right:12px; text-align:left; flex:0 0 50%;
  }
  .mis-data-row td > *:not(.mis-envios-actions) { text-align:right; width:50%; }
  .mis-envios-actions { justify-content:flex-end; }
}




/* Mis envíos — mobile friendly y compatible con WooCommerce */
@media (max-width: 768px){

  /* Oculta el thead en móvil */
  .mis-envios-table thead { display: none !important; }

  /* Convierte filas en tarjetas */
  .mis-envios-table,
  .mis-envios-table tbody,
  .mis-envios-table tr,
  .mis-envios-table td {
    display: block !important;
    width: 100% !important;
  }

  .mis-envios-table tr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
  }

  .mis-envios-table td {
    position: relative;
    padding: 12px 14px 12px 46%;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
  }
  .mis-envios-table td:last-child { border-bottom: 0; }

  /* Sobrescribe el pseudo-elemento del theme y usa data-title */
  .mis-envios-table td::before {
    content: attr(data-title) !important; /* <- clave */
    position: absolute;
    left: 12px;
    top: 12px;
    width: 42%;
    font-weight: 600;
    color: #374151;
    text-align: left;
    white-space: normal;
  }

  /* Botones alineados en fila */
  .mis-envios-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .mis-envios-actions .button {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.2;
  }
}





/* Oculta el grid en endpoints y muéstralo solo en el dashboard */
.woocommerce-account .pp-dashboard-cards{display:none;}
.woocommerce-account.myaccount-dashboard .pp-dashboard-cards{display:block;}



/* 3 columnas en desktop */
.woocommerce-account .pp-dashboard-cards .cards-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:20px;
  align-items: stretch;
}

/* 2 columnas en tablet + mobile */
@media (max-width: 1024px){
  .woocommerce-account .pp-dashboard-cards .cards-grid{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

/* Ajustes opcionales para pantallas muy pequeñas sin romper las 2 cols */
@media (max-width: 420px){
  .woocommerce-account .pp-dashboard-cards .card{ padding:16px; }
  .woocommerce-account .pp-dashboard-cards .card h3{ font-size:15px; }
  .woocommerce-account .pp-dashboard-cards .card p{ font-size:13px; }
}

/* Asegura que cada tarjeta ocupe toda la altura disponible */
.woocommerce-account .pp-dashboard-cards .card{
  display:block;
  height:100%;
}



/* Dropdown desktop */
.opls-dropdown {
  position: relative;
}

.opls-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 8px 0;
  min-width: 220px;
  z-index: 1000;
}

.opls-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.opls-dropdown-menu a:hover {
  background: #f7f7f7;
  color: #e60000;
}

.opls-dropdown:hover .opls-dropdown-menu {
  display: block;
}

