/**
* 2007-2023 Weblir
*
*  @author    weblir <hello@weblir.com>
*  @copyright 2012-2023 weblir
*  @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*  International Registered Trademark & Property of weblir.com
*
*  You are allowed to modify this copy for your own use only. You must not redistribute it. License
*  is permitted for one Prestashop instance only but you can install it on your test instances.
*/

button.btn.btn-primary.whatsapp-order-button {
    display: block;
    margin: 15px auto;
}

#product button.btn.btn-primary.whatsapp-order-button {
    margin: 15px;
}

#order-on-whatsapp-form {
	width: auto;
	margin: 20px auto 40px auto;
	text-align: center;
	position: relative;
    max-width: 680px;
}

#OrderOnWhatsAppModal .modal-content {
    background-color: #fff;
}

#order-on-whatsapp-form label {
    margin: 0;
}

#order-on-whatsapp-form fieldset {
	background: white;
	border: 0 none;
	border-radius: 3px;
	box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
	padding: 20px 30px;
	box-sizing: border-box;
	width: 100%;
	max-width: 660px;
	margin: 0 auto 20px;
	
	/*stacking fieldsets above each other*/
	position: relative;
	transition: none;
}
/*Hide all except first fieldset*/
#order-on-whatsapp-form fieldset:not(:first-of-type) {
	display: none;
}
/*inputs*/
#order-on-whatsapp-form input, #order-on-whatsapp-form textarea {
	padding: 15px;
	border: 1px solid #ccc;
	border-radius: 3px;
	margin-top: 10px;
	width: 100%;
	box-sizing: border-box;
	font-family: montserrat;
	color: #2C3E50;
	font-size: 13px;
}
/*buttons*/
#order-on-whatsapp-form .action-button {
	width: auto;
	background: #27AE60;
	font-weight: bold;
	color: white;
	border: 0 none;
	border-radius: 1px;
	cursor: pointer;
	padding: 10px;
	margin: 10px 5px;
}
#order-on-whatsapp-form .action-button:hover,
#order-on-whatsapp-form .action-button:focus {
	box-shadow: 0 0 0 2px white, 0 0 0 3px #27AE60;
}

#order-on-whatsapp-form #progressbar li.active-step:after {
    background: #27AE60 !important;
    z-index: 99;
}

/*headings*/
#order-on-whatsapp-form .fs-title {
	font-size: 15px;
	text-transform: uppercase;
	color: #2C3E50;
	margin-bottom: 10px;
}
#order-on-whatsapp-form .fs-subtitle {
	font-weight: normal;
	font-size: 13px;
	color: #666;
	margin-bottom: 20px;
}
/*progressbar*/
#order-on-whatsapp-form #progressbar {
	overflow: hidden;
	/*CSS counters to number the steps*/
	counter-reset: step;
	max-width: 100%;
    width: 100%;
    margin: 0;
    position: sticky;
    top: 3.75rem; /* altura de la cabecera */
    z-index: 1054;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(3px);
    padding: .75rem 0 .35rem;
    min-height: 3.5rem;
    box-sizing: border-box;
}
#order-on-whatsapp-form #progressbar li {
	list-style-type: none;
	color: white;
	text-transform: uppercase;
	font-size: 9px;
	width: 25%; /* 4 pasos */
	float: left;
	position: relative;
}
#order-on-whatsapp-form #progressbar li:before {
	content: counter(step);
	counter-increment: step;
	width: 20px;
	line-height: 20px;
	display: block;
	font-size: 10px;
	color: #333;
	background: white;
	border-radius: 3px;
	margin: 0 auto 5px auto;
}
/*progressbar connectors*/
#order-on-whatsapp-form #progressbar li:after {
	content: '';
	width: 100%;
	height: 2px;
	background: white;
	position: absolute;
	left: -50%;
	top: 9px;
	z-index: -1; /*put it behind the numbers*/
}
#order-on-whatsapp-form #progressbar li:first-child:after {
	/*connector not needed before the first step*/
	content: none; 
}
/*marking active/completed steps green*/
/*The number of the step and the connector before it = green*/
#order-on-whatsapp-form #progressbar li.active:before, 
#order-on-whatsapp-form #progressbar li.active:after{
	background: #27AE60;
	color: white;
}

#order-on-whatsapp-form input.is-empty,
#order-on-whatsapp-form textarea.is-empty,
#order-on-whatsapp-form select.is-empty {
    border: 1px solid #e74c3c;
}

#order-on-whatsapp-form span.warning-message {
    color: #e74c3c;
    font-size: 10px;
    text-align: right;
    display: block;
}

.form-group {
    text-align: left;
}

.whatsapp-order-button {
    background-color: #25D366;
    padding: .5rem;
    margin-top: 15px;
}

.whatsapp-order-button:hover {
	background-color: #128C7E;
}

.whatsapp-ordered-products .badge-pill {
    float: right;
    border-radius: 15px;
    padding: 0;
    text-align: center;
    color: #fff;
    font-size: 12px;
    margin-top: -5px;
}

.whatsapp-ordered-products .oow-discount-value {
    font-weight: 600;
}

.whatsapp-ordered-products .badge-pill input#wa_product_qty {
    padding: 0;
    margin: 0;
    width: 40px;
    height: 30px;
    text-align: center;
}

/*#OrderOnWhatsAppModal .modal-header {
	display: none;
}*/

#order-confirmation-message {
    padding: 40px 20px;
    text-align: center;
    background: #eee;
}

#OrderOnWhatsAppModal .wa-loading:after {
  content: ' .';
  animation: dots 1s steps(5, end) infinite;}

@keyframes dots {
  0%, 20% {
    color: rgba(0,0,0,1);
    text-shadow:
      .25em 0 0 rgba(0,0,0,1),
      .5em 0 0 rgba(0,0,0,1);}
  40% {
    color: white;
    text-shadow:
      .25em 0 0 rgba(0,0,0,1),
      .5em 0 0 rgba(0,0,0,1);}
  60% {
    text-shadow:
      .25em 0 0 white,
      .5em 0 0 rgba(0,0,0,1);}
  80%, 100% {
    text-shadow:
      .25em 0 0 black,
      .5em 0 0 black;}}

#order-on-whatsapp-form .list-group li {
    color: #777;
}

#order-on-whatsapp-form .list-group li.active {
    color: #fff;
}

#OrderOnWhatsAppModal .modal-header{
    position: sticky;          /* se queda arriba dentro del modal           */
    top: 0;
    z-index: 1055;             /* mayor que los fieldsets escalados          */

    background: rgba(255,255,255,.90);  /* blanco 90 % de opacidad            */
    backdrop-filter: blur(3px);         /* ligero difuminado (opcional)       */

    display: flex !important;  /* por si existían reglas que lo ocultaban    */
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;

    border-bottom: 1px solid #dee2e6;   /* igual que Bootstrap standard       */
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    border-top-left-radius: .3rem;
    border-top-right-radius: .3rem;
}

/* añadimos algo de espacio al comienzo del body para que
   el primer fieldset no quede tapado cuando la cabecera es sticky 
#OrderOnWhatsAppModal .modal-body{

}*/

/* === Scroll interno y límites de altura para pantallas pequeñas (desktop/tablet) === */
#OrderOnWhatsAppModal .modal-content {
  max-height: calc(90vh);
  display: flex;
  flex-direction: column;
}
#OrderOnWhatsAppModal .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 2rem;
}

#OrderOnWhatsAppModal #delivery-calendar-container {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .08);
  max-height: 420px;
  overflow: auto;
  position: relative;
}

#OrderOnWhatsAppModal #myowndeliveries-calendar-placeholder {
  min-height: 260px;
  overflow: auto;
  padding-right: .5rem;
}

#OrderOnWhatsAppModal #myOwnReservationContent {
  width: 100%;
  overflow: auto;
}

#OrderOnWhatsAppModal #myOwnReservationContent table {
  width: 100%;
  min-width: 640px;
}

/* Si la altura de la pantalla es muy baja, refuerza el scroll interno */
@media (max-height: 740px) {
  #OrderOnWhatsAppModal .modal-content {
    max-height: 100vh;
  }
  #OrderOnWhatsAppModal .modal-body {
    max-height: calc(100vh - 4rem); /* descuenta cabecera sticky */
    overflow-y: auto;
  }
}

/* === Responsivo: fullscreen en móviles y scroll interno === */
@media (max-width: 576px) {
  #OrderOnWhatsAppModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
  }
  #OrderOnWhatsAppModal .modal-content {
    height: 100vh;
    border-radius: 0;
    background-color: #fff; /* en móvil mejor fondo sólido */
  }
  #OrderOnWhatsAppModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  #OrderOnWhatsAppModal .modal-body {
    padding: 1rem 1.25rem 1.75rem;
   /* padding-top: 5rem;  cabecera + progressbar */
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
  }
 /* #OrderOnWhatsAppModal #progressbar {
    top: 3.5rem;
  }*/
  /* inputs a 100% */
  #order-on-whatsapp-form input,
  #order-on-whatsapp-form textarea,
  #order-on-whatsapp-form select {
    width: 100%;
  }
  /* botones sticky al fondo en móvil */
  #OrderOnWhatsAppModal .action-button {
    width: 100%;
  }
  #custom-place-order-container-check {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: .75rem;
    border-top: 1px solid #eee;
  }
}

.modal-title{
	color: black;
}

/* ────────────────────────────────────────────────────────────────
 * BARRA DE PROGRESO “STICKY” CON FONDO SEMITRANSPARENTE
 * ──────────────────────────────────────────────────────────────── */
#OrderOnWhatsAppModal #progressbar{
    position: sticky;               /* se queda “pegada” bajo la cabecera   */
    top: 0;                  /* = altura de la cabecera (≈ 60 px)    */
    z-index: 1054;                  /* justo por debajo de la cabecera      */

    background: rgba(255,255,255,.90);
    backdrop-filter: blur(3px);     /* opcional, mismo estilo que header    */

    /* estética / espaciamiento */
    padding: .75rem 0 .5rem;
    margin: 0 auto 1.5rem;
    border-radius: .25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

/* al ser “pegajoso” conviene que la lista no se quede demasiado ancha  */
#OrderOnWhatsAppModal #progressbar li{
    font-weight: 600;
}
/* ────────────────────────────────────────────────────────────────
 *  PROGRESSBAR: texto negro, cuadros 1-2-3 fondo negro
 * ──────────────────────────────────────────────────────────────── */

/* Etiquetas "Address / Info / Confirm" en negro */
#OrderOnWhatsAppModal #progressbar li{
    color:#000 !important;          /* título debajo del cuadrado */
}

/* Cuadrados con los números 1-2-3 */
#OrderOnWhatsAppModal #progressbar li:before{
    background:#000;                /* fondo negro                */
    color:#fff;                     /* número en blanco           */
    border:none;
}

/* Paso activo sigue mostrándose en verde, para no perder la guía visual */
#OrderOnWhatsAppModal #progressbar li.active:before,
#OrderOnWhatsAppModal #progressbar li.active:after{
    background:#27AE60;
    color:#fff;
}

/* ────────────────────────────────────────────────────────────────
 *  ESTILOS PARA EL CALENDARIO DE ENTREGA
 * ──────────────────────────────────────────────────────────────── */

#delivery-calendar-container {
    min-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #f9f9f9;
}

#myowndeliveries-calendar-placeholder {
    text-align: center;
    padding: 20px;
}

#myowndeliveries-calendar-placeholder.calendar-loading {
    position: relative;
    min-height: 220px;
}

#myowndeliveries-calendar-placeholder.calendar-loading > :not(.oow-calendar-loading-indicator) {
    opacity: 0;
    pointer-events: none;
}

#myowndeliveries-calendar-placeholder .oow-calendar-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    z-index: 5;
}

.oow-calendar-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #6c757d;
  font-weight: 500;
}

/* Estilos para el calendario de myowndeliveries */
#myOwnCalendarTop,
#myOwnCalendarLine {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

#myOwnCalendarTop td,
#myOwnCalendarLine td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.myOwnCalendarHours {
    background: #f5f5f5;
    font-weight: bold;
    min-width: 80px;
}

.myOwnCalendarTopItem {
    background: #e9ecef;
    font-weight: bold;
    font-size: 0.9em;
}

.myOwnCalendarLineItem {
    position: relative;
    min-height: 60px;
}

/* Estilos para los slots de tiempo */
.availableSlot,
.unavailableSlot,
.holidaySlot,
.emptySlot {
    width: 100%;
    height: 100%;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.availableSlot {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
}

.availableSlot:hover {
    background: #c3e6cb;
    transform: scale(1.05);
}

.availableSlot.selectedSlot {
    background: #28a745;
    border-color: #1e7e34;
    color: white;
    transform: scale(1.1);
}

.unavailableSlot {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    cursor: not-allowed;
}

.holidaySlot {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    color: #856404;
}

.emptySlot {
    background: transparent;
    border: none;
}

/* Estilos para los inputs de radio ocultos */
.slotInput {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.slotLabel {
    font-size: 0.8em;
    text-align: center;
    line-height: 1.2;
}

/* Estilos para mensajes de error */
.warning-message {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 5px;
    display: block;
}

/* Responsive para el calendario */
@media (max-width: 768px) {
    #myOwnCalendarTop,
    #myOwnCalendarLine {
        font-size: 0.8em;
    }
    
    .myOwnCalendarHours {
        min-width: 60px;
    }
    
    .slotLabel {
        font-size: 0.7em;
    }
    
    .availableSlot,
    .unavailableSlot,
    .holidaySlot,
    .emptySlot {
        min-height: 40px;
    }
}

/* Estilos para el campo de notas de entrega */
#delivery-notes {
    resize: vertical;
    min-height: 80px;
}

/* Estilos para la información de entrega en el resumen */
.selected-delivery-date,
.selected-delivery-time,
.selected-delivery-notes {
    font-weight: bold;
    color: #28a745;
}

/* Estilos para el calendario personalizado */
.custom-delivery-calendar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.calendar-header h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.calendar-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.calendar-day {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.calendar-day.available-day {
    background: #f8f9fa;
}

.calendar-day.available-day:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.calendar-day.unavailable-day {
    background: #f5f5f5;
    opacity: 0.6;
}

.day-header {
    background: #f1f3f4;
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.day-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.day-date {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.day-slots {
    padding: 12px;
}

.time-slot {
    margin-bottom: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.time-slot.available-slot {
    background: #e8f5e8;
    border: 1px solid #c3e6cb;
}

.time-slot.available-slot:hover {
    background: #d4edda;
    border-color: #28a745;
    transform: scale(1.02);
}

.time-slot input[type="radio"] {
    display: none;
}

.time-slot label {
    display: block;
    padding: 10px;
    cursor: pointer;
    margin: 0;
}

.time-slot input[type="radio"]:checked + label {
    background: #28a745;
    color: white;
    border-radius: 4px;
}

.slot-time {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.slot-name {
    display: block;
    font-size: 11px;
    opacity: 0.8;
}

.no-slots {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px 10px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .calendar-header {
        padding: 15px;
    }
    
    .calendar-header h4 {
        font-size: 16px;
    }
    
    .day-slots {
        padding: 8px;
    }
    
    .time-slot label {
        padding: 8px;
    }
}

/* Estilos para la navegación del calendario de myowndeliveries */
.myOwnCalendarNavigation {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.myOwnCalendarNavigation a {
    display: inline-block !important;
    padding: 8px 15px !important;
    margin: 0 10px !important;
    background: #007bff !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    transition: background 0.2s !important;
    font-weight: bold !important;
}

.myOwnCalendarNavigation a:hover {
    background: #0056b3 !important;
    color: white !important;
    text-decoration: none !important;
}

.myOwnCalendarNavigation span {
    display: inline-block !important;
    padding: 8px 15px !important;
    margin: 0 10px !important;
    background: #6c757d !important;
    color: white !important;
    border-radius: 4px !important;
    font-weight: bold !important;
}

/* Estilos adicionales para cualquier elemento de navegación */
[onclick*="myowndeliveriesshow"] {
    display: inline-block !important;
    padding: 8px 15px !important;
    margin: 0 10px !important;
    background: #007bff !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: bold !important;
}

[onclick*="myowndeliveriesshow"]:hover {
    background: #0056b3 !important;
    color: white !important;
}

/* Estilos para los slots de myowndeliveries */
.availableSlot {
    cursor: pointer;
    transition: all 0.2s;
}

.availableSlot:hover {
    background: #e8f5e8 !important;
}

.availableSlot.selected-slot {
    background: #28a745 !important;
    color: white !important;
}

.availableSlot.selected-slot .slotLabel {
    color: white !important;
}

/* === Overrides de layout para progressbar en el modal === */
#OrderOnWhatsAppModal #order-on-whatsapp-form { text-align: left; }
#OrderOnWhatsAppModal #order-on-whatsapp-form #progressbar{
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  width: 100%;
  margin: 0;
}
#OrderOnWhatsAppModal #order-on-whatsapp-form #progressbar li{
  float: none;
  flex: 1 1 25%;
  width: auto; /* ignora ancho anterior */
  text-align: center;
}
/* Opcional: simplificar conectores para evitar solapes con flex */
#OrderOnWhatsAppModal #order-on-whatsapp-form #progressbar li:after{ display: none; }

#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent {
    margin: 10px 0;
    text-align: left;
    background: #2f2f33 !important;
    border: 1px solid #1e1e24;
    border-radius: 6px;
    padding: 15px 18px;
    color: #ffffff;
}

#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent label,
#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent .form-check-label,
#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent .form-text,
#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent small {
    color: #e7e9ec !important;
}
#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent .oow-gdpr-fallback {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: #ffffff;
}

#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent .oow-gdpr-fallback .form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #27ae60;
    position: static;
    margin-right: 0.4rem;
    border: 2px solid #27ae60;
    border-radius: 4px;
}

#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent .oow-gdpr-fallback .form-check-label {
    margin: 0;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.4;
    flex: 1 1 auto;
}

#OrderOnWhatsAppModal #order-on-whatsapp-form .oow-gdpr-consent small.form-text {
    display: block;
    margin-top: 10px;
    color: #c3c9d2 !important;
    font-size: 0.85rem;
}
