/**
 * Lagano Shipping v3.0 — Checkout Styles
 * Modern, responsive map modals for DPD, DHL, Orlen, InPost
 */

/* ============================
   Pickup Button & Info
   ============================ */
.lagano-pickup-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #6c2dc7;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s, transform 0.1s;
  line-height: 1.3;
}
.lagano-pickup-btn:hover { background: #5a21a8; }
.lagano-pickup-btn:active { transform: scale(0.98); }
.lagano-pickup-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.lagano-pickup-info {
  background: #f0ebfa;
  border: 1px solid #d4c4f0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 13px;
  color: #333;
  line-height: 1.5;
}

/* ============================
   Shipping Method Logos
   ============================ */
.shipping-method-logo {
  height: 22px;
  width: auto;
  vertical-align: middle;
  margin-left: 6px;
  display: inline-block;
}

/* ============================
   Map Modal (DPD + DHL)
   ============================ */
.lagano-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: lagano-fade-in 0.2s ease;
}
@keyframes lagano-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lagano-modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90vw;
  max-width: 960px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}

.lagano-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 3px solid #6c2dc7;
  flex-shrink: 0;
}

/* Carrier-specific header colors */
.lagano-modal-content[data-courier="inpost"] .lagano-modal-header { border-bottom-color: #ffcd00; }
.lagano-modal-content[data-courier="dpd"] .lagano-modal-header { border-bottom-color: #dc0032; }
.lagano-modal-content[data-courier="dhl"] .lagano-modal-header { border-bottom-color: #ffcc00; }
.lagano-modal-content[data-courier="orlen"] .lagano-modal-header { border-bottom-color: #e84c00; }

.lagano-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
}
.lagano-modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.lagano-modal-close:hover { color: #333; }

.lagano-modal-body {
  padding: 16px 24px 24px;
  overflow-y: auto;
  flex: 1;
}

/* ============================
   Search Row
   ============================ */
.lagano-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.lagano-search-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
.lagano-search-row input:focus { border-color: #6c2dc7; }
.lagano-search-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.lagano-search-btn:hover { opacity: 0.85; }

/* Carrier-specific search button */
.lagano-modal-content[data-courier="inpost"] .lagano-search-btn { background: #ffcd00; color: #333; }
.lagano-modal-content[data-courier="dpd"] .lagano-search-btn { background: #dc0032; color: #fff; }
.lagano-modal-content[data-courier="dhl"] .lagano-search-btn { background: #ffcc00; color: #333; }
.lagano-modal-content[data-courier="orlen"] .lagano-search-btn { background: #e84c00; color: #fff; }

/* ============================
   Map + List Container
   ============================ */
.lagano-map-container {
  display: flex;
  gap: 14px;
  height: 460px;
}
.lagano-map-container #lagano-map {
  flex: 1;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  min-height: 300px;
  background: #f0f0f0;
}

/* ============================
   Points List
   ============================ */
.lagano-points-list {
  width: 300px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}
.lagano-points-list::-webkit-scrollbar { width: 6px; }
.lagano-points-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.lagano-point-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}
.lagano-point-item:hover { background: #f5f5fa; }
.lagano-point-item:last-child { border-bottom: none; }

.point-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.point-addr {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.3;
}
.point-dist {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: #f0f4ff;
  color: #4a6cf7;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}
.point-select-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
  min-height: 36px;
}
.point-select-btn:hover { opacity: 0.85; }

/* Carrier-specific select button colors */
.lagano-modal-content[data-courier="inpost"] .point-select-btn { background: #ffcd00; color: #333; }
.lagano-modal-content[data-courier="dpd"] .point-select-btn { background: #dc0032; }
.lagano-modal-content[data-courier="dhl"] .point-select-btn { background: #d4a000; color: #333; }
.lagano-modal-content[data-courier="orlen"] .point-select-btn { background: #e84c00; }

/* ============================
   Map Popup
   ============================ */
.lagano-popup {
  font-size: 0.82rem;
  line-height: 1.4;
  min-width: 180px;
}
.lagano-popup .popup-name {
  font-weight: 700;
  margin-bottom: 3px;
}
.lagano-popup .popup-addr {
  color: #6b7280;
  margin-bottom: 6px;
}
.popup-select {
  display: block;
  width: 100%;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  min-height: 32px;
}

/* ============================
   Map Markers
   ============================ */
.lagano-marker { background: none !important; border: none !important; }

/* ============================
   Loading / Empty states
   ============================ */
.lagano-loading {
  padding: 3rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
}

/* ============================
   Orlen "Wybierz" buttons
   ============================ */
.lagano-orlen-select {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  background: #e84c00;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  min-height: 40px;
  transition: opacity 0.15s;
}
.lagano-orlen-select:hover { opacity: 0.85; }

/* ============================
   Leaflet Fixes
   ============================ */
.leaflet-container img { max-width: none !important; height: auto; }
.leaflet-tile { width: 256px !important; height: 256px !important; }
.leaflet-container { background: #e8e8e8; font-family: inherit !important; }
.leaflet-control-zoom a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ============================
   Mobile Responsive
   ============================ */
@media (max-width: 640px) {
  .lagano-modal { padding: 0; }
  .lagano-modal-content {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .lagano-modal-header { padding: 14px 16px; }
  .lagano-modal-body { padding: 12px 16px 16px; }
  .lagano-map-container {
    flex-direction: column;
    height: auto;
  }
  .lagano-map-container #lagano-map {
    height: 45vh;
    min-height: 200px;
    flex: none;
  }
  .lagano-points-list {
    width: 100%;
    height: 35vh;
    max-height: none;
    flex: none;
  }
  .point-select-btn {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 10px 16px;
  }
  .lagano-orlen-select {
    min-height: 44px;
  }
  /* Orlen widget mobile */
  .orlen-widget-modal__content { flex-direction: column !important; }
  .orlen-widget-modal__content > ul.orlen-widget-marker-list {
    width: 100% !important; flex: none !important;
    height: 35vh !important; max-height: 35vh !important;
  }
  .orlen-widget-modal__content > .leaflet-container,
  .orlen-widget-modal__content > div:has(.leaflet-container) {
    width: 100% !important; height: 45vh !important; min-height: 200px !important;
  }
}
