
/* Container & Layout */
.cer-container, .cer-container *, .cer-card, .cer-card * {
  box-sizing: border-box;
}
.cer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.cer-container.cer-full-width { max-width: 100%; padding: 0 24px; }

/* Action buttons in tables */
.cer-action-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 130px;
}

.cer-action-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px 16px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  border-radius: 6px !important;
  white-space: nowrap;
  box-sizing: border-box;
}

.cer-action-btn.button-primary {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

.cer-action-btn.button-primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

.cer-action-btn-secondary {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

.cer-action-btn-secondary:hover {
  background: #fee2e2 !important;
}

/* Single event page content constraint */
.single-corp_event .entry-content,
.single-corp_event .site-main,
.single-corp_event article {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Card styles */
.cer-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  padding: 24px;
  margin: 20px 0;
}

/* Grid layout for events list - max 3 columns */
.cer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 24px 0;
}

/* Responsive breakpoints - 2 columns on tablet, 1 on mobile */
@media (max-width: 1024px) {
  .cer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .cer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cer-card { padding: 16px; margin: 12px 0; }
}

/* Event cards in grid */
.cer-grid .cer-card {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.cer-grid .cer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 49, 107, 0.15), 0 4px 8px -2px rgba(0, 0, 0, 0.08);
}

/* Card image container */
.cer-grid .cer-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.cer-grid .cer-card img,
.cer-grid .cer-card .wp-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 !important;
  float: none !important;
  display: block;
}

/* Card title */
.cer-grid .cer-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
}

.cer-grid .cer-card h3 a {
  color: #1f2937;
  text-decoration: none;
}

.cer-grid .cer-card h3 a:hover {
  color: #00316B;
}

/* Card description/excerpt */
.cer-grid .cer-card > div:not([style]):not(.cer-event-cta-card) {
  flex: 0 0 auto;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Registration countdown in card */
.cer-grid .cer-card > p {
  font-size: 13px !important;
  margin: 8px 0 !important;
}

/* ========================================
   EVENT CTA CARD (Booking Form in Grid)
   ======================================== */

.cer-grid .cer-event-cta-card {
  margin-top: auto !important;
  padding: 12px !important;
  background: #f9fafb;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

/* Every direct child of the CTA card (including the form) must not stretch */
.cer-grid .cer-event-cta-card > * {
  flex: 0 0 auto;
}

/* Compact info boxes in card — countdown, per-request limit, waitlist notice */
.cer-grid .cer-info-box {
  padding: 10px !important;
  margin-bottom: 10px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
}

/* Hide verbose sub-text in card view */
.cer-grid .cer-info-box > div[style*="font-size:12px"] {
  display: none;
}

/* Compact ticket table in cards */
.cer-grid .cer-ticket-table {
  font-size: 12px !important;
}

.cer-grid .cer-ticket-table th {
  padding: 8px 6px !important;
  font-size: 11px !important;
  white-space: nowrap;
}

.cer-grid .cer-ticket-table td {
  padding: 8px 6px !important;
  font-size: 12px !important;
}

.cer-grid .cer-ticket-table td:first-child {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cer-grid .cer-ticket-table td:first-child small {
  display: none; /* Hide description in compact view */
}

.cer-grid .cer-ticket-table input[type="number"] {
  width: 60px !important;
  max-width: 60px !important;
  padding: 6px !important;
  font-size: 14px !important;
}

/* Compact form actions */
.cer-grid .cer-form-actions {
  margin-top: 10px !important;
  padding-top: 10px !important;
}

.cer-grid .cer-submit-btn {
  width: 100%;
  padding: 10px 16px !important;
  font-size: 13px !important;
}

/* Hide table overflow - prevent scroll */
.cer-grid .cer-table-responsive {
  overflow: visible !important;
}

/* Registration Closed notice in card */
.cer-grid .cer-card > div[style*="background:#fee2e2"] {
  padding: 12px !important;
  font-size: 13px;
}

/* ========================================
   QUANTITY INPUT - Simple number box
   ======================================== */

.cer-qty-input {
  width: 70px !important;
  padding: 8px 10px !important;
  text-align: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 16px !important;
  font-weight: 600;
  color: #1f2937;
  -moz-appearance: textfield;
}

.cer-qty-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cer-qty-input::-webkit-outer-spin-button,
.cer-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Compact in grid cards */
.cer-grid .cer-qty-input {
  width: 60px !important;
  padding: 6px 8px !important;
  font-size: 14px !important;
}

/* Status badges */
.status-approved { color: #059669; font-weight: 600; }
.status-pending { color: #d97706; font-weight: 600; }
.status-declined { color: #dc2626; font-weight: 600; }

.cer-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}
.cer-badge-approved { background: #d1fae5; color: #065f46; }
.cer-badge-pending { background: #fef3c7; color: #92400e; }
.cer-badge-declined { background: #fee2e2; color: #991b1b; }
.cer-badge-cancelled { background: #fecaca; color: #991b1b; }
.cer-badge-cancelled_late { background: #fed7aa; color: #92400e; }

/* Countdown */
.cer-countdown { 
  font-weight: 600; 
  font-family: 'Courier New', monospace;
  font-size: 15px;
}

/* Filters */
.cer-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cer-filters select {
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}

@media (max-width: 640px) {
  .cer-filters { flex-direction: column; align-items: stretch; }
  .cer-filters select { min-width: 100%; }
  .cer-filters button { width: 100%; }
}

/* Forms */
.cer-card form table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.cer-card form table th {
  background: #f9fafb;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid #e5e7eb;
}

.cer-card form table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.cer-card form table input[type="number"] {
  width: 100px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .cer-card form table {
    font-size: 13px;
  }
  .cer-card form table th,
  .cer-card form table td {
    padding: 8px;
  }
}

/* Buttons */
.cer-card .button,
.cer-card button.button {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}

.cer-card .button:hover,
.cer-card button.button:hover {
  background: #2563eb;
}

.cer-card .button-primary,
.cer-card button.button-primary {
  background: #3b82f6;
}

.cer-card .button-primary:hover,
.cer-card button.button-primary:hover {
  background: #2563eb;
}

/* Responsive tables */
@media (max-width: 768px) {
  .widefat {
    font-size: 13px;
  }
  
  .widefat th,
  .widefat td {
    padding: 8px 6px;
  }
  
  /* Make reservation request form responsive */
  .cer-card form table.widefat {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Stack action buttons on mobile */
  .cer-action-btns {
    min-width: 100px;
  }
}

/* My Reservations table improvements */
.cer-card > div[style*="overflow-x"] > table.widefat {
  width: 100%;
  border-collapse: collapse;
}

.cer-card > div[style*="overflow-x"] > table.widefat th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}

.cer-card > div[style*="overflow-x"] > table.widefat td {
  padding: 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}

.cer-card > div[style*="overflow-x"] > table.widefat tbody tr:hover {
  background: #f8fafc;
}

/* Bottom Slide-Up Modal (Drawer/Sheet) */
#cer-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99998;
  transition: opacity .3s ease;
}

#cer-modal-backdrop.show {
  display: block;
  animation: fadeIn .3s ease;
}

#cer-myres-modal {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  max-height: 70vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  transform: translateY(100%);
  transition: transform .3s ease-out;
}

#cer-myres-modal.show {
  display: block;
  transform: translateY(0);
}

#cer-myres-modal.animating {
  display: block;
}

/* Modal header with drag handle */
.cer-modal-header {
  padding: 12px 20px 16px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  border-radius: 20px 20px 0 0;
}

.cer-modal-drag-handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 0 auto 12px;
  cursor: grab;
}

.cer-modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cer-modal-title-row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.cer-modal-close {
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
  transition: background .2s;
}

.cer-modal-close:hover {
  background: #e5e7eb;
}

/* Modal body with scroll */
.cer-modal-body {
  padding: 0;
  overflow-y: auto;
  max-height: calc(70vh - 100px);
  -webkit-overflow-scrolling: touch;
  padding-bottom: 100px; /* Extra padding so content isn't hidden behind footer */
}

/* Wrapper for scrollable table */
.cer-table-wrapper {
  max-height: none; /* Remove height limit */
  overflow: visible; /* No scroll on wrapper */
  margin: 0;
}

/* Content padding for non-table content */
.cer-modal-content-padding {
  padding: 12px 20px 20px 20px;
}

/* Ensure Request Additional Seats section is fully visible */
.cer-additional-seats {
  margin-bottom: 20px;
}

/* Modal footer with actions */
.cer-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  justify-content: center;
  z-index: 10;
}

/* Body scroll lock when modal is open */
body.cer-modal-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  #cer-myres-modal {
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }
  
  .cer-modal-body {
    max-height: calc(85vh - 100px);
    padding-bottom: 120px; /* More padding on mobile */
  }
  
  .cer-modal-footer {
    flex-direction: column;
  }
  
  .cer-modal-footer button {
    width: 100%;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Attendee table in modal */
.cer-attendee-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  background: #fff;
}

.cer-attendee-table th {
  background: #f9fafb;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid #e5e7eb;
}

.cer-attendee-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

.cer-attendee-table td:first-child {
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.cer-attendee-table input[type="text"],
.cer-attendee-table input[type="email"],
.cer-attendee-table textarea,
.cer-attendee-table select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.cer-attendee-table textarea {
  min-height: 60px;
  resize: vertical;
}

@media (max-width: 768px) {
  .cer-attendee-table {
    font-size: 13px;
  }
  
  .cer-attendee-table th,
  .cer-attendee-table td {
    padding: 8px;
  }
}

/* Additional seats request section */
.cer-additional-seats {
  margin-top: 0;
  padding: 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.cer-additional-seats h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #1e40af;
}

.cer-additional-seats .cer-pending-notice {
  padding: 12px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #92400e;
}

.cer-additional-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.cer-additional-form label {
  flex: 1;
}

.cer-additional-form input {
  width: 100%;
}

@media (max-width: 640px) {
  .cer-additional-form {
    flex-direction: column;
  }
  
  .cer-additional-form button {
    width: 100%;
  }
}

/* Event CTA Card - Reservation Form (v3.7.0) */
.cer-event-cta-card {
  margin-top: 24px;
}

.cer-event-cta-card .cer-reservation-form {
  width: 100%;
}

/* Ticket table styling */
.cer-ticket-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px 0;
  background: #fff;
}

.cer-ticket-table th {
  text-align: left;
  padding: 12px;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.cer-ticket-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.cer-ticket-table input[type="number"] {
  width: 100%;
  max-width: 100px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}

.cer-ticket-table input[type="number"]:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Notice boxes */
.cer-notice {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.cer-notice-warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.cer-notice-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* Form actions - button container */
.cer-form-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.cer-form-actions .button,
.cer-form-actions button {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cer-form-actions .button:hover,
.cer-form-actions button:hover {
  background: #2563eb;
}

/* Responsive table wrapper */
.cer-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile responsive adjustments for CTA */
@media (max-width: 640px) {
  .cer-event-cta-card {
    padding: 16px;
  }
  
  .cer-ticket-table th,
  .cer-ticket-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
  
  .cer-ticket-table input[type="number"] {
    max-width: 70px;
    padding: 6px;
  }
  
  .cer-form-actions {
    text-align: center;
  }
  
  .cer-form-actions .button,
  .cer-form-actions button {
    width: 100%;
    display: block;
  }
  
  .cer-notice {
    padding: 10px;
    font-size: 13px;
  }
}

/* Ensure widefat table styling on frontend (fallback) */
.cer-card table.widefat {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.cer-card table.widefat thead th {
  background: #f9fafb;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid #e5e7eb;
  color: #374151;
}

.cer-card table.widefat tbody td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.cer-card table.widefat tbody tr:last-child td {
  border-bottom: none;
}

/* ===========================================
   MY RESERVATIONS - Dual Layout (Table + Cards)
   Desktop: Show table, hide cards
   Mobile: Hide table, show cards
   =========================================== */

/* Desktop: show table, hide cards */
.cer-res-table-wrap {
  display: block;
}
.cer-res-cards-wrap {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Mobile: hide table, show cards */
@media (max-width: 768px) {
  .cer-res-table-wrap {
    display: none !important;
  }
  .cer-res-cards-wrap {
    display: flex !important;
  }
}

/* Mobile Reservation Cards */
.cer-res-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.cer-res-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.cer-res-card-title {
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
  text-decoration: none;
  line-height: 1.3;
  flex: 1;
}

.cer-res-card-title:hover {
  color: #2563eb;
}

.cer-res-card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.cer-res-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.cer-res-label {
  color: #6b7280;
  font-weight: 500;
}

.cer-res-card-row span:last-child {
  color: #1f2937;
  text-align: right;
}

.cer-res-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.cer-res-card-actions .cer-action-btn {
  width: 100%;
  padding: 12px 16px !important;
  font-size: 14px !important;
  border-radius: 8px !important;
  text-align: center;
}

/* Badge in card header */
.cer-res-card-header .cer-badge {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===========================================
   ATTENDEE FORM - Mobile Transformation
   Converts table to stacked cards on mobile
   =========================================== */

/* Mobile label - hidden on desktop */
.cer-mobile-label {
  display: none;
}

@media (max-width: 600px) {
  /* Show mobile labels */
  .cer-mobile-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
  }
  
  /* Hide the table header on mobile */
  .cer-attendee-table thead {
    display: none;
  }
  
  /* Make table, tbody, tr, td all block elements */
  .cer-attendee-table,
  .cer-attendee-table tbody,
  .cer-attendee-table tr,
  .cer-attendee-table td {
    display: block;
    width: 100%;
  }
  
  /* Each row becomes a card */
  .cer-attendee-table tr {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
  }
  
  /* Remove default td styling */
  .cer-attendee-table td {
    border: none;
    padding: 0;
    margin-bottom: 12px;
  }
  
  .cer-attendee-table td:last-child {
    margin-bottom: 0;
  }
  
  /* First cell (Attendee label) - make it a header */
  .cer-attendee-table td:first-child {
    background: #2563eb;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    margin: -14px -14px 14px -14px;
    width: calc(100% + 28px);
    font-size: 15px;
  }
  
  .cer-attendee-table td:first-child strong {
    color: #fff;
  }
  
  /* Hide the mobile label in the first cell */
  .cer-attendee-table td:first-child .cer-mobile-label {
    display: none;
  }
  
  /* Style the inputs */
  .cer-attendee-table input[type="text"],
  .cer-attendee-table input[type="email"],
  .cer-attendee-table textarea,
  .cer-attendee-table select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px; /* Prevents iOS zoom */
    background: #fff;
    -webkit-appearance: none;
  }
  
  .cer-attendee-table textarea {
    min-height: 80px;
  }
  
  .cer-attendee-table select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
  }
  
  /* Checkbox styling */
  .cer-attendee-table input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
  }
  
  /* Modal adjustments for mobile */
  #cer-myres-modal {
    max-height: 92vh;
  }
  
  .cer-modal-body {
    max-height: calc(92vh - 120px);
    padding: 12px;
  }
  
  .cer-table-wrapper {
    padding: 0;
  }
  
  /* Additional seats section on mobile */
  .cer-additional-seats {
    margin: 0;
    padding: 14px;
    border-radius: 10px;
  }
  
  .cer-additional-seats h4 {
    font-size: 15px;
    margin-bottom: 10px;
  }
  
  .cer-additional-form {
    flex-direction: column;
    gap: 10px;
  }
  
  .cer-additional-form label {
    font-size: 14px;
    font-weight: 500;
  }
  
  .cer-additional-form input,
  .cer-additional-form select {
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    margin-top: 6px;
  }
  
  .cer-additional-form button {
    padding: 14px;
    font-size: 15px;
    border-radius: 8px;
  }
  
  /* Modal footer sticky */
  .cer-modal-footer {
    position: sticky;
    bottom: 0;
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    margin: 0 -12px -12px -12px;
    width: calc(100% + 24px);
  }
  
  .cer-modal-footer button {
    flex: 1;
    padding: 14px;
    font-size: 15px;
    border-radius: 8px;
  }
  
  /* Editing closed notice */
  .cer-modal-body > div[style*="fee2e2"] {
    margin: 0 0 12px 0 !important;
    border-radius: 10px;
  }
}

/* ===========================================
   MOBILE-SPECIFIC STYLES (phones only)
   Only affects screens <= 480px
   DO NOT change desktop/tablet styles above
   =========================================== */

@media (max-width: 480px) {
  
  /* Container padding reduction */
  .cer-container { padding: 0 12px; }
  .cer-container.cer-full-width { padding: 0 12px; }
  
  /* Event grid - single column, tighter spacing */
  .cer-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 12px 0;
  }
  
  /* Event cards - more compact */
  .cer-grid .cer-card {
    padding: 14px;
    border-radius: 10px;
  }
  
  .cer-grid .cer-card h3 {
    font-size: 17px;
    margin-bottom: 8px;
  }
  
  .cer-grid .cer-card img {
    border-radius: 6px;
    margin-bottom: 10px !important;
  }
  
  .cer-grid .cer-card > div {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
  }
  
  /* Countdown smaller on mobile */
  .cer-countdown {
    font-size: 13px;
  }
  
  /* =====================
     MY RESERVATIONS
     ===================== */
  
  /* Header area */
  .cer-card > h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  /* Filters - full width stacked */
  .cer-filters {
    gap: 8px;
  }
  
  .cer-filters select {
    min-width: 100%;
    padding: 10px 12px;
    font-size: 15px;
  }
  
  .cer-filters button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
  }
  
  /* Mobile cards - tighter on very small screens */
  .cer-res-card {
    padding: 14px;
    border-radius: 10px;
  }
  
  .cer-res-card-title {
    font-size: 15px;
  }
  
  .cer-res-card-row {
    font-size: 13px;
  }
  
  .cer-res-card-actions .cer-action-btn {
    padding: 10px 14px !important;
    font-size: 13px !important;
  }
  
  /* Badge smaller */
  .cer-badge {
    padding: 3px 8px;
    font-size: 11px;
  }
  
  /* ====================
     ATTENDEE MODAL
     ==================== */
  
  #cer-myres-modal {
    max-height: 90vh;
    border-radius: 14px 14px 0 0;
  }
  
  .cer-modal-header {
    padding: 10px 16px 12px;
  }
  
  .cer-modal-title-row h3 {
    font-size: 17px;
  }
  
  .cer-modal-body {
    max-height: calc(90vh - 90px);
    padding: 0;
  }
  
  /* Attendee form table - stack on mobile */
  .cer-attendee-table {
    font-size: 13px;
  }
  
  .cer-attendee-table th,
  .cer-attendee-table td {
    padding: 8px 10px;
  }
  
  /* Stack label/input vertically in narrow cells */
  .cer-attendee-table td:first-child {
    white-space: normal;
    min-width: 80px;
  }
  
  .cer-attendee-table input[type="text"],
  .cer-attendee-table input[type="email"],
  .cer-attendee-table textarea,
  .cer-attendee-table select {
    padding: 10px;
    font-size: 15px; /* Larger for touch */
    -webkit-appearance: none;
  }
  
  /* Additional seats section */
  .cer-additional-seats {
    padding: 12px;
    margin: 12px;
  }
  
  .cer-additional-seats h4 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .cer-additional-form {
    flex-direction: column;
    gap: 8px;
  }
  
  .cer-additional-form input,
  .cer-additional-form button {
    padding: 12px;
    font-size: 15px;
  }
  
  /* Modal footer */
  .cer-modal-footer {
    padding: 12px 16px;
    gap: 8px;
  }
  
  .cer-modal-footer button {
    padding: 12px;
    font-size: 15px;
  }
  
  /* ====================
     EVENT CTA CARD
     ==================== */
  
  .cer-event-cta-card {
    padding: 14px;
    margin-top: 16px;
  }
  
  .cer-event-cta-card h3 {
    font-size: 17px;
    margin-bottom: 12px;
  }
  
  /* Ticket table on event page */
  .cer-ticket-table {
    font-size: 13px;
  }
  
  .cer-ticket-table th {
    padding: 8px 6px;
    font-size: 12px;
  }
  
  .cer-ticket-table td {
    padding: 10px 6px;
  }
  
  .cer-ticket-table input[type="number"] {
    max-width: 60px;
    padding: 8px 4px;
    font-size: 15px;
  }
  
  /* Form submit button */
  .cer-form-actions {
    margin-top: 12px;
    padding-top: 12px;
  }
  
  .cer-form-actions .button,
  .cer-form-actions button {
    width: 100%;
    padding: 14px;
    font-size: 15px;
  }
  
  /* Notices */
  .cer-notice {
    padding: 10px;
    font-size: 13px;
    line-height: 1.4;
  }
  
  /* Cancel modals */
  #cer-cancel-modal > div,
  #cer-cancel-modal-post-cutoff > div {
    margin: 12px;
    padding: 16px;
    max-width: calc(100% - 24px);
    border-radius: 12px;
  }
  
  #cer-cancel-modal h3,
  #cer-cancel-modal-post-cutoff h3 {
    font-size: 17px;
  }
  
  #cer-cancel-modal p,
  #cer-cancel-modal-post-cutoff p {
    font-size: 14px;
  }
  
  #cer-cancel-modal > div > div:last-child,
  #cer-cancel-modal-post-cutoff > div > div:last-child {
    flex-direction: column;
    gap: 8px;
  }
  
  #cer-cancel-modal button,
  #cer-cancel-modal-post-cutoff button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
  }
  
  /* ====================
     GENERAL CARDS
     ==================== */
  
  .cer-card {
    padding: 14px;
    margin: 10px 0;
    border-radius: 10px;
  }
  
  .cer-card h3 {
    font-size: 17px;
  }
  
  .cer-card p {
    font-size: 14px;
    line-height: 1.5;
  }
  
  /* Debug panel - hide on mobile */
  .cer-debug-panel {
    display: none !important;
  }
}

/* ===========================================
   EMERGENCY CONTACT SECTION
   =========================================== */

.cer-emergency-contact-section {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px;
  margin: 16px;
}

.cer-emergency-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cer-emergency-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.cer-emergency-info {
  flex: 1;
}

.cer-emergency-info label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 2px;
}

.cer-emergency-hint {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.cer-emergency-input {
  width: 180px;
  padding: 10px 12px;
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}

@media (max-width: 768px) {
  .cer-emergency-header {
    flex-wrap: wrap;
  }
  
  .cer-emergency-input {
    width: 100%;
    margin-top: 12px;
  }
}

/* ===========================================
   CUTOFF NOTICE
   =========================================== */

.cer-cutoff-notice {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin: 0 16px 16px 16px;
  font-size: 14px;
  color: #991b1b;
}

.cer-cutoff-notice p {
  margin: 4px 0 0 0;
  font-size: 13px;
}

/* ===========================================
   DESKTOP/MOBILE TOGGLE
   =========================================== */

.cer-attendee-desktop {
  display: block;
  padding: 0 16px;
}

/* Two-row attendee block layout */
.cer-attendee-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.cer-attendee-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.cer-attendee-number {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin: 0;
  padding: 0;
  border: none;
}

/* Remove attendee button */
.cer-remove-attendee {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.cer-remove-attendee:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.cer-remove-attendee:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cer-remove-icon {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* Mobile remove button in accordion */
.cer-acc-remove-wrap {
  padding: 12px 0 4px 0;
  margin-top: 12px;
  border-top: 1px dashed #e5e7eb;
}

.cer-remove-mobile {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 13px;
}

.cer-attendee-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.cer-attendee-row:last-child {
  margin-bottom: 0;
}

.cer-field-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cer-field-cell label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin: 0;
}

.cer-field-cell input[type="text"],
.cer-field-cell select,
.cer-field-cell textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

.cer-field-cell input[type="text"]:focus,
.cer-field-cell select:focus,
.cer-field-cell textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Specific field widths */
.cer-field-full_name {
  flex: 2;
}

.cer-field-company {
  flex: 1.5;
}

.cer-field-email {
  flex: 2;
}

.cer-field-dietary {
  flex: 2;
}

.cer-field-notes {
  flex: 1.5;
}

.cer-field-consent {
  flex: 1;
  justify-content: center;
}

/* Consent checkbox styling */
.cer-consent-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  padding: 8px 0;
}

.cer-consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.cer-consent-label span {
  line-height: 1.3;
}

.cer-attendee-mobile {
  display: none;
}

@media (max-width: 768px) {
  .cer-attendee-desktop {
    display: none !important;
  }
  
  .cer-attendee-mobile {
    display: block !important;
    padding: 0 12px 12px 12px;
  }
}

/* ===========================================
   MOBILE ACCORDION
   =========================================== */

.cer-accordion-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.cer-accordion-item.cer-acc-complete {
  border-color: #86efac;
}

.cer-accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  background: #f9fafb;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  gap: 10px;
}

.cer-accordion-item.cer-acc-complete .cer-accordion-header {
  background: #f0fdf4;
}

.cer-acc-toggle {
  color: #9ca3af;
  font-size: 12px;
  transition: transform 0.2s;
}

.cer-accordion-item.cer-acc-open .cer-acc-toggle {
  transform: rotate(90deg);
}

.cer-acc-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cer-acc-status {
  color: #22c55e;
  font-size: 16px;
}

.cer-accordion-content {
  display: none;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}

.cer-accordion-item.cer-acc-open .cer-accordion-content {
  display: block;
}

.cer-acc-field {
  margin-bottom: 14px;
}

.cer-acc-field:last-child {
  margin-bottom: 0;
}

.cer-acc-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 6px;
}

.cer-acc-field input[type="text"],
.cer-acc-field input[type="email"],
.cer-acc-field input[type="tel"],
.cer-acc-field textarea,
.cer-acc-field select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px; /* Prevents iOS zoom */
  background: #fff;
  -webkit-appearance: none;
}

.cer-acc-field textarea {
  min-height: 80px;
  resize: vertical;
}

.cer-acc-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.cer-acc-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.cer-acc-checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
}

/* ============================================
   Confirmation Modal Styles
   ============================================ */
.cer-confirm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cer-confirm-modal.show {
  display: flex;
  opacity: 1;
}

.cer-confirm-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

.cer-confirm-modal.show .cer-confirm-modal-content {
  transform: scale(1) translateY(0);
}

.cer-confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

.cer-confirm-modal-icon-warning {
  background: #fef3c7;
}

.cer-confirm-modal-icon-danger {
  background: #fee2e2;
}

.cer-confirm-modal-icon-success {
  background: #d1fae5;
}

.cer-confirm-modal-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.cer-confirm-modal-text {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #374151;
  line-height: 1.5;
}

.cer-confirm-modal-subtext {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.cer-confirm-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.cer-confirm-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  min-width: 120px;
}

.cer-confirm-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.cer-confirm-btn-secondary:hover {
  background: #e5e7eb;
}

.cer-confirm-btn-danger {
  background: #dc2626;
  color: #fff;
}

.cer-confirm-btn-danger:hover {
  background: #b91c1c;
}

.cer-confirm-btn-danger:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.cer-confirm-btn-primary {
  background: #00316B;
  color: #fff;
}

.cer-confirm-btn-primary:hover {
  background: #002451;
}

/* ============================================
   Toast Notification Styles
   ============================================ */
#cer-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.cer-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  max-width: 380px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cer-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.cer-toast.hiding {
  transform: translateX(120%);
  opacity: 0;
}

.cer-toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.cer-toast-success .cer-toast-icon {
  background: #d1fae5;
  color: #059669;
}

.cer-toast-error .cer-toast-icon {
  background: #fee2e2;
  color: #dc2626;
}

.cer-toast-warning .cer-toast-icon {
  background: #fef3c7;
  color: #d97706;
}

.cer-toast-info .cer-toast-icon {
  background: #dbeafe;
  color: #2563eb;
}

.cer-toast-content {
  flex: 1;
  min-width: 0;
}

.cer-toast-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px 0;
}

.cer-toast-message {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.cer-toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  margin-left: 8px;
  transition: color 0.15s;
}

.cer-toast-close:hover {
  color: #374151;
}

.cer-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e5e7eb;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.cer-toast-progress-bar {
  height: 100%;
  background: #00316B;
  transition: width linear;
}

.cer-toast-success .cer-toast-progress-bar {
  background: #059669;
}

.cer-toast-error .cer-toast-progress-bar {
  background: #dc2626;
}

/* ============================================
   Mobile Responsive - Confirmation Modals
   ============================================ */
@media (max-width: 480px) {
  .cer-confirm-modal {
    padding: 16px;
    align-items: flex-end;
  }
  
  .cer-confirm-modal-content {
    padding: 24px 20px;
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    transform: translateY(100%);
  }
  
  .cer-confirm-modal.show .cer-confirm-modal-content {
    transform: translateY(0);
  }
  
  .cer-confirm-modal-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  
  .cer-confirm-modal-title {
    font-size: 18px;
  }
  
  .cer-confirm-modal-text {
    font-size: 14px;
  }
  
  .cer-confirm-modal-buttons {
    flex-direction: column-reverse;
  }
  
  .cer-confirm-btn {
    width: 100%;
    padding: 14px 20px;
  }
  
  /* Toast on mobile - full width at bottom */
  #cer-toast-container {
    top: auto;
    bottom: 20px;
    left: 16px;
    right: 16px;
  }
  
  .cer-toast {
    max-width: 100%;
    transform: translateY(120%);
  }
  
  .cer-toast.show {
    transform: translateY(0);
  }
  
  .cer-toast.hiding {
    transform: translateY(120%);
  }
}
