/* ═══════════════════════════════════════════════════════════════════
   CutWave Studio — Custom Offer Modal & International Phone Selector
   ═══════════════════════════════════════════════════════════════════ */

/* Modal Overlay */
.co-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 6, 5, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  visibility: visible;
}
.co-overlay[hidden] {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

/* Modal Container */
.co-modal {
  background: #150A09;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 40px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(216, 30, 49, 0.15);
  transform: translateY(0) scale(1);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.co-overlay[hidden] .co-modal {
  transform: translateY(20px) scale(0.98);
}

/* Custom Scrollbar for Modal */
.co-modal::-webkit-scrollbar {
  width: 8px;
}
.co-modal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.co-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.co-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 30, 49, 0.5);
}

/* Close Button */
.co-close {
  position: absolute;
  top: 24px; right: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #B7A6A0;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
.co-close:hover {
  background: rgba(216, 30, 49, 0.2);
  border-color: rgba(216, 30, 49, 0.5);
  color: #FFF;
  transform: scale(1.06);
}

/* Header */
.co-header {
  margin-bottom: 32px;
  padding-right: 44px;
}
.co-title {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 32px;
  color: #FFF;
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.2;
}
.co-title .glow {
  color: #FF2E2E;
  text-shadow: 0 0 24px rgba(255, 46, 46, 0.4);
}
.co-subtitle {
  color: #B7A6A0;
  font-size: 15px;
  line-height: 1.5;
}

/* Fieldsets */
.co-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 32px 0;
}
.co-legend {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #FFF;
  margin-bottom: 20px;
  padding: 0;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}
.co-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}
.co-row-2 { grid-template-columns: 1fr 1fr; }
.co-row-1 { grid-template-columns: 1fr; }

@media (max-width: 640px) {
  .co-row-2 { grid-template-columns: 1fr; }
  .co-modal { padding: 24px 20px; }
  .co-close { top: 16px; right: 16px; }
  .co-title { font-size: 26px; }
}

/* Fields & Inputs */
.co-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.co-field label {
  font-size: 14px;
  font-weight: 500;
  color: #FFF;
}
.co-req { color: #FF2E2E; }

.co-field input[type="text"],
.co-field input[type="email"],
.co-field input[type="tel"],
.co-field input[type="number"],
.co-field input[type="date"],
.co-field input[type="url"],
.co-field select,
.co-field textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 13px 16px;
  color: #FFF;
  font-size: 14.5px;
  font-family: inherit;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.co-field input:focus,
.co-field select:focus,
.co-field textarea:focus {
  outline: none;
  border-color: #FF2E2E;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(216, 30, 49, 0.2);
}

.co-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}
.co-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B7A6A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ═══════════════════════════════════════════════════════════════════
   WhatsApp / Mobile Country Code Selector
   ═══════════════════════════════════════════════════════════════════ */
.co-phone-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.co-country-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: #FFF;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
  height: auto;
  min-height: 48px;
}

.co-country-btn:hover,
.co-country-btn:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(216, 30, 49, 0.4);
  outline: none;
}

.co-country-btn[aria-expanded="true"] {
  background: rgba(216, 30, 49, 0.12);
  border-color: #FF2E2E;
}

.co-flag {
  font-size: 19px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

.co-dial {
  font-size: 14px;
  font-weight: 600;
  color: #FFF;
  letter-spacing: 0.01em;
}

.co-arrow {
  color: #B7A6A0;
  transition: transform 0.2s ease;
  width: 12px;
  height: 12px;
}

.co-country-btn[aria-expanded="true"] .co-arrow {
  transform: rotate(180deg);
  color: #FF2E2E;
}

.co-phone-wrap input[type="tel"] {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  flex: 1;
  min-width: 0;
  height: auto;
}

/* Country Dropdown Popover */
.co-country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-width: min(340px, calc(100vw - 40px));
  max-height: 290px;
  background: #180D0C;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(216, 30, 49, 0.2);
  z-index: 10002;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: coDropdownAnim 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes coDropdownAnim {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.co-country-dropdown[hidden] {
  display: none !important;
}

.co-country-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #120706;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.co-country-search-box svg {
  color: #B7A6A0;
  flex-shrink: 0;
}

.co-country-search {
  width: 100%;
  background: transparent;
  border: none;
  color: #FFF;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  padding: 0;
}
.co-country-search::placeholder {
  color: #7A6C67;
}

.co-country-list {
  overflow-y: auto;
  max-height: 230px;
  padding: 6px 0;
}

.co-country-list::-webkit-scrollbar {
  width: 6px;
}
.co-country-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.co-country-divider {
  padding: 8px 14px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8C7B76;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.co-country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: #E6D8D4;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}

.co-country-item:hover,
.co-country-item.is-selected {
  background: rgba(216, 30, 49, 0.18);
  color: #FFF;
}

.co-country-item.is-selected {
  font-weight: 600;
}

.co-item-flag {
  font-size: 17px;
  line-height: 1;
}

.co-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.co-item-dial {
  color: #9C8B85;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.co-country-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: #8C7B76;
}

/* Checkbox Chips */
.co-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.co-chip {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  font-size: 14px;
  color: #B7A6A0;
  transition: all 0.2s ease;
  user-select: none;
}
.co-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.co-chip:has(input:checked) {
  background: rgba(216, 30, 49, 0.12);
  border-color: #FF2E2E;
  color: #FFF;
  font-weight: 500;
}
.co-chip:hover {
  background: rgba(255, 255, 255, 0.08);
}
.co-chip:has(input:checked):hover {
  background: rgba(216, 30, 49, 0.18);
}

/* Expand More Section */
.co-expand-wrap {
  margin-bottom: 24px;
}
.co-expand-btn {
  background: transparent;
  border: none;
  color: #FF2E2E;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.co-expand-btn svg {
  width: 18px; height: 18px;
  transition: transform 0.3s ease;
}
.co-expand-btn[aria-expanded="true"] svg {
  transform: rotate(45deg);
}

/* Error Alert */
.co-error {
  background: rgba(216, 30, 49, 0.12);
  border: 1px solid rgba(216, 30, 49, 0.35);
  color: #ff8a93;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

/* Submit Button */
.co-submit {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #FFF;
  font-weight: 600;
  background: linear-gradient(135deg, #FF2E2E, #D81E31);
  box-shadow: 0 4px 18px rgba(216, 30, 49, 0.35);
  transition: all 0.2s ease;
}
.co-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(216, 30, 49, 0.5);
}
.co-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.co-submit svg { width: 20px; height: 20px; }

/* Success State */
.co-success {
  text-align: center;
  padding: 40px 20px;
}
.co-success-icon {
  width: 64px; height: 64px;
  color: #22c55e;
  margin-bottom: 24px;
}
.co-success h3 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 28px;
  color: #FFF;
  margin-bottom: 12px;
}
.co-success p {
  color: #B7A6A0;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.co-success button {
  width: 100%;
  max-width: 240px;
  padding: 14px 28px;
  border-radius: 100px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFF;
  font-weight: 600;
  transition: all 0.2s ease;
}
.co-success button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFF;
}

/* Ensure Nav CTA buttons have pointer cursor */
.nav-cta-new, .nav-cta {
  cursor: pointer !important;
}
