/* assets/css/components.css */

/* ========================================================
   ALERTS (FLASH MESSAGES)
   ======================================================== */
.flash-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #e0f2f1;
  border: 1px solid black;
  color: var(--primary-color);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 10000;
  font-weight: 600;
  animation: slideInRight 0.3s ease-out;
}

.flash-message.error {
  background-color: #ffebee;
  color: #c62828;
}

.flash-message.success {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.flash-message.info {
    background-color: #e3f2fd;
    color: #1565c0;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.flash-message.hiding {
  animation: slideOutRight 0.3s ease-in forwards;
}

/* =========================================
   MODAL REGISTER (Soft Gating)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 24px;
    background: none; border: none; cursor: pointer;
    color: #888;
}

.benefits-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.btn-primary {
    background-color: #00796b; color: white;
    padding: 12px; border-radius: 6px;
    text-decoration: none; font-weight: bold;
}

.btn-secondary-pop-up {
    background: none; border: none; color: #666;
    margin-top: 5px;
    text-decoration: underline; cursor: pointer;
}
/* =========================================
   BASE STYLES (OVERLAY)
   ========================================= */
.modal-overlay,
.modal-confirmacion {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* =========================================
   REGISTER / PREMIUM MODAL BOX
   ========================================= */
.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

/* =========================================
   MODAL CONFIRMATION BOX
   ========================================= */
.modal-contenido {
    background: #ffffff;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.modal-contenido h3 {
    color: var(--primary-color, #004d40);
    margin-top: 0;
    margin-bottom: 15px;
}

.modal-contenido p {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* =========================================
   ELEMENTOS INTERNOS (Botones, listas, etc.)
   ========================================= */
.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 24px;
    background: none; border: none; cursor: pointer;
    color: #888;
}

.modal-header h3 {
    color: #00796b;
    margin-top: 0;
    margin-bottom: 15px;
}

.benefits-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions.row {
    flex-direction: row;
    justify-content: center;
}

.btn-primary {
    background-color: #00796b; color: white;
    padding: 12px; border-radius: 6px;
    text-decoration: none; font-weight: bold;
    display: block;
}

.btn-secondary-pop-up {
    background: none; border: none; color: #666;
    margin-top: 5px;
    text-decoration: underline; cursor: pointer;
    font-size: 0.95rem;
}

/* ========================================================
   MODALS BUTTONS
   ======================================================== */
.btn-danger {
  background: #e53935;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-danger:hover { background: #c62828; }

.btn-neutral {
  background: #f5f5f5;
  color: #555;
  border: 1px solid #ddd;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-neutral:hover { background: #e0e0e0; color: #333; }

/* Premium buttons */
.btn-premium-primary {
  background: var(--secondary-color, #00796b);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}
.btn-premium-primary:hover { background: var(--primary-color, #004d40); }
.btn-premium-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-premium-secondary {
  background: transparent;
  color: #888;
  border: none;
  padding: 8px;
  cursor: pointer;
  text-decoration: underline;
}
.btn-premium-secondary:hover { color: #333; }

/* ========================================================
   FAVORITE PRODUCT STYLES
   ======================================================== */
.box-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.box-actions .add-to-list {
  margin-top: 0;
  flex: none;
  width: auto;
}

.btn-favorite-small {
  background: white;
  color: #ff4757;
  border: 2px solid #eee;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.btn-favorite-small:hover {
  background: #fff0f1;
  border-color: #ff4757;
  transform: scale(1.1);
}

/* Style for prods already in favs */
.is-favorite svg {
  fill: #ff4757;
  stroke: #ff4757;
}
