/**
 * TakeBerry Riga Delivery Zones & Postcode Shipping CSS
 */

/* --- Checkout Widget --- */
.tbs-riga-shipping-box {
  margin: 12px 0 16px 0;
  padding: 14px 16px;
  background: #fbfbfb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.tbs-riga-free-banner {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.tbs-riga-free-banner.tbs-riga-free-active {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #14532d;
}

.tbs-riga-free-banner.tbs-riga-free-progress {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.tbs-riga-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  align-items: end;
}

@media (max-width: 640px) {
  .tbs-riga-fields-grid {
    grid-template-columns: 1fr;
  }
}

.tbs-riga-shipping-box label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #1f2937;
  margin-bottom: 5px;
}

.tbs-riga-postcode-input,
.tbs-riga-shipping-box select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 9px 12px !important;
  font-size: 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background-color: #fff !important;
  color: #111827 !important;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 40px !important;
}

.tbs-riga-postcode-input:focus,
.tbs-riga-shipping-box select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15) !important;
}

.tbs-riga-pc-matches {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.tbs-riga-pc-matches-title {
  font-size: 12px;
  color: #475569;
  margin-bottom: 6px;
  font-weight: 600;
}

.tbs-riga-pc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tbs-riga-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tbs-riga-chip:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.tbs-riga-chip.tbs-chip-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.tbs-riga-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tbs-riga-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.tbs-riga-map-btn:hover {
  background: #dbeafe;
  color: #1e40af;
  text-decoration: none;
}

.tbs-riga-zone-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.08);
}

/* --- Modal Overlay & Dialog --- */
.tbs-riga-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tbs-riga-modal-overlay.tbs-active {
  opacity: 1;
  visibility: visible;
}

.tbs-riga-modal-dialog {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 1040px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.tbs-riga-modal-overlay.tbs-active .tbs-riga-modal-dialog {
  transform: scale(1);
}

.tbs-riga-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.tbs-riga-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.tbs-riga-modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.2s;
}

.tbs-riga-modal-close:hover {
  color: #111827;
}

.tbs-riga-modal-body {
  padding: 16px;
  overflow-y: auto;
  text-align: center;
}

.tbs-riga-modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* --- Shortcode Container on /piegade/ --- */
.tbs-riga-zones-container {
  margin: 24px 0 32px 0;
  font-family: inherit;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.tbs-riga-calc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.tbs-riga-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.tbs-riga-calc-title {
  font-weight: 700;
  font-size: 16px;
  color: #0f172a;
}

.tbs-riga-free-pill {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.tbs-riga-search-bar {
  position: relative;
}

.tbs-riga-search-bar input {
  width: 100% !important;
  box-sizing: border-box;
  padding: 13px 18px 13px 44px !important;
  font-size: 15px !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #0f172a !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tbs-riga-search-bar input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15) !important;
  outline: none;
}

.tbs-riga-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #64748b;
  pointer-events: none;
}

.tbs-riga-calc-result {
  margin-top: 14px;
}

.tbs-riga-calc-matches {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tbs-riga-calc-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left-width: 6px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.tbs-riga-calc-match-main {
  font-size: 15px;
  color: #0f172a;
}

.tbs-riga-calc-pcs {
  color: #64748b;
  font-size: 13px;
}

.tbs-riga-calc-zone-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #111;
}

.tbs-riga-calc-match-prices {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tbs-riga-calc-price-std {
  font-size: 15px;
  color: #1e293b;
}

.tbs-riga-calc-price-std strong {
  font-size: 17px;
  color: #0f172a;
}

.tbs-riga-calc-price-free {
  background: #dcfce7;
  color: #15803d;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
}

.tbs-riga-calc-price-fixed {
  background: #e0e7ff;
  color: #1e3a8a;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
}

.tbs-riga-calc-empty {
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  font-size: 14px;
}

/* Full-width Map & Zones Banner on /piegade/ */
.tbs-riga-map-hero {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 24px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.tbs-riga-map-hero:hover {
  box-shadow: 0 10px 20px rgba(0,0,0,0.09);
}

.tbs-riga-map-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.tbs-riga-map-hint {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-top: 8px;
}

.tbs-riga-zones-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tbs-riga-zone-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left-width: 6px;
  border-radius: 8px;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.2s, opacity 0.2s;
}

.tbs-riga-zone-card.tbs-highlight {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background-color: #fefce8 !important;
}

.tbs-riga-zone-card.tbs-dim {
  opacity: 0.4;
}

.tbs-riga-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tbs-riga-zone-title {
  font-weight: 800;
  font-size: 16px;
  color: #0f172a;
}

.tbs-riga-zone-price-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tbs-riga-zone-price {
  font-weight: 800;
  font-size: 15px;
  color: #111827;
  padding: 3px 11px;
  border-radius: 14px;
}

.tbs-riga-zone-free-tag {
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 9px;
  border-radius: 12px;
}

.tbs-riga-zone-fixed-tag {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  background: #e0e7ff;
  padding: 3px 9px;
  border-radius: 12px;
}

.tbs-riga-zone-districts {
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
}

.tbs-riga-district-item {
  display: inline;
  padding: 1px 2px;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.tbs-riga-district-item small {
  color: #64748b;
  font-size: 12px;
}

.tbs-riga-district-item.tbs-item-match {
  background-color: #fde047;
  color: #111827;
  padding: 1px 6px;
}

.tbs-riga-district-item.tbs-item-match small {
  color: #1e293b;
  font-weight: 600;
}

.tbs-riga-other-directions {
  margin-top: 12px;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.tbs-riga-other-directions strong {
  color: #334155;
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.tbs-riga-other-directions p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}
