.dataTables_wrapper .dataTables_length select {
  width: 100px;
}

.dataTables_wrapper .dataTables_filter input {
  margin-left: 12px;
}

.dataTables_wrapper .dataTables_paginate {
  margin-top: 10px;
}

/* Responsive Data Table Styling */

table.dataTable.dtr-inline.collapsed > tbody > tr > td.child,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child,
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty {
  cursor: default !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty:before {
  display: none !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
  position: relative;
  padding-left: 30px;
  cursor: pointer;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
  content: "";
  border: solid #4a5568; /* Tailwind's gray-700 */
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 3px;
  position: absolute;
  top: 50%;
  left: 5px;
  transform: translateY(-50%) rotate(-45deg);
  transition: transform 0.3s ease;
}
table.dataTable.dtr-inline.collapsed
  > tbody
  > tr.parent
  > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed
  > tbody
  > tr.parent
  > th.dtr-control:before {
  transform: translateY(-50%) rotate(45deg);
}
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th.dtr-control {
  padding-left: 27px;
}
table.dataTable.dtr-inline.collapsed.compact
  > tbody
  > tr
  > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed.compact
  > tbody
  > tr
  > th.dtr-control:before {
  left: 4px;
  height: 14px;
  width: 14px;
  border-radius: 14px;
  line-height: 14px;
  text-indent: 3px;
}
table.dataTable.dtr-column > tbody > tr > td.dtr-control,
table.dataTable.dtr-column > tbody > tr > th.dtr-control,
table.dataTable.dtr-column > tbody > tr > td.control,
table.dataTable.dtr-column > tbody > tr > th.control {
  position: relative;
  cursor: pointer;
}
table.dataTable.dtr-column > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-column > tbody > tr > th.dtr-control:before,
table.dataTable.dtr-column > tbody > tr > td.control:before,
table.dataTable.dtr-column > tbody > tr > th.control:before {
  top: 50%;
  left: 50%;
  height: 0.8em;
  width: 0.8em;
  margin-top: -0.5em;
  margin-left: -0.5em;
  display: block;
  position: absolute;
  color: white;
  border: 0.15em solid white;
  border-radius: 1em;
  box-shadow: 0 0 0.2em #444;
  box-sizing: content-box;
  text-align: center;
  text-indent: 0 !important;
  font-family: "Courier New", Courier, monospace;
  line-height: 1em;
  content: "+";
  background-color: #31b131;
}
table.dataTable.dtr-column > tbody > tr.parent td.dtr-control:before,
table.dataTable.dtr-column > tbody > tr.parent th.dtr-control:before,
table.dataTable.dtr-column > tbody > tr.parent td.control:before,
table.dataTable.dtr-column > tbody > tr.parent th.control:before {
  content: "-";
  background-color: #d33333;
}
table.dataTable > tbody > tr.child {
  padding: 0.5em 1em;
}
table.dataTable > tbody > tr.child:hover {
  background: transparent !important;
}
table.dataTable > tbody > tr.child ul.dtr-details {
  display: inline-block;
  list-style-type: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
table.dataTable > tbody > tr.child ul.dtr-details > li {
  border-bottom: 1px solid #efefef;
  padding: 0.5em 0;
}
table.dataTable > tbody > tr.child ul.dtr-details > li:first-child {
  padding-top: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
  border-bottom: none;
}
table.dataTable > tbody > tr.child span.dtr-title {
  display: inline-block;
  min-width: 75px;
  font-weight: bold;
}
div.dtr-modal {
  position: fixed;
  box-sizing: border-box;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 100;
  padding: 10em 1em;
}
div.dtr-modal div.dtr-modal-display {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 50%;
  height: 50%;
  overflow: auto;
  margin: auto;
  z-index: 102;
  overflow: auto;
  background-color: #f5f5f7;
  border: 1px solid black;
  border-radius: 0.5em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
div.dtr-modal div.dtr-modal-content {
  position: relative;
  padding: 1em;
}
div.dtr-modal div.dtr-modal-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 1px solid #eaeaea;
  background-color: #f9f9f9;
  text-align: center;
  border-radius: 3px;
  cursor: pointer;
  z-index: 12;
}
div.dtr-modal div.dtr-modal-close:hover {
  background-color: #eaeaea;
}
div.dtr-modal div.dtr-modal-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  background: rgba(0, 0, 0, 0.6);
}
@media screen and (max-width: 767px) {
  div.dtr-modal div.dtr-modal-display {
    width: 95%;
  }
}

/* Product Type Toggle - Beautiful Segmented Control */
.product-type-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: 4px;
}

.product-type-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.product-type-btn:hover {
  color: #374151;
  background: rgba(255, 255, 255, 0.5);
}

input[name="product-type"]:checked + .product-type-btn {
  background: white;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  font-weight: 600;
}

input[name="product-type"]:checked + .product-type-btn--all {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

input[name="product-type"]:checked + .product-type-btn--wine {
  background: linear-gradient(135deg, #722f37 0%, #9a3f4b 100%);
  color: white;
}

input[name="product-type"]:checked + .product-type-btn--spirits {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .product-type-btn {
    padding: 6px 8px;
    font-size: 12px;
  }
}

/* City Select Styling */
.city-select-wrapper {
  position: relative;
}

.city-filter-button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.city-filter-button:hover {
  background: #e5e7eb;
}

.city-filter-button:focus {
  outline: none;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 3px rgba(245, 158, 11, 0.1);
}

.city-filter-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.city-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  background: white;
  border-radius: 8px;
  padding: 8px;
  margin-top: 4px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  max-height: 200px;
  overflow-y: auto;
}

.city-dropdown.show {
  display: block;
}

/* City List */
.city-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.city-list li {
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.15s ease;
  margin-bottom: 1px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

.city-list li:hover {
  background: #f8fafc;
  box-shadow: inset 3px 0 0 #f59e0b;
}

.city-list li.city-item-selected {
  background: #fef3c7;
  font-weight: 600;
  color: #92400e;
}

/* Store Filter Styling */
.store-filter-wrapper {
  position: relative;
}

.store-filter-button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.store-filter-button:hover {
  background: #e5e7eb;
}

.store-filter-button:focus {
  outline: none;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 3px rgba(245, 158, 11, 0.1);
}

.store-filter-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.store-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  display: none;
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-top: 4px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  max-height: 300px;
  overflow-y: auto;
}

.store-dropdown.show {
  display: block;
}

.store-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.store-actions {
  display: flex;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px;
}

.store-action-btn {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.store-action-btn:hover {
  color: #374151;
  background: rgba(255, 255, 255, 0.8);
}

.store-action-btn--left {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.store-action-btn--right {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Product Type Toggle Adjustments */
.product-type-toggle {
  margin-top: 0;
}

/* Store Search Styling */
.store-search-wrapper {
  margin: 12px 0 8px 0;
}

.store-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.store-search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #9ca3af;
  z-index: 1;
  pointer-events: none;
}

.store-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  background: #fafafa;
  color: #374151;
  transition: all 0.2s ease;
  outline: none;
}

.store-search-input:focus {
  background: white;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.store-search-input::placeholder {
  color: #9ca3af;
  font-style: italic;
}

.store-search-clear {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(156, 163, 175, 0.1);
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1;
}

.store-search-clear:hover {
  background: rgba(156, 163, 175, 0.2);
  color: #374151;
}

.store-search-clear svg {
  width: 12px;
  height: 12px;
}

/* Store List Container */
.store-list-container {
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px solid #f3f4f6;
  margin-top: 8px;
  padding-top: 8px;
}

/* Enhanced Store List Items */
#storeList li {
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

#storeList li:hover {
  background: #f8fafc;
  box-shadow: inset 3px 0 0 #f59e0b;
}

#storeList li.store-item-hidden {
  display: none;
}

/* Store item checkbox styling */
#storeList input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
}

#storeList label {
  cursor: pointer;
  flex: 1;
  font-weight: 500;
  color: #374151;
}

/* No Results State */
.store-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: #6b7280;
}

.store-no-results-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.store-no-results-text {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin-bottom: 4px;
}

.store-no-results-subtext {
  font-size: 12px;
  color: #9ca3af;
}

/* Store dropdown enhancements */
.store-dropdown {
  border-radius: 10px;
  padding: 20px;
  max-height: 400px;
  overflow: visible;
}

.store-dropdown-header {
  margin-bottom: 16px;
}

/* Custom scrollbar for store list */
.store-list-container::-webkit-scrollbar {
  width: 6px;
}

.store-list-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.store-list-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.store-list-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Store postcode badge styling */
#storeList .text-xs.text-gray-500 {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

/* API Status Indicator */
#api-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 10px;
  cursor: help;
  transition: all 0.3s ease;
}

#api-status.hidden {
  display: none;
}

#api-status.available {
  background-color: rgba(0, 128, 0, 0.15);
  border: 1px solid rgba(0, 128, 0, 0.3);
}

#api-status.unavailable {
  background-color: rgba(128, 0, 0, 0.15);
  border: 1px solid rgba(128, 0, 0, 0.3);
}

#api-status .api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  transition: background-color 0.3s ease;
}

#api-status.available .api-status-dot {
  background-color: #00a000;
  box-shadow: 0 0 5px #00a000;
}

#api-status.unavailable .api-status-dot {
  background-color: #d00000;
  box-shadow: 0 0 5px #d00000;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin: 10px auto;
  border: 3px solid rgba(114, 47, 55, 0.2);
  border-radius: 50%;
  border-top-color: #722f37;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Wine tooltip animations */
.wine-tooltip {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive adjustments for new layout */
@media (max-width: 768px) {
  .city-filter-button,
  .store-filter-button {
    padding: 10px 14px;
    font-size: 13px;
  }

  .city-dropdown,
  .store-dropdown {
    padding: 16px;
    max-height: 350px;
  }

  .city-search-input,
  .store-search-input {
    font-size: 14px;
  }
}
