/* ------------------------ ESTILOS BASE (DESKTOP) ------------------------ */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #222;
    color: white;
    padding: 1rem;
    text-align: center;
}

.logo {
    max-width: 30%;
    height: auto;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
}

main {
    padding: 2rem;
}

form {
    margin-bottom: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 5px;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
select,
.btn-primary {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    /* height: 38px; */
    font-size: 16px;
    margin: 0;
}

button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
}

button:hover {
    background-color: #218838;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
}

a {
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    padding-right: 2rem;
}

.input-error {
    border: 1px solid red;
    background-color: #ffe6e6;
}

.payment-method-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.payment-method-group select {
    flex: 2;
}

.payment-method-group input {
    flex: 1;
}

.propina-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.propina-row input[type="number"],
.propina-row input[type="text"],
.propina-row .btn-primary {
    flex: 1;
    margin: 0;
    width: calc(33.333% - 0.667rem);
    height: 38px;
}

.propina-row .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0 1rem;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input:disabled,
input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    font-weight: bold;
    position: relative;
    min-height: auto;
    line-height: 1.4;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 2;
    width: 1rem;
    height: 1rem;
    padding: 0;
    background-size: 1rem;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    background-color: transparent;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.alert-dismissible .btn-close:hover {
    opacity: 0.75;
}

.alert-dismissible .btn-close:focus {
    opacity: 1;
    outline: none;
}

.text-center {
    text-align: center !important;
}

.m-0 {
    margin: 0 !important;
}

.rounded-0 {
    border-radius: 0 !important;
}

.text-center th,
.text-center td {
    text-align: center;
    vertical-align: middle;
}


.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
  cursor: pointer;
}

.checkbox-text {
  font-family: Arial, system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  color: #333;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #28a745;
}

.checkbox-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex: 1 1 300px;
  min-width: 220px;
}

.checkbox-left {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.checkbox-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}


.btn-check {
    display: none;
}

.btn {
    padding: 0.5rem;
    border: 1px solid #ccc;
    color: black;
    background-color: white;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    display: block;
}

.btn.full-width {
    width: 100%;
}

.btn-check:checked + .btn {
    background-color: black;
    color: white;
}

.table .btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.table .btn-danger:hover {
    background-color: #c82333;
}

.table td form {
    margin: 0;
}

.table td, .table th {
    padding: 0.5rem;
    vertical-align: middle;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    line-height: 1;
}

td.borrar-pago {
    text-align: center;
    padding: 0.5rem;
    background-color: transparent !important;
}

td.borrar-pago form {
    margin: 0;
    display: inline-block;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none !important;
    box-shadow: none !important;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.btn-danger:hover {
    background-color: #c82333;
}

th.borrar-pago, td.borrar-pago {
    width: 80px;
}

.btn-primary {
    background-color: #28a745;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    border: 1px solid #28a745;
}

.btn-primary:hover {
    background-color: #218838;
    border-color: #218838;
}

.addProductBtn, .removeProductBtn {
    margin: 0;
}

.productRow {
    margin-bottom: 1rem;
}

.productRow > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.productRow .productSelect {
    flex: 2;
}

.productRow .productCant,
.productRow .productPrice {
    width: 100px !important;
    flex: none;
}

.productRow .btn-primary {
    width: 38px;
    padding: 0;
}

.h2, h2 {
    text-align: center;
    font-size: 2rem;
}

.iconBtn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #28a745;
    cursor: pointer;
}

.iconBtn:hover {
    color: #218838;
}

#toggleContainer {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#toggleContainer > div {
    flex: 1;
}

.payment-method-container {
    position: relative;
    margin-bottom: 1rem;
    min-height: 38px;
    transition: min-height 0.3s ease;
}

.payment-method-container.multiple {
    min-height: 90px;
}

.btn {
    padding: 0.5rem;
    border: 1px solid #ccc;
    color: black;
    background-color: white;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    display: block;
}

.btn.full-width {
    width: 100%;
}

.btn-check {
    display: none;
}

.btn-check:checked + .btn {
    background-color: black;
    color: white;
}

.form-row-flex {
    display: flex;
    align-items: center;
    justify-content: space-between; /* importante para forzar separación */
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.form-row-flex > label {
    margin: 0;
    white-space: nowrap;
    min-width: 150px; 
    display: flex;
    align-items: center;
    height: 38px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
}

.checkbox-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#method + .checkbox-left {
    margin-left: 1rem;
}

/* New rule for centering checkboxes in the payment methods section */
.form-group.payment-methods .checkbox-group {
    justify-content: space-between; 
    flex: 1; 
}

/* "Usa Membresía?" checkbox (left side) */
.form-group.payment-methods .checkbox-left {
    margin-left: 30px; 
}

/* "Usa múltiples métodos?" checkbox (right side) */
.form-group.payment-methods .checkbox-right {
    justify-content: flex-end; 
    flex: none; 
    width: 180px; 
}

.centrado {
    text-align: center;
    font-size: 0.9rem
}

td.borrar-pago {
    padding: 0.1; 
}

td.borrar-pago form {
    margin: 0;
    padding: 0;
    display: inline-block;
}

td.borrar-pago button.btn-danger {
    width: auto;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.productCant-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.addProductBtn,
.removeProductBtn {
    width: 38px;
    padding: 0;
}

.linea-inferior {
  border-bottom: 1px solid #ccc;
  margin: 0.5rem 0 1rem 0;
}

/* ------------------------ ESTILOS RESPONSIVE (MOBILE) ------------------------ */

@media (max-width: 768px) {

    .logo {
        max-width: 50%;
    }

    header {
        padding: 0.3rem;
    }

    nav a {
        font-size: 0.95rem;
    }

    main {
        padding: 0.5rem;
    }

    form {
        padding: 0.5rem;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 0.5rem;
    }

    label {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }

    input[type="text"],
    input[type="number"],
    select,
    .btn-primary {
        font-size: 0.95rem;
        height: 30px;
        padding: 0.3rem;
    }

    button, .btn-primary {
        font-size: 0.95rem;
        padding: 0.3rem 0.5rem;
        height: 32px;
    }

    .form-row-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.0rem;
    }

    .checkbox-group {
        gap: 0.3rem;
    }

    .propina-row {
        flex-direction: column;
        gap: 0.3rem;
        margin-bottom: 1rem;
    }

    .propina-row input[type="number"],
    .propina-row input[type="text"],
    .propina-row .btn-primary {
        width: 100%;
        height: 30px;
        font-size: 0.95rem;
    }

    .productRow > div {
        flex-direction: column;
        gap: 0.3rem;
    }

    .productRow .productCant,
    .productRow .productPrice,
    .productRow .productSelect {
        width: 100% !important;
        flex: 1;
        height: 30px;
        font-size: 0.95rem;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .table td, .table th {
        padding: 0.15rem;
        font-size: 0.95rem;
    }

    .checkbox-label {
        justify-content: flex-start;
        font-size: 0.95rem;
    }

    .h2, h2 {
        text-align: center;
        font-size: 0.95rem;
    }

    /* Estilos específicos para los grupos de checkbox en mobile */
    .checkbox-group.servicio-precio,
    .checkbox-group.metodo-pago {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.3rem;
    }

    .checkbox-group.servicio-precio .checkbox-left,
    .checkbox-group.servicio-precio .checkbox-right,
    .checkbox-group.metodo-pago .checkbox-left,
    .checkbox-group.metodo-pago .checkbox-right {
        width: 100%;
        justify-content: flex-start;
    }

    .checkbox-group.servicio-precio .checkbox-label,
    .checkbox-group.metodo-pago .checkbox-label {
        width: 100%;
        justify-content: flex-start;
        gap: 0.2rem;
    }

    .form-group.payment-methods .checkbox-group {
        justify-content: flex-start;
    }

    .form-group.payment-methods .checkbox-left {
        margin-left: 0;
    }

    .form-group.payment-methods .checkbox-right {
        width: 100%;
    }

    .productCant-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
        gap: 0.3rem;
    }

    .productCant-container .productCant {
        flex-grow: 1;
        width: auto;
        min-width: 70px;
        height: 30px;
        font-size: 0.95rem;
    }

    .addProductBtn,
    .removeProductBtn {
        width: 30px;
        height: 30px;
        padding: 0;
        flex-shrink: 0;
        font-size: 1rem;
    }

    .productCant-container .productPrice {
        flex-basis: 100%;
        order: 1;
        height: 30px;
        font-size: 0.95rem;
    }

    .btn,
    .btn.full-width {
        padding: 0.2rem 0.3rem;
        font-size: 0.9rem;
        height: 28px;
        min-width: 60px;
    }

    #toggleContainer {
        gap: 0.5rem;
    }

    #toggleContainer > div {
        margin: 0;
        padding: 0;
    }

    /* Estilos específicos para alertas en móviles */
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .alert-dismissible .btn-close {
        width: 0.875rem;
        height: 0.875rem;
        background-size: 0.875rem;
        right: 0.75rem;
    }

}

.btn-edit {
  background-color: transparent;
  /* border: 2px solid #1B1E3C; */
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  color: #1B1E3C;
  transition: all 0.2s ease;
}

.btn-edit:hover {
  background-color: #00A0DD;        /* azul institucional */
  color: #fff;                      /* texto blanco */
  border-color: #1B1E3C;            
  transform: scale(1.05);           /* efecto sutil */
}

.btn-edit:active {
  transform: scale(0.97);
  background-color: #0088b8;
}

.table td form {
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  display: inline-block;
}
