/* ====================================
   VARIABLES CSS Y BASE
   ==================================== */
   :root {
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --danger-color: #f44336;
    --danger-dark: #d32f2f;
    --warning-color: #FF7F50;
    --success-bg: #E8F5E9;
    --warning-bg: #FFF8E1;
    --error-bg: #FFEBEE;
    --light-gray: #f9f9f9;
    --border-gray: #ddd;
    --text-color: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 8px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
  }
  
  /* ====================================
     ESTILOS GENERALES
     ==================================== */
  .text-center {
    text-align: center;
  }

  .subscription-step#step-date,
  .subscription-step#step-confirm {
    display: none;
  }

  /* ====================================
     ESTILOS PARA BOTONES EN CORREOS
     ==================================== */
  .email-button {
    color: #ffffff !important;
    text-decoration: none;
  }

  /* ====================================
     ESTILOS PARA WOOCOMMERCE
     ==================================== */
  .woocommerce-message.custom-spacing {
    margin-bottom: 20px;
  }

  .woocommerce-message .button.custom-margin {
    margin-right: 10px;
  }
  
  /* ====================================
     CONTENEDORES PRINCIPALES
     ==================================== */
  .subscription-container,
  .subscription-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Arial', sans-serif;
  }
  
  .subscription-dashboard {
    max-width: 600px;
  }
  
  .subscription-dashboard h2 {
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
  }
  
  /* ====================================
     TARJETAS Y PASOS
     ==================================== */
  .subscription-step,
  .subscription-card,
  .action-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
    transition: var(--transition);
  }
  
  .subscription-card,
  .action-card {
    padding: 20px;
  }
  
  /* ====================================
     PLANES DE SUSCRIPCIÓN
     ==================================== */
  .plan-options {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .plan {
    border: 2px solid var(--border-gray);
    border-radius: var(--border-radius);
    padding: 20px;
    background-color: #fff;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    min-width: 250px;
    text-align: center;
  }
  
  .plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  .plan.selected {
    border-color: var(--primary-color);
    background-color: var(--success-bg);
  }
  
  .plan h3 {
    color: var(--text-color);
    font-size: 24px;
    margin-bottom: 10px;
  }
  
  .plan .price {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 15px;
  }
  
  /* ====================================
     BOTONES
     ==================================== */
  .button,
  .select-plan-btn,
  #confirm-subscription-btn {
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    cursor: pointer;
    border: none;
  }
  
  .select-plan-btn,
  #confirm-subscription-btn {
    border-radius: 5px;
    text-transform: none;
    letter-spacing: normal;
  }
  
  .button-primary,
  .select-plan-btn,
  #confirm-subscription-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(76, 175, 80, 0.3);
  }
  
  .button-primary:hover,
  .select-plan-btn:hover,
  #confirm-subscription-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(76, 175, 80, 0.4);
  }
  
  .button-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(244, 67, 54, 0.3);
  }
  
  .button-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, var(--danger-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(244, 67, 54, 0.4);
  }
  
  .button-secondary {
    background: linear-gradient(135deg, #f1f1f1 0%, #e1e1e1 100%);
    color: var(--text-color);
    box-shadow: var(--shadow);
  }
  
  .button-secondary:hover {
    background: linear-gradient(135deg, #e1e1e1 0%, #f1f1f1 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
  }
  
  .back-btn {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
  }
  
  .back-btn:hover {
    color: var(--primary-color);
  }
  
  /* Estados especiales de botones */
  #confirm-subscription-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
  }
  
  .button-primary:focus {
    animation: pulse-shadow 1.5s infinite;
  }
  
  /* ====================================
     SELECCIÓN DE FECHAS
     ==================================== */
  .date-option {
    background-color: #f5f5f5;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
  }
  
  .date-option:hover {
    background-color: #e0e0e0;
  }
  
  .date-option.selected {
    background-color: var(--success-bg);
    border: 2px solid var(--primary-color);
  }
  
  .date-text {
    font-size: 18px;
    color: var(--text-color);
  }
  
  .slots-available {
    float: right;
    color: var(--primary-color);
    font-weight: bold;
  }
  
  /* ====================================
     FORMULARIOS Y SELECTS
     ==================================== */
  .select-styled {
    width: 100%;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
    font-size: 16px;
    appearance: none;
    background: url('data:image/svg+xml;utf8,<svg fill="%234CAF50" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>') no-repeat;
    background-position: right 10px top 50%;
    transition: border-color 0.3s ease;
    margin-bottom: 10px;
  }
  
  .select-styled:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
  }
  
  /* ====================================
     RESÚMENES Y INFORMACIÓN
     ==================================== */
  #subscription-summary {
    background-color: var(--light-gray);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
  }
  
  #subscription-summary p:last-of-type {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-gray);
  }
  
  #subscription-details p,
  .action-card p {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .action-card h3 {
    color: var(--text-color);
    margin-bottom: 15px;
  }
  
  .highlight {
    color: var(--primary-color);
    font-weight: bold;
  }
  
  .available-slots {
    display: flex;
    align-items: center;
    background-color: var(--success-bg);
    padding: 15px;
    border-radius: var(--border-radius);
  }
  
  .available-slots i {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 15px;
  }
  
  .available-slots p {
    margin: 0;
    font-size: 16px;
  }
  
  /* ====================================
     AVISOS Y MENSAJES
     ==================================== */
  .renewal-notice {
    background-color: var(--warning-bg);
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-color);
    border-radius: 0 5px 5px 0;
  }
  
  .renewal-notice i {
    color: var(--warning-color);
    margin-right: 5px;
  }
  
  .message,
  #subscription-messages {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
  }
  
  #subscription-messages {
    margin-top: 20px;
  }
  
  .message.success {
    background-color: var(--success-bg);
    color: var(--primary-color);
  }
  
  .message.error {
    background-color: var(--error-bg);
    color: var(--danger-color);
  }
  
  .no-subscription-message {
    text-align: center;
    padding: 40px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
  }
  
  .no-subscription-message i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
  }
  
  .warning-icon {
    text-align: center;
    font-size: 48px;
    color: var(--danger-color);
    margin-bottom: 20px;
  }
  
  /* ====================================
     MODALES
     ==================================== */
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  
  .modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background: linear-gradient(135deg, #ffffff 0%, #f3f3f3 100%);
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }
  
  .modal.show .modal-overlay {
    opacity: 1;
  }
  
  .modal.show .modal-container {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  
  .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .modal-header h2 {
    margin: 0;
    font-size: 1.5em;
  }
  
  .modal-header .close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.3s ease;
  }
  
  .modal-header .close-modal:hover {
    transform: rotate(90deg);
  }
  
  .modal-body {
    padding: 30px;
  }
  
  .modal-footer {
    padding: 20px;
    text-align: right;
    border-top: 1px solid #e0e0e0;
  }

  /* Contenedor de mensajes dentro del modal */
  #cancel-modal-messages {
    margin-bottom: 15px;
  }

  #cancel-modal-messages .message {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease-out;
  }

  #cancel-modal-messages .message.error {
    background-color: var(--error-bg);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
  }

  #cancel-modal-messages .message.success {
    background-color: var(--success-bg);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .date-picker-container {
    margin-bottom: 20px;
  }
  
  /* ====================================
     ANIMACIONES
     ==================================== */
  @keyframes pulse-transform {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  @keyframes pulse-shadow {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .pulse {
    animation: pulse-transform 0.5s;
  }
  
  /* ====================================
     LOADER
     ==================================== */
  .loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
  }
  
  /* ====================================
     ESTILOS PARA ADMINISTRACIÓN
     ==================================== */
  .subscription-management-page {
    background: #fff;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 20px;
  }
  
  .subscription-management-wrap {
    max-width: 100%;
    overflow-x: auto;
  }
  
  .subscription-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  
  .subscription-list-table thead th {
    background: var(--primary-color);
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: bold;
  }
  
  .subscription-list-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-gray);
  }
  
  .subscription-list-table tbody tr:hover {
    background-color: var(--light-gray);
  }
  
  .subscription-form-table {
    width: 100%;
    max-width: 600px;
    margin: 20px 0;
  }
  
  .subscription-form-table th {
    background: var(--light-gray);
    padding: 10px 15px;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px solid var(--border-gray);
    width: 200px;
  }
  
  .subscription-form-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-gray);
  }
  
  .subscription-form-table input,
  .subscription-form-table select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 14px;
  }
  
  .subscription-button {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    margin-right: 5px;
  }
  
  .subscription-button-primary {
    background: var(--primary-color);
    color: white;
  }
  
  .subscription-button-primary:hover {
    background: var(--primary-dark);
    color: white;
  }
  
  .subscription-button-delete {
    background: var(--danger-color);
    color: white;
  }
  
  .subscription-button-delete:hover {
    background: var(--danger-dark);
    color: white;
  }
  
  .subscription-button-small {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .subscription-error {
    background: var(--error-bg);
    color: var(--danger-color);
    padding: 15px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--danger-color);
    margin: 15px 0;
  }
  
  .subscription-updated {
    background: var(--success-bg);
    color: var(--primary-color);
    padding: 15px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin: 15px 0;
    font-weight: bold;
  }

  /* ====================================
     MODAL DE CONFIRMACIÓN
     ==================================== */
  .confirmation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(4px);
  }

  .confirmation-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: slideIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .confirmation-modal h3 {
    color: var(--text-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .confirmation-modal h3::before {
    content: "⚠️";
    font-size: 24px;
  }

  .confirmation-modal p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 0 10px;
  }

  .confirmation-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
  }

  .confirmation-modal-button {
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.5px;
  }

  .confirmation-modal-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
  }

  .confirmation-modal-button:hover::before {
    left: 100%;
  }

  .cancel-button {
    background: linear-gradient(135deg, #f1f1f1 0%, #e1e1e1 100%);
    color: var(--text-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #d0d0d0;
  }

  .cancel-button:hover {
    background: linear-gradient(135deg, #e1e1e1 0%, #d1d1d1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }

  .confirm-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
  }

  .confirm-button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
  }

  .confirmation-modal-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  /* Animaciones para el modal de confirmación */
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes slideIn {
    from {
      opacity: 0;
      transform: scale(0.8) translateY(-20px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  /* ====================================
     RESPONSIVE DESIGN
     ==================================== */
  @media (max-width: 768px) {
    /* Botones de confirmación de pedido WooCommerce */
    .woocommerce-message.custom-spacing {
      margin-bottom: 25px;
      padding: 15px;
      border-radius: var(--border-radius);
      background-color: #f8f9fa;
      text-align: center;
    }

    .woocommerce-message .button {
      display: block;
      width: 100%;
      max-width: 280px;
      margin: 0 auto 12px auto;
      padding: 14px 20px;
      font-size: 16px;
      font-weight: 600;
      text-align: center;
      border-radius: 8px;
      text-decoration: none;
      transition: all 0.3s ease;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .woocommerce-message .button.custom-margin {
      margin-right: 0;
      margin-bottom: 12px;
      background-color: #6c757d;
      color: white;
      border: none;
    }

    .woocommerce-message .button.custom-margin:hover {
      background-color: #5a6268;
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .woocommerce-message .button-primary {
      background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
      color: white;
      border: none;
      margin-bottom: 0;
    }

    .woocommerce-message .button-primary:hover {
      background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    }

    /* Título y texto de pedido recibido */
    .wc-block-order-confirmation-status h1 {
      font-size: 28px;
      margin: 25px 0 15px 0;
      color: var(--primary-color);
      text-align: center;
    }

    .wc-block-order-confirmation-status p {
      font-size: 16px;
      text-align: center;
      color: var(--text-color);
      margin-bottom: 20px;
    }

    /* Estilos existentes */
    .subscription-container,
    .subscription-dashboard {
      padding: 10px;
    }
    
    .plan-options {
      flex-direction: column;
    }
    
    .plan {
      margin: 10px 0;
      min-width: auto;
    }
    
    .modal-container {
      width: 95%;
    }
    
    .button {
      padding: 10px 20px;
      font-size: 14px;
    }

    .subscription-list-table {
      font-size: 12px;
    }

    .subscription-list-table thead th,
    .subscription-list-table tbody td {
      padding: 8px 5px;
    }

    .subscription-form-table th {
      width: auto;
      display: block;
      border-bottom: none;
      padding-bottom: 5px;
    }

    .subscription-form-table td {
      display: block;
      padding-top: 0;
    }

    /* Modal de confirmación responsive */
    .confirmation-modal {
      padding: 30px 20px;
      margin: 20px;
      max-width: 360px;
    }

    .confirmation-modal h3 {
      font-size: 24px;
      margin-bottom: 15px;
    }

    .confirmation-modal p {
      font-size: 15px;
      margin-bottom: 25px;
      padding: 0;
    }

    .confirmation-modal-buttons {
      flex-direction: column;
      gap: 12px;
    }

    .confirmation-modal-button {
      width: 100%;
      padding: 16px;
      font-size: 15px;
      min-width: auto;
    }
  }

  /* Estilos para pantallas muy pequeñas */
  @media (max-width: 480px) {
    .woocommerce-message.custom-spacing {
      margin-bottom: 20px;
      padding: 12px;
    }

    .woocommerce-message .button {
      max-width: 100%;
      padding: 12px 16px;
      font-size: 15px;
      margin-bottom: 10px;
    }

    .wc-block-order-confirmation-status h1 {
      font-size: 24px;
      margin: 20px 0 12px 0;
    }

    .wc-block-order-confirmation-status p {
      font-size: 15px;
      margin-bottom: 15px;
    }
  }