/* ShipBG Checkout Styles */

.shipbg-delivery-type-selector {
	margin-bottom: 20px;
	background: #f9f9f9;
	padding: 15px;
	border-radius: 4px;
	border: 1px solid #ddd;
}

/* 
 * -------------------------------------------------------------------------
 * Delivery Type Cards
 * -------------------------------------------------------------------------
 */
.shipbg-delivery-row td {
	padding: 16px 0 !important;
}

.shipbg-delivery-cards {
	display: flex;
	gap: 15px;
	margin-bottom: 20px;
}

#shipbg-delivery-container {
	padding-top: 4px;
}

.shipbg-card {
	flex: 1;
	border: 2px solid #e5e5e5;
	border-radius: 8px;
	padding: 15px;
	cursor: pointer;
	text-align: center;
	transition: all 0.2s ease;
	background: #fff;
}

.shipbg-card:hover {
	border-color: #b3b3b3;
}

.shipbg-card.active {
	border-color: #7f54b3;
	background: #f8f4ff;
}

.shipbg-card__icon {
	font-size: 24px;
	margin-bottom: 8px;
}

.shipbg-card__title {
	font-weight: 700;
	margin-bottom: 5px;
	color: #333;
}

.shipbg-card__price {
	font-size: 13px;
	color: #666;
}

/* 
 * -------------------------------------------------------------------------
 * Recommendations
 * -------------------------------------------------------------------------
 */
.shipbg-recommendations {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 15px;
}

.shipbg-recommendation {
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 15px;
	background: #fff;
	position: relative;
	transition: all 0.2s ease;
	cursor: pointer;
}

.shipbg-recommendation:hover {
	border-color: #7f54b3;
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.shipbg-recommendation__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.shipbg-recommendation__name {
	font-weight: 600;
	color: #333;
}

.shipbg-recommendation__tag {
	font-size: 11px;
	text-transform: uppercase;
	padding: 2px 6px;
	border-radius: 4px;
	background: #eee;
	color: #666;
	font-weight: 700;
}

.shipbg-recommendation__tag--cheapest {
	background: #e6f4ea;
	color: #1e7e34;
}

.shipbg-recommendation__tag--fastest {
	background: #e8f0fe;
	color: #1967d2;
}

.shipbg-recommendation__details {
	display: flex;
	gap: 15px;
	font-size: 13px;
	color: #555;
	margin-bottom: 8px;
}

.shipbg-recommendation__carrier {
	font-size: 12px;
	color: #888;
}

.shipbg-show-all-points {
	display: block;
	text-align: center;
	margin-top: 15px;
	color: #7f54b3;
	text-decoration: underline;
	cursor: pointer;
	font-weight: 500;
}

.shipbg-pickup-search {
  position: relative;
  margin: 12px 0 8px;
}
.shipbg-pickup-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.shipbg-pickup-search input:focus {
  border-color: #7f54b3;
  outline: none;
  box-shadow: 0 0 0 2px rgba(127, 84, 179, 0.15);
}
.shipbg-pickup-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}
.shipbg-pickup-search-results.open { display: block; }
.shipbg-search-result-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.shipbg-search-result-item:hover { background: #f8f6fc; }
.shipbg-search-result-item:last-child { border-bottom: none; }
.shipbg-search-result-name { font-weight: 500; font-size: 13px; }
.shipbg-search-result-detail { font-size: 12px; color: #666; }
.shipbg-search-result-icon img { width: 20px; height: 20px; border-radius: 3px; }
.shipbg-search-loading { padding: 12px; text-align: center; color: #999; font-size: 13px; }

/* 
 * -------------------------------------------------------------------------
 * Selected State
 * -------------------------------------------------------------------------
 */
.shipbg-recommendation--selected {
	border-color: #7f54b3;
	background: #f8f4ff;
	border-width: 2px;
}

.shipbg-recommendation__check {
	color: #7f54b3;
	font-weight: 700;
	margin-right: 6px;
}

.shipbg-recommendation__price {
	font-weight: 700;
	color: #333;
	white-space: nowrap;
}

/* 
 * -------------------------------------------------------------------------
 * Map Modal (Preserved)
 * -------------------------------------------------------------------------
 */
.shipbg-map-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: flex;
	justify-content: center;
	align-items: center;
}

.shipbg-map-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
}

.shipbg-map-container {
	position: relative;
	width: 90%;
	height: 90%;
	background: #fff;
	display: flex;
	flex-direction: column;
	border-radius: 4px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.shipbg-map-header {
	padding: 15px 20px;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #f9f9f9;
    gap: 15px;
}

.shipbg-map-smart-search {
    flex: 1;
    position: relative;
    max-width: 600px;
}

.shipbg-smart-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.shipbg-smart-search-input {
	width: 100%;
	padding: 10px 40px 10px 36px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	box-sizing: border-box;
    transition: all 0.2s;
}

.shipbg-smart-search-input:focus {
	border-color: #7f54b3;
	outline: none;
	box-shadow: 0 0 0 2px rgba(127, 84, 179, 0.15);
}

.shipbg-smart-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}
.shipbg-smart-search-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.shipbg-smart-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: none;
    line-height: 0;
}
.shipbg-smart-search-clear:hover { color: #666; }
.shipbg-smart-search-wrapper.has-value .shipbg-smart-search-clear { display: block; }

.shipbg-smart-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    display: none;
}
.shipbg-smart-search-results.open { display: block; }

.shipbg-smart-result-group-title {
    padding: 8px 12px;
    background: #f5f5f5;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
}
.shipbg-smart-result-group-title:first-child { border-top: none; }

.shipbg-smart-result-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.shipbg-smart-result-item:hover { background: #f8f4ff; }
.shipbg-smart-result-item:last-child { border-bottom: none; }

.shipbg-smart-result-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #7f54b3;
}
.shipbg-smart-result-icon svg { width: 18px; height: 18px; }
.shipbg-smart-result-icon img { width: 24px; height: 24px; object-fit: contain; }

.shipbg-smart-result-content { flex: 1; min-width: 0; }
.shipbg-smart-result-name { font-weight: 500; font-size: 13px; color: #333; }
.shipbg-smart-result-address { font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shipbg-map-header h3 {
    display: none;
}

.shipbg-map-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	line-height: 1;
	color: #333;
	padding: 0;
    margin-left: 10px;
}

.shipbg-map-body {
	flex: 1;
	display: flex;
	overflow: hidden;
}

/* Sidebar */
.shipbg-map-sidebar {
	width: 35%;
	min-width: 280px;
	max-width: 360px;
	background: #fff;
	border-right: 1px solid #eee;
	display: flex;
	flex-direction: column;
	z-index: 10;
}

/* Removed old search and location inputs */

.shipbg-map-locate-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    color: #7f54b3;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shipbg-map-locate-btn:hover {
    transform: scale(1.1);
    color: #6b4599;
}

.point-distance {
	color: #7f54b3;
	font-weight: 500;
	margin-left: 4px;
    font-size: 12px;
    background: #f8f4ff;
    padding: 2px 6px;
    border-radius: 10px;
}

.shipbg-map-points-list {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

.shipbg-point-item {
	padding: 12px 15px;
	border-bottom: 1px solid #eee;
	cursor: pointer;
    border-left: 3px solid transparent;
	transition: background 0.2s, border-color 0.2s;
}

.shipbg-point-item:hover {
	background: #f9f9f9;
}
.shipbg-lazy-point {
	border-left: 3px solid #e0e0e0;
}

.shipbg-point-item.selected {
	background: #f3f0ff;
	border-left: 3px solid #7f54b3;
}

.shipbg-point-item .point-name {
	font-weight: 600;
	margin-bottom: 2px;
    font-size: 14px;
    color: #333;
}

.shipbg-point-item .point-address {
	font-size: 12px;
	color: #666;
	line-height: 1.3;
}

.shipbg-point-item .point-type {
	font-size: 10px;
	color: #888;
	text-transform: uppercase;
	margin-top: 4px;
	display: inline-block;
	background: #f0f0f0;
	padding: 2px 5px;
	border-radius: 3px;
    font-weight: 600;
}

.shipbg-map-actions {
	padding: 15px;
	border-top: 1px solid #eee;
	background: #f9f9f9;
}

.shipbg-selected-point-info {
	margin-bottom: 10px;
	font-size: 14px;
	padding: 8px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
}

#shipbg-map-confirm-btn {
	width: 100%;
	justify-content: center;
}

/* Map Canvas */
.shipbg-map-canvas {
	flex: 1;
	background: #eee;
}

/* Leaflet Marker Styles */
.shipbg-marker .marker-pin {
	width: 30px;
	height: 42px;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.shipbg-marker svg {
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.shipbg-marker.office svg {
	fill: #d32f2f; /* Red for offices */
}

.shipbg-marker.locker svg {
	fill: #1976d2; /* Blue for lockers */
}

/* 
 * -------------------------------------------------------------------------
 * Responsive
 * -------------------------------------------------------------------------
 */
.shipbg-map-toggle {
  display: none;
  border-bottom: 1px solid #ddd;
  background: #fff;
}
.shipbg-map-toggle button {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.shipbg-map-toggle button.active {
  color: #7f54b3;
  border-bottom-color: #7f54b3;
}

@media (max-width: 768px) {
  .shipbg-delivery-cards { flex-direction: column; }

  .shipbg-map-header {
      padding: 10px;
      gap: 10px;
  }
  
  .shipbg-map-smart-search {
      max-width: none;
  }
  
  .shipbg-smart-search-input {
      font-size: 16px;
      padding: 8px 36px 8px 32px;
  }

  .shipbg-map-container {
    width: 100% !important;
    height: 100dvh !important;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .shipbg-map-body {
    flex-direction: column;
    position: relative;
  }
  .shipbg-map-sidebar {
    width: 100%;
    height: 100%;
    border-right: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 20;
  }
  .shipbg-map-canvas {
    height: 100%;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
  }

  .shipbg-map-toggle { display: flex; }

  .shipbg-map-body[data-view="map"] .shipbg-map-sidebar { display: none; }
  .shipbg-map-body[data-view="list"] .shipbg-map-canvas { display: none; }

  .shipbg-point-item { padding: 16px; min-height: 60px; }
}

.shipbg-empty-state {
	text-align: center;
	color: #888;
	font-size: 13px;
	margin-top: 10px;
	padding: 10px;
}

body.shipbg-map-open {
	overflow: hidden;
}


.woocommerce-shipping-methods {
	display: none !important;
}

.shipbg-customer-marker {
    background: none !important;
    border: none !important;
}
.shipbg-pulse-dot {
    width: 14px;
    height: 14px;
    background: #7f54b3;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.shipbg-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid #7f54b3;
    border-radius: 50%;
    animation: shipbg-pulse 2s ease-out infinite;
}
@keyframes shipbg-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}
.shipbg-customer-tooltip {
    background: #7f54b3 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    padding: 2px 8px !important;
}
.shipbg-customer-tooltip::before {
    border-top-color: #7f54b3 !important;
}

.shipbg-point-select-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  background: #7f54b3;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}
.shipbg-point-select-btn:hover {
  background: #6b4599;
}
.shipbg-point-selected-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  background: #e7f5e9;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.shipbg-carrier-pin.selected .shipbg-pin-body {
    border: 2px solid #7f54b3;
    box-shadow: 0 0 0 3px rgba(127, 84, 179, 0.3), 0 2px 5px rgba(0,0,0,0.25);
}
.shipbg-carrier-pin.selected .shipbg-pin-tip {
    border-top-color: #7f54b3;
}

.shipbg-carrier-pin {
    background: none !important;
    border: none !important;
}
.shipbg-pin-body {
    width: 34px;
    height: 34px;
    background: #fff;
    border-radius: 6px;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    padding: 3px;
}
.shipbg-pin-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 3px;
}
.shipbg-pin-tip {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #666;
    margin: -1px auto 0;
}
.shipbg-map-selected-label {
    display: inline-block;
    padding: 4px 12px;
    background: #e7f5e9;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}