/**
 * Estilos para RgMundoRepuestos - Frontend
 */

.rgmundorepuestos-catalog .table-responsive {
    margin-bottom: 1.5rem;
}

.rgmundorepuestos-catalog .price-cell input,
.rgmundorepuestos-catalog .stock-cell input {
    width: 100px;
    margin: 0 auto;
}

.rgmundorepuestos-catalog .edit-product,
.rgmundorepuestos-catalog .save-product,
.rgmundorepuestos-catalog .cancel-product {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.rgmundorepuestos-catalog .edit-product .fa,
.rgmundorepuestos-catalog .save-product .fa,
.rgmundorepuestos-catalog .cancel-product .fa {
    font-size: 14px;
}

.rgmundorepuestos-catalog .actions-cell {
    white-space: nowrap;
}

.rgmundorepuestos-catalog .catalog-filters {
    background: #fff !important;
    border-radius: 25px !important;
    padding: 25px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.10) !important;
    margin-bottom: 1.5rem;
}


/* =============================
   Filtros catálogo - mobile
============================= */

@media (max-width: 767px) {

    .rgmundorepuestos-catalog .stock-cell input, .rgmundorepuestos-catalog .price-cell input {
    width: 24rem;
    margin: 0.5rem;
}
 .catalog-card-row .stock-input,
    .catalog-card-row .price-input {
        padding: 8px 12px;
        border-radius: 20px;
    }

    .rgmundorepuestos-catalog .catalog-filters {
         background: none !important;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.10) !important;
        padding: 0px !important;
          margin-bottom: 0rem;
    }
    .catalog-filters .row > [class^="col-"] {
        margin-bottom: 12px; /* separa inputs */
    }


    .catalog-filters .form-control {
        height: 44px; /* más táctil */
        border-radius: 22px;
    }

    .catalog-filters .col-md-3 .btn {
        width: 100% !important;
        white-space: nowrap;
    }

    .catalog-filters button[type="submit"] {
        width: 100%;
        height: 44px;
        border-radius: 22px;
        font-weight: 600;
    }
}


.rgmundorepuestos-catalog .btn-primary {
    transition: all 0.3s ease;
}

.rgmundorepuestos-catalog .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Estilos para Cotizaciones */
.rgmr-cotizaciones-container {
    
    margin: 0 auto;
    padding: 10px;
}

.cotizacion-card {
    background: #fff;
    border: 1px solid #E9E9E9;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.cotizacion-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.cotizacion-header h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.cotizacion-dates {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
}

.cotizacion-summary {
   background-color: #EBEBEB;
    padding: 2px 20px;
    font-size: 14px;
    border-radius: 20px;
    color: var(--primary-hover);

    display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;


}

.cotizacion-chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
}

/* Estado activo */
.cotizacion-summary.is-active .cotizacion-chevron {
  transform: rotate(180deg);
}

/* Ejemplo visual de activo */
.cotizacion-summary.is-active {
  color: #ffffff; /* o lo que quieras */
  background-color: var(--primary-hover);
}



.cotizacion-summary p {
    margin: 5px 0;
}



.products-table table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.products-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
}

.products-table td {
    padding-bottom: 14px;
    padding-top: 14px;
    border-bottom: 1px solid #e9ecef;
}

.products-table tbody tr:hover {
    background: #f8f9fa;
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

.product-image {
    width: 60px;
    text-align: center;
}

.product-image img {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
}

.cotizacion-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 0px;
    padding-top: 0px;
}

.cotizacion-actions .badge {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
}

.cotizacion-actions .bg-success {
    background-color: #28a745 !important;
    color: white;
}

.cotizacion-actions .btn-confirmar {
    flex: 1;
    font-size: 16px;
    padding: 10px 14px !important;
    border-radius: 16px !important;
    background-color: var(--primary-hover) !important;
}

.cotizacion-actions .btn-eliminar, .btn-remove-product {
    background: #D81818 !important;
    border-radius: 16px;
    padding: 10px 14px;
}
.btn-remove-product {
    padding: 8px 14px !important;
}

.cotizacion-actions .btn-eliminar:hover {
    background: #D81818;
}

.products-table .text-end {
    text-align: right;
}

.products-table .text-center {
    text-align: center;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quantity-control .btn-quantity-minus,
.quantity-control .btn-quantity-plus {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.quantity-control .btn-quantity-minus:hover,
.quantity-control .btn-quantity-plus:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
}

.quantity-control .quantity-input {
    width: 70px;
    height: 32px;
    padding: 4px 8px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
}

.quantity-control .quantity-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-remove-product {
    transition: all 0.2s ease;
}

.btn-remove-product:hover {
    transform: scale(1.1);
}

.cotizacion-total {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: right;
}

.cotizacion-total h4 {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
}
h3.cotizacion-title {
    font-size: 16px;
    color: var(--primary-color) !important;
    letter-spacing: inherit;
    
}
.cotizacion-date {
    font-size: 14px;
    color: var(--primary-color) !important;
}
.cotizacion-card .total-amount {
    color: var(--primary-hover) !important;
    font-weight: bold;
    font-size: 20px;
}

/* Estilos para Direcciones */
.rgmr-addresses-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.address-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.address-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.address-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.address-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-header .badge {
    font-size: 0.85rem;
    padding: 6px 12px;
}

.address-body {
    margin-bottom: 15px;
}

.address-body p {
    margin: 8px 0;
    color: #555;
    line-height: 1.5;
}

.address-body p strong {
    color: #333;
}

.address-body .coordinates {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.address-body .material-icons {
    font-size: 18px;
    vertical-align: middle;
}

.address-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.address-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.address-actions .material-icons {
    font-size: 16px;
}

.addresses-add-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.addresses-add-section .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.addresses-add-section .alert {
    flex: 1 1 100%;
    margin: 0;
}

#rgmr-map {
    width: 100%;
    height: 400px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.rgmr-map-controls {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rgmr-map-controls .btn {
    margin-right: 10px;
}

.rgmr-coordinates-display {
    margin-top: 10px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
    font-family: monospace;
}

.rgmr-coordinates-display strong {
    color: #333;
}

.rgmr-coordinates-display span {
    color: #0056b3;
    font-weight: 500;
}

@media (max-width: 768px) {
    .addresses-grid {
        grid-template-columns: 1fr;
    }
    
    .addresses-add-section {
        flex-direction: column;
    }
    
    .addresses-add-section .btn {
        width: 100%;
        justify-content: center;
    }
    
    #rgmr-map {
        height: 300px;
    }
}

#checkout .address-item .address-footer,
#checkout .address-selector a[data-link-action="edit-address"],
#checkout .address-selector a[data-link-action="delete-address"],
#checkout .address-selector .not-selected,
#checkout .add-address,
#checkout a[data-link-action="different-invoice-address"] {
    display: none !important;
}

/* Estilos para modales */
#modalNombreCotizacion .modal-content,
#modalEditarNombre .modal-content,
#modalConfirmarCotizacion .modal-content,
#modalEliminarCotizacion .modal-content,
#modalEliminarProducto .modal-content,
#modalNuevaCotizacion .modal-content,
#exportModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#modalNombreCotizacion .modal-header,
#modalEditarNombre .modal-header,
#modalConfirmarCotizacion .modal-header,
#modalEliminarCotizacion .modal-header,
#modalEliminarProducto .modal-header,
#modalNuevaCotizacion .modal-header,
#exportModal .modal-header {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    border-bottom: 1px solid #dee2e6;
}

#modalNombreCotizacion .modal-footer,
#modalEditarNombre .modal-footer,
#modalConfirmarCotizacion .modal-footer,
#modalEliminarCotizacion .modal-footer,
#modalEliminarProducto .modal-footer,
#modalNuevaCotizacion .modal-footer,
#exportModal .modal-footer {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    border-top: 1px solid #dee2e6;
}
.rgmr-pedidos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.orders-list .order-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.order-header h4 {
    margin: 0;
}

.order-header h4 a {
    color: #333;
    text-decoration: none;
}

.order-header h4 a:hover {
    color: #007bff;
}

.order-date {
    font-size: 0.9em;
    color: #666;
}

.order-status .badge {
    padding: 5px 12px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
}

.order-details {
    margin-bottom: 15px;
    padding: 10px 0;
}

.order-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #205B90;
}

.order-actions {
    text-align: right;
}

.order-detail-view .box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.order-detail-view h5 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
}

.order-info-box,
.order-history,
.order-products,
.order-totals,
.address-box {
    margin-bottom: 20px;
}

.order-products table {
    width: 100%;
}

.order-products .product-image img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
}

.order-totals table {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .rgmr-pedidos-container {
        padding: 10px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-actions {
        text-align: left;
        width: 100%;
    }
    
    .order-actions .btn {
        width: 100%;
    }
}

.pagination-wrapper {
    margin-top: 30px;
    margin-bottom: 20px;
}

.pagination-wrapper .pagination {
    margin-bottom: 10px;
}

.pagination-wrapper .page-link {
    color: #007bff;
    border-color: #dee2e6;
}

.pagination-wrapper .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.pagination-wrapper .page-link:hover {
    background-color: #e9ecef;
}

.pagination-info {
    font-size: 0.9em;
}
.filters-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.filters-box .form-label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.filters-box .form-control,
.filters-box .form-select {
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.filters-box .form-control:focus,
.filters-box .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filters-box .btn {
    min-width: 120px;
    font-weight: 500;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    white-space: nowrap;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filters-box .btn i {
    margin-right: 5px;
}

.filters-box .gap-2 {
    gap: 0.5rem !important;
}

.orders-table-wrapper {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.orders-table {
    margin-bottom: 0;
}

.orders-table thead {
    background-color: #f8f9fa;
}

.orders-table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 12px;
    vertical-align: middle;
}

.orders-table tbody td {
    padding: 12px;
    vertical-align: middle;
}

.orders-table tbody tr:hover {
    background-color: #f8f9fa;
}

.orders-table .badge {
    display: inline-block;
    padding: 5px 10px;
    font-size: 0.875rem;
    border-radius: 4px;
}

.orders-table .btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .filters-box .col-md-3 {
        margin-bottom: 15px;
    }
    
    .filters-box .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .filters-box .btn {
        width: 100%;
    }
    
    .orders-table-wrapper {
        overflow-x: auto;
    }
    
    .orders-table {
        min-width: 800px;
    }
}

/* =============================
   Alerta de pedidos duplicados
============================= */

.duplicate-orders-alert {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 25px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.10);
    display: flex;
    gap: 15px;
}

.duplicate-orders-alert .alert-icon {
    flex-shrink: 0;
    font-size: 24px;
    color: #856404;
}

.duplicate-orders-alert .alert-content {
    flex: 1;
}

.duplicate-orders-alert .alert-heading {
    color: #856404;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.duplicate-orders-alert p {
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.5;
}

.duplicate-orders-alert .duplicate-orders-list {
    margin-top: 12px;
    padding: 15px;
    background: #fff;
    border-radius: 15px;
    border-left: 3px solid #ffc107;
}

.duplicate-orders-alert .duplicate-orders-list strong {
    color: #495057;
    font-size: 0.95rem;
}

.duplicate-orders-alert .duplicate-orders-list ul {
    list-style: none;
    padding-left: 0;
}

.duplicate-orders-alert .duplicate-orders-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.duplicate-orders-alert .duplicate-orders-list li:last-child {
    border-bottom: none;
}

.duplicate-orders-alert .duplicate-order-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.duplicate-orders-alert .duplicate-order-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.duplicate-orders-alert .badge {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .duplicate-orders-alert {
        flex-direction: column;
        padding: 15px 20px;
        gap: 10px;
    }
    
    .duplicate-orders-alert .alert-icon {
        font-size: 20px;
    }
    
    .duplicate-orders-alert .alert-heading {
        font-size: 1rem;
    }
    
    .duplicate-orders-alert p {
        font-size: 0.9rem;
    }
}



/* Contenedor general */
.product-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Fila 1 */
.product-compact-top {
  display: flex;
  align-items: center;  /* centra verticalmente imagen e info */
  gap: 12px;
}

.product-compact-img {
  flex: 0 0 20%;
  max-width: 20%;
}

.product-compact-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.product-compact-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center; /* ← alineación vertical */
  min-height: 100%;    
}


.product-compact-name {
  font-weight: 600;
  line-height: 1.2;
  color: #3A3A3A;
}

.product-compact-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #6c757d;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-compact-sep {
  opacity: 0.6;
}

/* Fila 2 */
.product-compact-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-compact-price {
  font-weight: 700;
  white-space: nowrap;
  font-size: 20px;
  color: #3A3A3A;
}

.product-compact-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-compact-qty-static {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

/* Contenedor tipo "pastilla" */
.qty-pill {
  background: #e9ecef;
  border-radius: 16px;
  height: 36px;              /* ajustá a gusto */
  padding: 0 6px;
  gap: 6px;
  width: 110px;              /* ajustá a gusto */
}

.product-compact-img {
  flex: 0 0 20%;
  max-width: 20%;
  height: 54px;              /* ← alto máximo (ajustable) */
  border-radius: 16px;
  overflow: hidden;    
  border: 1px solid #D6D6D6;      /* ← clave para el recorte */
}

.product-compact-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;         /* ← modo cover */
  display: block;
}

.parent {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.child {
  display: flex;
  align-items: center;
}

/* Desktop: 2 columnas */
@media (min-width: 1024px) {

    .cotizacion-collapsible {
  order: 4;      /* lo manda al final */
  flex: 0 0 100%; /* ocupa toda la fila */
}


  .product-compact {
    flex-direction: row !important;
  }

  .product-compact-top {
        width: 75%;
    }

    .product-compact-bottom {
        width: 25%;
    }

    .product-compact-img {
    
    height: 100px;
}

.cotizacion-card {
    flex-direction: row !important;
    display: flex;
    align-items: center;
  flex-wrap: wrap; 
}



.header-cotizacion-card {
    width: 30%;
}

.price-card {
    width: 40%;
}
.cotizacion-actions {
    width: 30%;
    padding-left: 20px;
}
.cotizacion-summary {
    padding: 7px 30px;
}
}

.rg-cheapest-supplier-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.95rem;
}

.rg-cheapest-label {
    color: #6c757d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rg-cheapest-value {
    font-weight: 700;
    color: #173A58;
    font-size: 1rem;
}

.product-miniature .rg-cheapest-supplier-price {
    justify-content: center;
    margin-bottom: 4px;
}

.product-miniature-list .rg-cheapest-supplier-price {
    justify-content: flex-start;
}
