/* PostNet Store Selector - Modern Design */

/* Main container */
.postnet-store-selector {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}

/* Tab headers with icons */
.postnet-tab-headers {
  display: flex;
  background-color: #f8f8f8;
  border-bottom: 1px solid #eaeaea;
  position: relative;
}

.postnet-tab-header {
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
  position: relative;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.postnet-tab-header.active {
  background-color: #fff;
  color: #2271b1;
  border-bottom: none;
}

.postnet-tab-header.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #2271b1;
}

.postnet-tab-header:hover:not(.active) {
  background-color: #f0f0f0;
}

.postnet-tab-header svg,
.postnet-tab-header img {
  width: 18px;
  height: 18px;
}

/* Tab content */
.postnet-tab-content {
  display: none;
  padding: 0;
}

.postnet-tab-content.active {
  display: block;
}

/* Map styles */
#postnet-map-container {
  height: 450px;
  width: 100%;
}

/* Selected store details panel */
#postnet-selected-store-details {
  padding: 16px 20px;
  display: none;
  background-color: #f9f9f9;
  border-top: 1px solid #eaeaea;
}

#postnet-selected-store-details.active {
  display: block;
}

/* Store navigation header */
.postnet-store-nav {
  display: flex;
  align-items: center;
  padding: 12px 0;
  justify-content: space-between;
  border-bottom: 1px solid #eaeaea;
}

.postnet-location-counter {
  font-size: 14px;
  color: #666;
  text-align: center;
}

.postnet-store-nav-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0;
  text-align: center;
  flex: 1;
  padding: 0 10px;
}

.postnet-nav-btn {
  background-color: transparent;
  border: 1px solid #ddd;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: all 0.2s ease;
  min-width: 32px;
  height: 32px;
}

.postnet-nav-btn:hover:not(:disabled) {
  border-color: #2271b1;
  color: #2271b1;
}

.postnet-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.postnet-nav-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.postnet-store-address {
  margin-bottom: 8px;
  color: #555;
  line-height: 1.5;
}

.postnet-store-contact {
  font-size: 14px;
  color: #666;
}

/* List styles */
.postnet-stores-list {
  max-height: 450px;
  overflow-y: auto;
}

.postnet-store-item {
  padding: 16px 20px;
  border-bottom: 1px solid #eaeaea;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.postnet-store-item:hover {
  background-color: #f5f9ff;
}

.postnet-store-item.selected {
  background-color: #f0f7ff;
  border-left: 4px solid #2271b1;
  padding-left: 16px;
}

.postnet-store-item:last-child {
  border-bottom: none;
}

.postnet-store-name {
  font-weight: 600;
  font-size: 15px;
  color: #333;
  display: block;
  flex: 1;
}

.postnet-store-item.selected .postnet-store-name {
  color: #2271b1;
}

.postnet-store-address-details {
  font-size: 14px;
  color: #555;
  line-height: 1.4;
}

.postnet-store-loading {
  font-style: italic;
  color: #999;
  font-size: 13px;
  margin-top: 4px;
}

.postnet-select-btn {
  background-color: #2271b1;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.postnet-select-btn:hover {
  background-color: #135e96;
}

/* Pagination styles */
.postnet-pagination {
  display: flex;
  justify-content: center;
  padding: 15px;
  background-color: #f9f9f9;
  border-top: 1px solid #eaeaea;
}

.postnet-page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  margin: 0 3px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  transition: all 0.2s;
}

.postnet-page-number:hover:not(.active) {
  border-color: #2271b1;
  color: #2271b1;
}

.postnet-page-number.active {
  background: #2271b1;
  color: white;
  border-color: #2271b1;
}

.postnet-list-page {
  display: none;
}

.postnet-list-page.active {
  display: block;
}

/* Dropdown Styles */
.wc-block-components-form-label {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
  display: block;
}

/* For classic checkout */
.woocommerce-checkout .postnet-store-selector {
  margin-bottom: 30px;
}

/* For checkout blocks */
.wp-block-woocommerce-checkout .postnet-store-selector {
  margin: 0 0 24px;
}

/* Custom Google Map marker styling */
.gm-style .gm-style-iw {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
}

/* Mobile responsive styles */
@media only screen and (max-width: 768px) {
  #postnet-map-container {
    height: 350px;
  }
  
  .postnet-tab-header {
    padding: 12px;
    font-size: 14px;
  }
  
  .postnet-store-name {
    font-size: 14px;
  }
  
  .postnet-store-address-details {
    font-size: 13px;
  }
  
  .postnet-store-nav-title {
    font-size: 15px;
  }
  
  .postnet-nav-btn {
    padding: 4px 8px;
    font-size: 12px;
  }
}

/* Validation message */
#postnet-store-validation {
  color: #cc1818;
  margin-top: 8px;
  font-size: 14px;
  padding: 6px 10px;
  border-left: 3px solid #cc1818;
  background-color: #fef8f8;
}

/* List view radio button styles */
.postnet-store-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.postnet-store-radio input[type="radio"] {
  margin: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Map view store details layout */
.postnet-store-details-container {
  display: flex;
  flex-direction: column;
}

.postnet-store-content {
  padding-top: 16px;
}

.postnet-store-header {
  font-weight: 600;
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
}

.postnet-store-section {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.postnet-store-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.postnet-section-title {
  font-weight: 600;
  font-size: 14px;
  color: #555;
  margin-bottom: 6px;
}

/* Collection Addresses Section Styles */
#collection-addresses-section {
  margin-top: 30px;
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
}

#collection-addresses-section h2 {
  margin-top: 0;
  color: #333;
  font-size: 20px;
  border-bottom: 2px solid #2271b1;
  padding-bottom: 10px;
}

#collection-addresses-section p {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.collection-address {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collection-address h3 {
  margin-top: 0;
  color: #2271b1;
  font-size: 18px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.collection-address .form-table {
  margin-bottom: 20px;
}

.collection-address .form-table th {
  width: 200px;
  padding: 12px 10px 12px 0;
  vertical-align: top;
  font-weight: 600;
  color: #333;
}

.collection-address .form-table td {
  padding: 12px 10px;
  vertical-align: top;
}

.collection-address input[type="text"],
.collection-address select {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.collection-address input[type="text"]:focus,
.collection-address select:focus {
  border-color: #2271b1;
  outline: none;
  box-shadow: 0 0 0 1px #2271b1;
}

.collection-address .description {
  margin-top: 5px;
  font-size: 13px;
  color: #666;
  font-style: italic;
}

.collection-address .remove-address {
  background-color: #dc3232;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.collection-address .remove-address:hover {
  background-color: #a00;
}

#add-collection-address {
  background-color: #2271b1;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 10px;
}

#add-collection-address:hover {
  background-color: #135e96;
}

/* Responsive styles for collection addresses */
@media only screen and (max-width: 768px) {
  #collection-addresses-section {
    padding: 15px;
    margin-top: 20px;
  }
  
  .collection-address {
    padding: 15px;
  }
  
  .collection-address .form-table th {
    width: auto;
    display: block;
    padding: 8px 0 5px 0;
  }
  
  .collection-address .form-table td {
    padding: 0 0 15px 0;
    display: block;
  }
  
  .collection-address input[type="text"],
  .collection-address select {
    width: 100% !important;
    max-width: none;
  }
}

/* Collection Address Field Styling for Admin Orders */
.collection-address-required {
  border-left: 4px solid #dc3232 !important;
  background-color: #fef8f8 !important;
}

.collection-address-required h3::after {
  content: ' *';
  color: #dc3232;
  font-weight: bold;
}

.collection-address-required .description {
  color: #dc3232 !important;
  font-weight: 600;
}

/* Warning styling for incomplete collection address selection */
.collection-address-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 10px 15px;
  margin: 10px 0;
  color: #856404;
}

.collection-address-warning::before {
  content: '⚠️ ';
  margin-right: 8px;
}

/* Success styling for valid collection address selection */
.collection-address-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  padding: 10px 15px;
  margin: 10px 0;
  color: #155724;
}

.collection-address-success::before {
  content: '✅ ';
  margin-right: 8px;
}
