/* ============================================
   Multi Country Currency Switcher
   Simple, Clean, Mobile First
   ============================================ */

/* Wrapper - Takes full width on mobile if needed */
.mcc-switcher-wrapper {
    position: relative;
    display: inline-block;
    width: auto;
    max-width: 100%;
}

/* Selected Country Display */
.mcc-current-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #222;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.mcc-current-display:active {
    background: #f5f5f5;
}

/* Flag */
.mcc-flag {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

/* Currency Code */
.mcc-currency-code {
    font-weight: 600;
    color: #000;
}

/* Arrow */
.mcc-dropdown-arrow {
    font-size: 10px;
    color: #777;
    transition: transform 0.2s;
    margin-left: 2px;
}

.mcc-switcher-wrapper.active .mcc-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.mcc-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 9999;
    padding: 5px 0;
    max-height: 350px;
    overflow-y: auto;
}

/* Show dropdown */
.mcc-switcher-wrapper.active .mcc-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Items */
.mcc-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
    -webkit-tap-highlight-color: transparent;
}

.mcc-dropdown-item:last-child {
    border-bottom: none;
}

.mcc-dropdown-item:active {
    background: #f5f5f5;
}

.mcc-dropdown-item.active {
    background: #e8f0fe;
    color: #1a73e8;
}

.mcc-dropdown-item .mcc-flag {
    font-size: 20px;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.mcc-dropdown-item .mcc-country-name {
    flex: 1;
    font-weight: 500;
}

.mcc-dropdown-item .mcc-currency {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    flex-shrink: 0;
}

/* Tax info */
.mcc-tax-info {
    font-size: 11px;
    opacity: 0.6;
    margin-left: 4px;
}

/* ============================================
   MOBILE STYLES (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
  /* Wrapper ko proper click context dena */
  .mcc-switcher-wrapper {
    display: block;
    width: 100%;
    position: relative;
    z-index: 9997;
  }
  
  /* Button ko clickable banaye */
  .mcc-current-display {
    display: flex;
    width: 100%;
    justify-content: space-between;
    font-size: 12px;
    border-radius: 12px;
    background: transparent;
    border: none;
    white-space: nowrap;
    padding: 0;
    margin: 0;
    outline: none;
    gap: 0;
    line-height: normal;
    cursor: pointer;           /* ← Cursor pointer */
    pointer-events: auto;     /* ← Click events enabled */
    position: relative;
    z-index: 9999;
  }
  
  .mcc-current-display .mcc-flag {
    font-size: 20px;
    padding: 0;
    margin: 0;
    pointer-events: none;     /* Flag click interfere na kare */
  }
  
  .mcc-current-display .mcc-currency-code {
    font-size: 12px;
    padding: 0;
    margin: 0;
    pointer-events: none;     /* Text click interfere na kare */
  }
  
  .mcc-current-display .mcc-dropdown-arrow {
    font-size: 12px;
    margin-left: auto;
    padding: 0;
    margin-right: 0;
    pointer-events: none;     /* Arrow click interfere na kare */
  }
  
  /* Bottom Sheet Dropdown - High z-index */
  .mcc-dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
    max-height: 60vh;
    transform: translateY(100%);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    padding: 10px 0;
    border: none;
    z-index: 99999 !important;   /* ← HIGH z-index */
    background: white;
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;  /* ← Smooth scroll mobile */
  }
  
  .mcc-switcher-wrapper.active .mcc-dropdown-menu {
    transform: translateY(0);
  }
  
  /* Dropdown items - Properly Clickable */
  .mcc-dropdown-item {
    padding: 16px 20px;
    font-size: 16px;
    gap: 14px;
    display: flex;
    align-items: center;
    cursor: pointer !important;       /* ← Pointer cursor */
    pointer-events: auto !important;  /* ← Click events forced */
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    z-index: 99999;
  }
  
  .mcc-dropdown-item:active {
    background: rgba(0,0,0,0.1);
  }
  
  .mcc-dropdown-item .mcc-flag {
    font-size: 24px;
    width: 32px;
    pointer-events: none;
  }
  
  .mcc-dropdown-item .mcc-country-name {
    font-size: 16px;
    pointer-events: none;
    flex: 1;
  }
  
  .mcc-dropdown-item .mcc-currency {
    font-size: 15px;
    pointer-events: none;
  }
  
  /* Dark overlay - should allow clicks only on dropdown */
  .mcc-switcher-wrapper.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    animation: fadeIn 0.2s;
    cursor: pointer;
    pointer-events: auto;    /* Overlay click se dropdown bandh ho jayega */
  }
  
  /* Ensure dropdown items are above overlay */
  .mcc-switcher-wrapper.active .mcc-dropdown-menu {
    z-index: 99999 !important;
  }
  
  /* Handle safe area for notched phones */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mcc-dropdown-menu {
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .mcc-current-display {
    background: transparent;
    border: none;
    color: white;
  }
  
  .mcc-dropdown-menu {
    background: #2a2a2a;
  }
  
  .mcc-dropdown-item {
    color: #e0e0e0;
  }
  
  .mcc-dropdown-item:active {
    background: #3a3a3a;
  }
  
  .mcc-dropdown-item.active {
    background: #1a3a5a;
    color: #60a5fa;
  }
  
  .mcc-dropdown-item .mcc-currency {
    color: #aaa;
  }
}