/* ==============================
Country Code Home (Category) Page Design =============== */
.ccp-home, .ccp-single { max-width: 1200px; margin: 0 auto; padding: 20px; }
.ccp-table { width: 100%; border-collapse: collapse; overflow-x: auto; display: block; }
.ccp-table th, td { padding: 10px; border: 1px solid #ddd; }
@media (max-width: 768px) { .ccp-table { overflow-x: scroll; } }
/* More styles for boxes, etc. - add shadows, colors for eye-catching */
.ccp-box { display: flex; gap: 20px; }
.ccp-box > div { flex: 1; padding: 20px; background: #f9f9f9; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

.ccp-map { position: relative; }

/* iframe behind dropdown */
.ccp-map iframe {
    position: relative;
    z-index: 0;
    pointer-events: none;
}

/* container */
.ccp-custom-dropdown {
    position: absolute;
    width: 260px;
    z-index: 1001; /* must be > iframe */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* the toggle (looks like a select) */
.ccp-select-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* placeholder / selected text inside toggle */
.ccp-select-toggle .ccp-placeholder {
    color: #333;
    font-weight: 500;
}

/* arrow */
.ccp-select-toggle .ccp-arrow {
    margin-left: 8px;
    color: #666;
    font-size: 12px;
}

/* the dropdown panel */
.ccp-dropdown-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    max-height: 320px;
    overflow: hidden;
    display: none; /* default hidden */
    z-index: 1002;
}

/* search input at top */
.ccp-search-input {
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    outline: none;
}

/* items container scroll */
.ccp-items {
    max-height: 220px;
    overflow-y: auto;
}

/* each item */
.ccp-dropdown-item {
    padding: 8px 10px;
    cursor: pointer;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* hover / highlight */
.ccp-dropdown-item:hover,
.ccp-dropdown-item.highlight {
    background-color: #f5f5f5;
}

/* small responsive tweak */
@media (max-width: 420px) {
    .ccp-custom-dropdown { width: 200px; }
}

/* ============================
  Updated CCP Single — Material-like Modern Styles
  Replace/append this into style.css
   ============================ */

/* Root palette + typography */
:root{
  --ccp-bg:#f7fbff;
  --card-bg:#ffffff;
  --muted:#6b7280;
  --accent-primary-1: linear-gradient(90deg,#1565c0 0%,#42a5f5 100%);
  --accent-primary-2: linear-gradient(90deg,#1e88e5 0%,#64b5f6 100%);
  --surface-shadow: 0 10px 30px rgba(8,18,28,0.08), 0 2px 6px rgba(8,18,28,0.04);
  --elev-shadow: 0 14px 40px rgba(8,18,28,0.12);
  --radius: 14px;
  --glass: rgba(255,255,255,0.72);
  --text: #0f172a;
  --muted-2: #9ca3af;
  font-family: "Roboto", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial;
}

/* Page container */
.ccp-single {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 16px;
  color: var(--text);
  background: var(--ccp-bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Title */
.ccp-page-header { margin-bottom: 14px; display:flex; flex-wrap:wrap; align-items:baseline; gap:12px; }
.ccp-title { font-size: 1.7rem; margin:0; font-weight:700; letter-spacing:-0.02em; color:var(--text); }
.ccp-sub { font-size: .95rem; color:var(--muted); margin-left:8px; font-weight:500; display:inline-flex; align-items:center; gap:8px; }
.ccp-code { background: rgba(33,150,243,0.12); padding:6px 10px; border-radius:8px; color:#0b63a8; font-weight:700; margin-left:6px; font-size:.95rem; }

/* Header section (map + overlay) */
.ccp-header-section {
  position:relative;
  border-radius:18px;
  overflow:hidden;
  box-shadow: var(--surface-shadow);
  margin-bottom:20px;
  background: linear-gradient(180deg,#e9f5ff 0%, #f7fbff 100%);
}

/* Map wrap & iframe */
.ccp-map-wrap { position:relative; width:100%; height:420px; min-height:260px; }
.ccp-map-iframe { position:absolute; inset:0; width:100%; height:100%; border:0; transform: scale(1.03); filter: saturate(.92) contrast(.96) brightness(.95); }

/* subtle glass overlay on map for readability */
.ccp-map-overlay {
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(6,30,63,0.10) 0%, rgba(255,255,255,0.03) 40%);
  pointer-events:none;
}

/* Overlay grid: left codes / right how-to */
.ccp-overlay-grid {
  position: absolute;
  inset: 18px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
  z-index: 3;
}

/* center overlay grid on large screens */
@media (min-width:1200px){
  .ccp-overlay-grid { max-width: calc(1200px - 64px); margin: 0 auto; left: 50%; transform: translateX(-50%); right: auto; }
}

/* Codes column */
.ccp-codes-col {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-start;
  align-content:flex-start;
}

/* overlay small cards */
.ccp-overlay-card {
  flex: 0 1 clamp(120px, 22%, 220px);
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 14px;
  color: white;
  box-shadow: var(--elev-shadow);
  display:flex;
  flex-direction:column;
  gap:6px;
  justify-content:center;
  transition: transform .18s cubic-bezier(.2,.9,.3,1), box-shadow .18s ease;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.06);
}

/* hover lift */
.ccp-overlay-card:hover { transform: translateY(-8px); box-shadow: 0 28px 60px rgba(8,18,28,0.14); }

/* label + value */
.card-label { font-size: .82rem; color: rgba(255,255,255,0.9); margin:0; opacity:0.92; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.card-value { font-size: 1.45rem; font-weight:800; }

/* color variants (kept high-contrast for accessibility) */
.card-code { background: linear-gradient(135deg,#2196f3 0%,#1e88e5 100%); color:#fff; }
.card-iso2 { background: linear-gradient(135deg,#43a047 0%,#66bb6a 100%); color:#fff; }
.card-iso3 { background: linear-gradient(135deg,#ff9800 0%,#ffb74d 100%); color:#fff; }

/* If you have extra overlay cards elsewhere, ensure they look subtle (fallback) */
.ccp-overlay-card:not(.card-code):not(.card-iso2):not(.card-iso3) {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.85));
  color: var(--text);
  border: 1px solid rgba(15,23,42,0.04);
}

/* How to call column (right) */
.ccp-how-to-col { display:flex; justify-content:flex-end; align-items:start; }
.desktop-how-to { display: block; }
.ccp-how-to-call {
  width:100%;
  max-width:360px;
  background: linear-gradient(180deg, var(--glass), rgba(255,255,255,0.84));
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--surface-shadow);
  border: 1px solid rgba(15,23,42,0.04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ccp-how-to-call:hover { transform: translateY(-4px); }

/* heading */
.ccp-how-to-call h2 { margin:0 0 8px 0; font-size:1.05rem; color:var(--text); }

/* form layout: columns on desktop (keeps it compact), stacked on mobile */
.ccp-dial-form { display:flex; flex-direction:column; gap:10px; }
.ccp-dial-form label { display:block; width:100%; }

/* selects & button — fixed so they never overflow */
.ccp-dial-form select,
.ccp-dial-form button {
  -webkit-appearance:none; appearance:none;
  padding: 10px 12px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,0.06);
  font-size: .95rem;
  width:100%;
  box-sizing: border-box;
  color: var(--text);
  font-weight:600;
  position: relative;
}

.ccp-dial-form select {
  background: #ffffff;
}

.ccp-dial-form button {
  background: #3A9ACF;
  color: #ffffff;
}

/* Add arrow back to selects */
.ccp-dial-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

/* nice subtle inner shadow for selects */
.ccp-dial-form select { box-shadow: inset 0 1px 0 rgba(15,23,42,0.02); }

/* accessible placeholder color */
.ccp-dial-form select option[disabled], .ccp-dial-form select option[value=""] { color: var(--muted-2); font-weight:500; }

/* actions row: align right on desktop */
.form-row.form-actions { display:flex; justify-content:flex-end; gap:8px; }

/* primary button with gradient + proper contrast */
.btn-primary {
  background: linear-gradient(90deg,#1565c0 0%,#42a5f5 100%);
  color: white;
  border:none;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
  box-shadow: 0 10px 30px rgba(33,150,243,0.12);
  transition: transform .16s ease, box-shadow .16s ease;
  width: 100%;
  text-align:center;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(33,150,243,0.14); }
.btn-primary:active { transform: translateY(-1px); }

/* focus visible for keyboard users */
.ccp-dial-form select:focus, .ccp-dial-form button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(33,150,243,0.12);
  border-color: rgba(33,150,243,0.28);
}

/* Time/weather cards */
.ccp-time-weather { margin: 18px 0; }
.time-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(120px,1fr));
}
.ccp-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.9));
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(8,18,28,0.06);
  border: 1px solid rgba(15,23,42,0.04);
}
.ccp-card .card-label { color:var(--muted); font-size:.86rem; margin-bottom:6px; }
.ccp-card .card-value { font-size: 1.05rem; font-weight:700; color:var(--text); }

/* Main Content Layout */
.ccp-main-content {
  display: flex;
  gap: 24px;
  margin-top: 18px;
}

.ccp-sidebar {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ccp-sidebar-card {
  background: linear-gradient(135deg, #fff 0%, #fff 100%);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(8,18,28,0.06);
  color: var(--text);
  border: 1px solid rgba(15,23,42,0.03);
}

.ccp-sidebar-card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.ccp-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ccp-content-article {
  background: linear-gradient(135deg, #fff 0%, #fff 100%);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(8,18,28,0.06);
  color: var(--text);
  border: 1px solid rgba(15,23,42,0.03);
}

.ccp-content-article h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.ccp-content-article .card-body p,
.ccp-content-article .card-body ul {
  margin: 0 0 8px;
  line-height: 1.55;
  color: #374151;
}

.simple-links a { color:#0f62a8; text-decoration:none; font-weight:700; }
.simple-links a:hover { text-decoration: underline; }

/* secondary button */
.btn-secondary { display:inline-block; padding:8px 12px; border-radius:10px; background: #fff; border:1px solid rgba(15,23,42,0.06); color:var(--text); text-decoration:none; font-weight:700; }

/* Mobile How to Call Section */
.ccp-how-to-call-mobile {
  display: none; /* Hidden by default on desktop */
}

/* ========== Responsive breakpoints & mobile behavior ========== */

@media (max-width: 1100px) {
  .ccp-overlay-grid { grid-template-columns: 1fr 320px; inset:12px; gap:12px; }
  .time-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  /* reduce map height so page remains compact */
  .ccp-map-wrap { height: 300px; }

  /* stack overlay grid: codes first, how-to below */
  .ccp-overlay-grid {
    grid-template-columns: 1fr;
    align-items:start;
  }
  .ccp-codes-col { order: 1; width:100%; }
  .desktop-how-to { display: none; } /* Hide desktop How to Call on mobile */
  .ccp-how-to-call { max-width: 100%; width:100%; margin-top:12px; }

  .time-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px){
  .ccp-map-wrap { height: 200px; } /* Reduced height for mobile */

  /* overlay cards: show only the 3 important ones on mobile (country code, ISO2, ISO3) */
  .ccp-overlay-card { min-width: 120px; max-width: 100%; width:100%; }
  .ccp-overlay-card:not(.card-code):not(.card-iso2):not(.card-iso3) { display:none !important; }

  .ccp-how-to-call-mobile { display: block; } /* Show mobile How to Call on mobile */
  .ccp-how-to-call-mobile .ccp-how-to-call { max-width: 100%; padding: 14px; border-radius: 12px; }
  .form-row.form-actions { justify-content: center; }
  .btn-primary { width: 100%; padding: 12px; border-radius: 10px; }

  /* ensure time cards single column */
  .time-cards { grid-template-columns: 1fr; }

  /* Stack sidebar and content area vertically on mobile */
  .ccp-main-content {
    flex-direction: column;
  }
  .ccp-sidebar {
    flex: 0 0 100%;
  }
  .ccp-content-area {
    flex: 1;
  }
}

/* Accessibility utility (already present) */
.screen-reader-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* tiny responsive fix so selects show ellipsis when long */
.ccp-dial-form select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
