/* PrimelyHost cookie notice */

/* Main card - FIXED: Prevent flickering */
#ph-cookie-notice {
  position: fixed;
  z-index: 99999;
  max-width: 420px;
  width: 90%;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  font-family: "Segoe UI", Arial, sans-serif;
  padding: 18px;
  opacity: 0;                 /* ✅ Start invisible instead of display:none */
  pointer-events: none;       /* ✅ Prevent clicks when hidden */
  color: #222;
}

#ph-cookie-notice.show {
  opacity: 1 !important;
  pointer-events: auto;       /* ✅ Clicks re-enabled */
}

/* Position helpers - Only bottom center by default */
.ph-pos-bottom-center { 
  bottom: 20px; 
  left: 50%; 
  right: auto;              
  transform: translateX(-50%) translateY(20px); 
}
.ph-pos-bottom-center.show {
  transform: translateX(-50%) translateY(0) !important;
}

.ph-pos-bottom-left { 
  bottom: 20px; 
  left: 20px; 
  transform: translateY(20px);
}
.ph-pos-bottom-left.show {
  transform: translateY(0) !important;
}

.ph-pos-bottom-right { 
  bottom: 20px; 
  right: 20px; 
  transform: translateY(20px);
}
.ph-pos-bottom-right.show {
  transform: translateY(0) !important;
}

/* Preview position override */
body.ph-pos-preview-bottom-center #ph-cookie-notice {
  bottom: 20px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateY(0) !important;
}
body.ph-pos-preview-bottom-left #ph-cookie-notice {
  bottom: 20px !important;
  left: 20px !important;
  transform: translateY(0) !important;
}
body.ph-pos-preview-bottom-right #ph-cookie-notice {
  bottom: 20px !important;
  right: 20px !important;
  transform: translateY(0) !important;
}

/* Inner */
.ph-cookie-inner { display: block; position: relative; }
.ph-cookie-message p {
  margin: 0 0 10px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Actions */
.ph-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 6px;
  gap: 8px;
}

.ph-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  min-width: 90px;
}

.ph-btn:focus {
  outline: 2px solid rgba(20,61,143,0.12);
  outline-offset: 2px;
}

.ph-btn.ph-accept {
  background: #143d8f;
  color: #fff;
}
.ph-btn.ph-accept:hover { background: #0f2f6d; }

.ph-btn.ph-decline {
  background: #ebf2ff;
  color: #143d8f;
  border: 1px solid #d9e6ff;
}
.ph-btn.ph-decline:hover { background: #e3ebff; }

.ph-btn.ph-settings {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e6e6e6;
}
.ph-btn.ph-settings:hover { background: #eee; }

/* Preferences */
.ph-cookie-categories {
  background: #fbfbfb;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  margin-top: 12px;
}
.ph-cookie-categories h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #222;
  font-weight: 600;
}

.ph-cat {
  display: flex !important;
  align-items: center !important;
  margin: 12px 0 !important;
  font-size: 14px !important;
  color: #333 !important;
  clear: both !important;
  cursor: pointer;
}

.ph-cat:hover {
  color: #143d8f;
}

/* ✅ Ensure checkboxes are visible - FIXED */
#ph-cookie-notice .ph-cat input[type="checkbox"] {
  appearance: checkbox !important;
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
  width: 18px !important;
  height: 18px !important;
  margin-right: 10px !important;
  cursor: pointer !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-block !important;
  position: relative !important;
  z-index: 1 !important;
}

#ph-cookie-notice .ph-cat input[type="checkbox"]:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Save area */
.ph-cookie-save { 
  margin-top: 15px; 
  text-align: right; 
}
.ph-btn.ph-save {
  background: #143d8f;
  color: #fff;
  border: 1px solid #143d8f;
  width: 100%;
}
.ph-btn.ph-save:hover { background: #0f2f6d; }

/* Floating manage link */
#ph-manage-cookies {
  position: fixed;
  background: #143d8f;
  color: #fff;
  padding: 12px 18px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  z-index: 99998;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  text-align: center;
  min-width: 140px;
  font-weight: 500;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}
#ph-manage-cookies:hover { 
  background: #0f2f6d;
}
#ph-manage-cookies.show {
  display: block;
}

/* Mobile styles - Always center on mobile */
@media (max-width: 768px) {
  #ph-cookie-notice {
    left: 5% !important;
    right: 5% !important;
    width: 90% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 15px;
    transform: translateY(20px) !important;
  }
  
  #ph-cookie-notice.show {
    transform: translateY(0) !important;
  }
  
  .ph-pos-bottom-center,
  .ph-pos-bottom-left,
  .ph-pos-bottom-right {
    left: 5% !important;
    right: 5% !important;
    transform: translateY(20px) !important;
  }
  
  .ph-pos-bottom-center.show,
  .ph-pos-bottom-left.show,
  .ph-pos-bottom-right.show {
    transform: translateY(0) !important;
  }
  
  .ph-cookie-actions { 
    flex-direction: column;
  }
  
  .ph-cookie-actions button {
    width: 100%;
  }
  
  .ph-btn {
    width: 100%;
    margin-bottom: 8px;
  }
  
  #ph-manage-cookies {
    bottom: 15px !important;
    width: auto;
    max-width: 200px;
    margin: 0 auto;
    text-align: center;
    min-width: 120px;
    padding: 10px 15px;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}