/* ==========================================================================
   AVAILABILITY CELLS
   Stock availability display styles
   ========================================================================== */

/* Availability cell layout */
.availability-cell {
  vertical-align: middle !important;
  /* Center content vertically in cell */
  white-space: normal !important;
  word-break: normal !important;
  /* Never break mid-word */
  overflow-wrap: break-word !important;
  /* Break at word boundaries only */
  hyphens: none !important;
  /* Disable hyphenation */
  text-align: left;
  line-height: 1 !important;
  /* Use CSS variable for dynamic width, fallback to 88px */
  min-width: var(--col-stock-width-mobile, 5.25rem);
  width: var(--col-stock-width-mobile, 5.25rem);
  max-width: var(--col-stock-width-mobile, 5.25rem);
  overflow: visible !important;
  /* Never hide overflow to allow text wrapping */
}

/* NUCLEAR OPTION: Force wrapping on availability links */
/* This targets the link specifically with high specificity */
.availability-cell .availability-store-item .availability-store-link,
td.availability-cell .availability-store-item .availability-store-link,
.availability-store-link,
a.availability-store-link {
  white-space: normal !important;
  overflow-wrap: break-word !important; /* Standard wrapping only */
  word-break: normal !important; /* Standard breaking only */
  hyphens: none !important;
  min-width: 0 !important;
  flex-shrink: 1 !important;
  display: inline !important; /* Allow normal text flow within the flex item */
}

/* Expanded availability cell - wider to accommodate store names */
/* Base width - DESKTOP ONLY - mobile handled by media query below */
@media (min-width: 844px) {
  .availability-cell.availability-expanded,
  td.availability-cell.availability-expanded,
  .table-container td.availability-cell.availability-expanded,
  #beer-table td.availability-cell.availability-expanded,
  #wine-table td.availability-cell.availability-expanded,
  #spirits-table td.availability-cell.availability-expanded,
  #cider-table td.availability-cell.availability-expanded,
  td:nth-child(4).availability-cell.availability-expanded {
    min-width: 9.75rem !important;
    /* 156px - Enough for "ubc wesbrook vill: 1" */
    width: 9.75rem !important;
    /* Force exact width - no auto */
    max-width: 9.75rem !important;
    /* 156px - Constrain to fit */
    overflow: visible !important;
    /* Never hide overflow */
    text-overflow: clip !important;
    /* Never show ellipsis */
    box-sizing: border-box !important;
    /* Include padding in width */
  }
}

/* CRITICAL: Mobile portrait - keep fixed width to prevent layout shift */
/* This applies to ALL browsers, not just Safari iOS */
@media (max-width: 843px) {
  .availability-cell.availability-expanded,
  td.availability-cell.availability-expanded,
  .table-container td.availability-cell.availability-expanded,
  #beer-table td.availability-cell.availability-expanded,
  #wine-table td.availability-cell.availability-expanded,
  #spirits-table td.availability-cell.availability-expanded,
  #cider-table td.availability-cell.availability-expanded,
  td:nth-child(4).availability-cell.availability-expanded {
    min-width: var(--col-stock-width-mobile, 5.25rem) !important;
    width: var(--col-stock-width-mobile, 5.25rem) !important;
    max-width: var(--col-stock-width-mobile, 5.25rem) !important;
    overflow: visible !important;
  }
}

/* Safari iOS renders fonts wider - BUT we must respect fixed column widths on mobile to prevent shift */
@supports (-webkit-touch-callout: none) {
  /* Only apply wider width on larger screens */
  @media (min-width: 844px) {
    .availability-cell.availability-expanded,
    td.availability-cell.availability-expanded,
    .table-container td.availability-cell.availability-expanded,
    #beer-table td.availability-cell.availability-expanded,
    #wine-table td.availability-cell.availability-expanded,
    #spirits-table td.availability-cell.availability-expanded,
    #cider-table td.availability-cell.availability-expanded,
    td:nth-child(4).availability-cell.availability-expanded {
      min-width: 10.5rem !important;
      width: 10.5rem !important;
      max-width: 10.5rem !important;
    }
  }
  
  /* On mobile, use CSS variable for dynamic width */
  @media (max-width: 843px) {
    .availability-cell.availability-expanded,
    td.availability-cell.availability-expanded,
    .table-container td.availability-cell.availability-expanded,
    #beer-table td.availability-cell.availability-expanded,
    #wine-table td.availability-cell.availability-expanded,
    #spirits-table td.availability-cell.availability-expanded,
    #cider-table td.availability-cell.availability-expanded,
    td:nth-child(4).availability-cell.availability-expanded {
      min-width: var(--col-stock-width-mobile, 5.25rem) !important;
      width: var(--col-stock-width-mobile, 5.25rem) !important;
      max-width: var(--col-stock-width-mobile, 5.25rem) !important;
      overflow: visible !important;
    }
  }
}

/* Mobile portrait - need wider cell for store names */
/* CRITICAL: Must override col element width with table-layout: fixed */
@media (max-width: 843px) {
  /* CRITICAL: Keep column 1 at normal width to prevent shifting - lock both colgroup and cells */
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(1),
  .table-container.has-expanded-cell colgroup col:nth-child(1),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(1),
  table.has-expanded-cell colgroup col:nth-child(1),
  .table-container:has(td.availability-cell.availability-expanded) th:nth-child(1),
  .table-container.has-expanded-cell th:nth-child(1),
  .table-container:has(td.availability-cell.availability-expanded) td:nth-child(1),
  .table-container.has-expanded-cell td:nth-child(1),
  #beer-table:has(td.availability-cell.availability-expanded) th:nth-child(1),
  #beer-table.has-expanded-cell th:nth-child(1),
  #beer-table:has(td.availability-cell.availability-expanded) td:nth-child(1),
  #beer-table.has-expanded-cell td:nth-child(1),
  #wine-table:has(td.availability-cell.availability-expanded) th:nth-child(1),
  #wine-table.has-expanded-cell th:nth-child(1),
  #wine-table:has(td.availability-cell.availability-expanded) td:nth-child(1),
  #wine-table.has-expanded-cell td:nth-child(1),
  #spirits-table:has(td.availability-cell.availability-expanded) th:nth-child(1),
  #spirits-table.has-expanded-cell th:nth-child(1),
  #spirits-table:has(td.availability-cell.availability-expanded) td:nth-child(1),
  #spirits-table.has-expanded-cell td:nth-child(1),
  #cider-table:has(td.availability-cell.availability-expanded) th:nth-child(1),
  #cider-table.has-expanded-cell th:nth-child(1),
  #cider-table:has(td.availability-cell.availability-expanded) td:nth-child(1),
  #cider-table.has-expanded-cell td:nth-child(1) {
    min-width: var(--col-product-width-mobile) !important;
    width: var(--col-product-width-mobile) !important;
    max-width: var(--col-product-width-mobile) !important;
    box-sizing: border-box !important;
  }
  
  /* CRITICAL: Keep columns 2-3 at normal width to prevent shifting - lock both colgroup and cells */
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(2),
  .table-container.has-expanded-cell colgroup col:nth-child(2),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(2),
  table.has-expanded-cell colgroup col:nth-child(2),
  .table-container:has(td.availability-cell.availability-expanded) th:nth-child(2),
  .table-container.has-expanded-cell th:nth-child(2),
  .table-container:has(td.availability-cell.availability-expanded) td:nth-child(2),
  .table-container.has-expanded-cell td:nth-child(2),
  #beer-table:has(td.availability-cell.availability-expanded) th:nth-child(2),
  #beer-table.has-expanded-cell th:nth-child(2),
  #beer-table:has(td.availability-cell.availability-expanded) td:nth-child(2),
  #beer-table.has-expanded-cell td:nth-child(2),
  #wine-table:has(td.availability-cell.availability-expanded) th:nth-child(2),
  #wine-table.has-expanded-cell th:nth-child(2),
  #wine-table:has(td.availability-cell.availability-expanded) td:nth-child(2),
  #wine-table.has-expanded-cell td:nth-child(2),
  #spirits-table:has(td.availability-cell.availability-expanded) th:nth-child(2),
  #spirits-table.has-expanded-cell th:nth-child(2),
  #spirits-table:has(td.availability-cell.availability-expanded) td:nth-child(2),
  #spirits-table.has-expanded-cell td:nth-child(2),
  #cider-table:has(td.availability-cell.availability-expanded) th:nth-child(2),
  #cider-table.has-expanded-cell th:nth-child(2),
  #cider-table:has(td.availability-cell.availability-expanded) td:nth-child(2),
  #cider-table.has-expanded-cell td:nth-child(2) {
    min-width: var(--col-price100-width-mobile) !important;
    width: var(--col-price100-width-mobile) !important;
    max-width: var(--col-price100-width-mobile) !important;
    box-sizing: border-box !important;
  }
  
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(3),
  .table-container.has-expanded-cell colgroup col:nth-child(3),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(3),
  table.has-expanded-cell colgroup col:nth-child(3),
  .table-container:has(td.availability-cell.availability-expanded) th:nth-child(3),
  .table-container.has-expanded-cell th:nth-child(3),
  .table-container:has(td.availability-cell.availability-expanded) td:nth-child(3),
  .table-container.has-expanded-cell td:nth-child(3),
  #beer-table:has(td.availability-cell.availability-expanded) th:nth-child(3),
  #beer-table.has-expanded-cell th:nth-child(3),
  #beer-table:has(td.availability-cell.availability-expanded) td:nth-child(3),
  #beer-table.has-expanded-cell td:nth-child(3),
  #wine-table:has(td.availability-cell.availability-expanded) th:nth-child(3),
  #wine-table.has-expanded-cell th:nth-child(3),
  #wine-table:has(td.availability-cell.availability-expanded) td:nth-child(3),
  #wine-table.has-expanded-cell td:nth-child(3),
  #spirits-table:has(td.availability-cell.availability-expanded) th:nth-child(3),
  #spirits-table.has-expanded-cell th:nth-child(3),
  #spirits-table:has(td.availability-cell.availability-expanded) td:nth-child(3),
  #spirits-table.has-expanded-cell td:nth-child(3),
  #cider-table:has(td.availability-cell.availability-expanded) th:nth-child(3),
  #cider-table.has-expanded-cell th:nth-child(3),
  #cider-table:has(td.availability-cell.availability-expanded) td:nth-child(3),
  #cider-table.has-expanded-cell td:nth-child(3) {
    min-width: var(--col-size-width-mobile) !important;
    width: var(--col-size-width-mobile) !important;
    max-width: var(--col-size-width-mobile) !important;
    box-sizing: border-box !important;
  }
  
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(4),
  .table-container.has-expanded-cell colgroup col:nth-child(4),
  #beer-table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(4),
  #beer-table.has-expanded-cell colgroup col:nth-child(4),
  #wine-table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(4),
  #wine-table.has-expanded-cell colgroup col:nth-child(4),
  #spirits-table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(4),
  #spirits-table.has-expanded-cell colgroup col:nth-child(4),
  #cider-table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(4),
  #cider-table.has-expanded-cell colgroup col:nth-child(4),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(4),
  table.has-expanded-cell colgroup col:nth-child(4) {
    /* Use CSS variable for dynamic width, fallback to 88px */
    min-width: var(--col-stock-width-mobile, 5.25rem) !important;
    width: var(--col-stock-width-mobile, 5.25rem) !important;
    max-width: var(--col-stock-width-mobile, 5.25rem) !important;
  }
  
  .table-container:has(td.availability-cell.availability-expanded) td:nth-child(4).availability-cell.availability-expanded,
  .table-container.has-expanded-cell td:nth-child(4).availability-cell.availability-expanded,
  #beer-table:has(td.availability-cell.availability-expanded) td:nth-child(4).availability-cell.availability-expanded,
  #beer-table.has-expanded-cell td:nth-child(4).availability-cell.availability-expanded,
  #wine-table:has(td.availability-cell.availability-expanded) td:nth-child(4).availability-cell.availability-expanded,
  #wine-table.has-expanded-cell td:nth-child(4).availability-cell.availability-expanded,
  #spirits-table:has(td.availability-cell.availability-expanded) td:nth-child(4).availability-cell.availability-expanded,
  #spirits-table.has-expanded-cell td:nth-child(4).availability-cell.availability-expanded,
  #cider-table:has(td.availability-cell.availability-expanded) td:nth-child(4).availability-cell.availability-expanded,
  #cider-table.has-expanded-cell td:nth-child(4).availability-cell.availability-expanded,
  table:has(td.availability-cell.availability-expanded) td:nth-child(4).availability-cell.availability-expanded,
  table.has-expanded-cell td:nth-child(4).availability-cell.availability-expanded {
    min-width: var(--col-stock-width-mobile, 5.25rem) !important;
    width: var(--col-stock-width-mobile, 5.25rem) !important;
    max-width: var(--col-stock-width-mobile, 5.25rem) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    /* CRITICAL: Force content to wrap within fixed width */
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    /* CRITICAL: Prevent any flex or auto sizing */
    flex: 0 0 var(--col-stock-width-mobile, 5.25rem) !important;
    /* CRITICAL: Center vertically so store list is centered in cell */
    vertical-align: middle !important;
  }
  
  /* When availability is expanded, explicitly collapse hidden columns (5-8)
     to zero width to avoid extra horizontal space in the table. */
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(5),
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(6),
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(7),
  .table-container:has(td.availability-cell.availability-expanded) colgroup col:nth-child(8),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(5),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(6),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(7),
  table:has(td.availability-cell.availability-expanded) colgroup col:nth-child(8) {
    width: 0px !important;
    min-width: 0px !important;
    max-width: 0px !important;
    display: none !important;
  }

  /* CRITICAL: Keep table-layout fixed to enforce column widths and prevent shifting */
  .table-container:has(td.availability-cell.availability-expanded) table,
  table:has(td.availability-cell.availability-expanded) {
    width: 100% !important;
    table-layout: fixed !important;
    min-width: 100% !important;
    max-width: 100% !important;
    /* CRITICAL: Prevent table from expanding beyond container */
    box-sizing: border-box !important;
  }
  
  /* CRITICAL: Lock table container width to prevent any horizontal movement */
  .table-container:has(td.availability-cell.availability-expanded),
  .table-container.has-expanded-cell {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    /* Prevent any horizontal scroll that could cause visual shift */
    box-sizing: border-box !important;
    /* CRITICAL: Ensure container doesn't expand */
    min-width: 100% !important;
  }
}

/* REMOVED: Conflicting medium mobile rule - mobile rule below handles all mobile sizes */

/* Desktop/landscape screens - keep stock column at reasonable width */
@media (min-width: 844px) {

  .availability-cell.availability-expanded,
  td.availability-cell.availability-expanded,
  .table-container td.availability-cell.availability-expanded,
  #beer-table td.availability-cell.availability-expanded,
  #wine-table td.availability-cell.availability-expanded,
  #spirits-table td.availability-cell.availability-expanded,
  #cider-table td.availability-cell.availability-expanded,
  td:nth-child(4).availability-cell.availability-expanded {
    min-width: 6.25rem !important; /* 100px - tight, no unnecessary whitespace */
    width: 6.25rem !important;
    max-width: 6.25rem !important;
  }
}

.availability-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Center content vertically */
  align-items: flex-start !important;
  /* Left-align content */
  text-align: left !important;
  /* Left-align text */
  min-height: 0;
  line-height: 1.2 !important;
  /* Tight line height for compact display */
  margin: 0;
  padding: 0;
  gap: 0 !important;
  /* No gap between items */
  width: 100% !important;
  max-width: 100% !important;
  /* Constrain to cell width */
  min-width: 0 !important;
  /* Allow shrinking */
  box-sizing: border-box !important;
  font-size: 0;
}

.availability-content.availability-stores {
  font-size: 0 !important; /* Remove spacing between items */
  gap: 0 !important;
  /* No gap between store items */
  margin: 0 !important;
  padding: 0 !important;
  align-items: flex-start !important; /* Left-align store items */
  text-align: left !important; /* Left-align text within items */
  justify-content: center !important; /* Center store list vertically */
  min-height: 100% !important; /* Take full cell height for centering */
}

/* CRITICAL: Restore font-size for all direct children - maximum specificity */
.availability-content.availability-stores>*,
td.availability-cell .availability-content.availability-stores>*,
td.availability-cell.availability-expanded .availability-content.availability-stores>*,
.table-container td.availability-cell.availability-expanded .availability-content.availability-stores>*,
.table-container:has(td.availability-cell.availability-expanded) .availability-content.availability-stores>* {
  font-size: 0.9rem !important;
}

/* Ensure store items are always visible - maximum specificity */
.availability-content.availability-stores .availability-store-item,
td.availability-cell.availability-expanded .availability-content.availability-stores .availability-store-item,
.table-container td.availability-cell.availability-expanded .availability-content.availability-stores .availability-store-item,
.table-container:has(td.availability-cell.availability-expanded) .availability-content.availability-stores .availability-store-item {
  font-size: 0.9rem !important;
  display: block !important; /* Use block layout for natural text flow */
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  line-height: 1.2 !important;
  text-align: left !important; /* Left-align store items */
  gap: 0 !important; /* No flex gap */
  position: relative !important; /* allow absolute positioning of stock */
  box-sizing: border-box !important;
}

/* Ensure link takes remaining space and can wrap, stock stays compact on the right */
.availability-content.availability-stores .availability-store-link,
td.availability-cell.availability-expanded .availability-content.availability-stores .availability-store-link,
.table-container td.availability-cell.availability-expanded .availability-content.availability-stores .availability-store-link {
  display: inline !important; /* Inline allows text to flow naturally */
  flex: none !important;
  min-width: 0 !important; /* allow to shrink/wrap inside flex */ 
  max-width: none !important;
  overflow-wrap: break-word !important; /* wrap at word boundaries */
  word-break: normal !important; /* don't break mid-word */
  white-space: normal !important; /* allow wrapping */
  color: var(--color-link, var(--color-link, #2563eb)) !important;
  text-decoration: none !important;
  margin-right: 0 !important; /* ensure no extra margin on the right of the link */
  padding-right: 0 !important; /* No padding - use space character */
  box-sizing: border-box !important;
}

.availability-content.availability-stores .availability-stock,
td.availability-cell.availability-expanded .availability-content.availability-stores .availability-stock,
.table-container td.availability-cell.availability-expanded .availability-content.availability-stores .availability-stock {
  /* Inline stock number */
  display: inline !important;
  flex: none !important;
  margin-left: 0 !important; /* gap handled by flex gap and link padding */
  color: var(--stock-green, #16a34a) !important;
  font-weight: 600 !important;
  white-space: nowrap !important; /* keep number together */
  position: static !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
}

/* Ensure store links and stock spans are visible */
.availability-content.availability-stores .availability-store-link,
.availability-content.availability-stores .availability-stock,
td.availability-cell.availability-expanded .availability-content.availability-stores .availability-store-link,
td.availability-cell.availability-expanded .availability-content.availability-stores .availability-stock {
  font-size: 0.9rem !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline !important;
}

.availability-content.availability-link {
  display: flex !important;
  /* Use flex to center vertically and horizontally */
  align-items: center !important;
  justify-content: center !important;
  min-height: 0;
  font-size: 0.9rem;
  line-height: normal;
  text-align: center !important;
  width: 100%;
}

/* Ensure the availability link is centered within the availability cell and doesn't force extra width */
.availability-content.availability-link .check-inventory-link {
  display: inline-block !important;
  text-align: center !important;
  vertical-align: middle !important;
  margin: 0 auto !important;
  padding: 0 !important;
  width: auto !important;
}

/* Make the availability content take full cell height so vertical centering works reliably */
td.availability-cell .availability-content.availability-link,
.availability-cell .availability-content.availability-link {
  height: 100% !important;
  box-sizing: border-box !important;
}

.availability-store-item {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
  /* Tight line height for compact display */
  width: 100% !important;
  max-width: 100% !important;
  /* Constrain to parent width */
  min-width: 0 !important;
  /* Allow shrinking */
  box-sizing: border-box !important;
  clear: both;
  font-size: 0.9rem !important;
}

.availability-stock-glue {
  display: inline !important;
  white-space: nowrap !important;
  font-weight: 400 !important;
  color: inherit !important;
}

.availability-store-link {
  display: inline !important;
  font-size: 0.9rem !important;
  font-weight: 400;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--color-link, #2563eb) !important;
  text-decoration: none;
  white-space: normal !important;
  word-break: normal !important;
  /* Never break mid-word - only at word boundaries */
  overflow-wrap: break-word !important;
  /* Break at word boundaries, never mid-word */
  hyphens: none !important;
  /* Disable hyphenation */
  line-height: 1.2 !important;
  /* Tight line height for compact display */
  width: auto !important;
  max-width: none !important;
  /* Remove any max-width constraints */
  height: auto !important;
  overflow: visible !important;
  /* Never hide overflow */
  text-overflow: clip !important;
  /* Never show ellipsis */
}

.availability-store-link:hover {
  color: var(--color-link, #2563eb);
  text-decoration: none;
}

/* Accessibility: Focus indicators for store links */
.availability-store-link:focus {
  outline: 2px solid var(--color-link, #2563eb);
  outline-offset: 2px;
  color: var(--color-link, #2563eb);
  text-decoration: none;
  border-radius: 0.125rem;
}

.availability-store-link:focus:not(:focus-visible) {
  outline: none;
  /* Remove outline for mouse users, keep for keyboard */
}

.availability-store-link:focus-visible {
  outline: 2px solid var(--color-link, #2563eb);
  outline-offset: 2px;
  color: var(--color-link, #2563eb);
  text-decoration: none;
  border-radius: 0.125rem;
}

.availability-store-details {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.availability-stock {
  font-weight: 600 !important;
  color: var(--stock-green, #16a34a) !important;
  /* green-600 - matches the inline style */
  -webkit-text-fill-color: var(--stock-green, #16a34a) !important;
  font-size: 1em !important;
  margin-left: 0 !important;
  /* Remove left margin for tighter spacing */
}

/* Maximum specificity for stock numbers in store links */
a .availability-stock,
.availability-store-link .availability-stock,
.availability-store-item .availability-stock,
.availability-store-link span.availability-stock {
  color: var(--stock-green, #16a34a) !important;
  -webkit-text-fill-color: var(--stock-green, #16a34a) !important;
}

.availability-separator {
  color: var(--color-text-muted, #9ca3af);
  font-weight: 300;
}

.availability-distance {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.85rem;
}

/* Style for availability links */
.check-inventory-link {
  color: var(--color-link, #1d4ed8) !important;
  /* Accessible contrasty blue */
  text-decoration: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 1 !important;
  /* Ensure full opacity */
  font-weight: 600 !important;
  /* Emphasize without overpowering */
  text-align: center !important;
  /* Center-align the link text */
  display: block !important;
  /* Use block to fill width for centering */
  margin: 0 auto !important;
  /* Center within parent */
  width: 100% !important;
  /* Ensure full width */
  text-shadow: none !important;
  /* Remove any text shadow that might make it appear faded */
  filter: none !important;
  /* Remove any filters that might make it appear faded */
  -webkit-text-fill-color: var(--color-link, #1d4ed8) !important;
  /* WebKit text fill color - ensure not faded */
  mix-blend-mode: normal !important;
  /* Prevent any blend mode that might fade text */
  background-color: transparent !important;
  /* Ensure no background overlay */
}

.check-inventory-link:hover {
  text-decoration: underline;
}

/* Accessibility: Focus indicators for check inventory links */
.check-inventory-link:focus {
  outline: 2px solid var(--color-link, #2563eb);
  outline-offset: 2px;
  text-decoration: underline;
  border-radius: 0.125rem;
}

.check-inventory-link:focus:not(:focus-visible) {
  outline: none;
  /* Remove outline for mouse users, keep for keyboard */
}

.check-inventory-link:focus-visible {
  outline: 2px solid var(--color-link, #2563eb);
  outline-offset: 2px;
  text-decoration: underline;
  border-radius: 0.125rem;
}

.check-inventory-link,
.availability-store-link,
.check-inventory-link:visited,
.availability-store-link:visited,
.check-inventory-link:hover,
.availability-store-link:hover,
.check-inventory-link:active,
.availability-store-link:active {
  color: var(--color-link, #2563eb) !important;
  text-decoration: none;
  text-align: left !important;
  /* Left-align to match expanded store items */
  opacity: 1 !important;
  /* Ensure full opacity */
  font-weight: 600 !important;
  /* Emphasize without overpowering */
  text-shadow: none !important;
  /* Remove any text shadow that might make it appear faded */
  filter: none !important;
  /* Remove any filters that might make it appear faded */
  -webkit-text-fill-color: var(--color-link, #1d4ed8) !important;
  /* WebKit text fill color - ensure not faded */
  mix-blend-mode: normal !important;
  /* Prevent any blend mode that might fade text */
  background-color: transparent !important;
  /* Ensure no background overlay */
}

.check-inventory-link:hover,
.availability-store-link:hover {
  text-decoration: underline;
}

td.availability-expanded .availability-store-link,
td.availability-cell.availability-expanded .availability-store-link,
.availability-cell.availability-expanded .availability-store-link {
  display: block !important; /* Block allows wrapping */
  white-space: normal !important;
  word-break: normal !important;
  /* Never break mid-word - only at word boundaries */
  overflow-wrap: break-word !important;
  /* Break at word boundaries, never mid-word */
  hyphens: none !important;
  /* Disable hyphenation */
  min-width: 0 !important;
  /* Allow natural width */
  max-width: 100% !important;
  /* Constrain to parent width */
  width: auto !important;
  /* Take natural width to allow stock number to sit next to it */
  overflow: visible !important;
  /* Never hide overflow */
  text-overflow: clip !important;
  /* Never show ellipsis */
  box-sizing: border-box !important;
}

td.availability-expanded .availability-store-item,
td.availability-cell.availability-expanded .availability-store-item,
.availability-cell.availability-expanded .availability-store-item {
  width: 100% !important;
  max-width: none !important;
  /* Remove any max-width constraints */
  min-width: 0 !important;
  /* Allow natural width */
}

/* Override line-height for availability stores - must be more specific than td rule */
td[class*="availability-cell"],
td[id^="availability-"] {
  line-height: 1 !important;
  vertical-align: middle !important;
  /* Center content vertically in cell */
}

td[class*="availability-cell"] .availability-store-item,
td[class*="availability-cell"] .availability-store-link,
td[id^="availability-"] .availability-store-item,
td[id^="availability-"] .availability-store-link,
td[class*="availability-cell"] .availability-stock,
td[id^="availability-"] .availability-stock {
  line-height: 1.2 !important;
  /* Tight line height for compact display */
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

td[class*="availability-cell"] .availability-stock,
td[id^="availability-"] .availability-stock {
  color: var(--stock-green, #16a34a) !important;
  /* green-600 */
  font-weight: 600;
}

td[class*="availability-cell"] .availability-store-link .availability-stock,
td[id^="availability-"] .availability-store-link .availability-stock,
td[class*="availability-cell"] .availability-store-item .availability-stock,
td[id^="availability-"] .availability-store-item .availability-stock,
td[class*="availability-cell"] a .availability-stock,
td[id^="availability-"] a .availability-stock,
td[class*="availability-cell"] a span.availability-stock,
td[id^="availability-"] a span.availability-stock {
  color: var(--stock-green, #16a34a) !important;
  /* green-600 */
  -webkit-text-fill-color: var(--stock-green, #16a34a) !important;
}

/* NUCLEAR: Reset inner content for standard table centering */
td.availability-cell .availability-content.availability-link,
.table-container td.availability-cell .availability-content.availability-link,
#beer-table td.availability-cell .availability-content.availability-link,
#wine-table td.availability-cell .availability-content.availability-link,
#spirits-table td.availability-cell .availability-content.availability-link,
#cider-table td.availability-cell .availability-content.availability-link,
td[id^="availability-"] .availability-content.availability-link {
  display: flex !important; /* Use flex for proper vertical centering */
  align-items: center !important; /* Center vertically */
  justify-content: center !important; /* Center horizontally */
  line-height: 1.2 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 100% !important; /* Take full cell height for centering */
  min-height: 100% !important;
}

td.availability-cell .availability-content.availability-link .check-inventory-link,
.table-container td.availability-cell .availability-content.availability-link .check-inventory-link,
td[id^="availability-"] .availability-content.availability-link .check-inventory-link {
  display: inline-block !important;
  margin: 0 !important;
  padding: 0.85rem 0 0.15rem 0 !important; /* Visual nudge: maximum top padding to align with Price/100mL baseline */
  line-height: 1.2 !important;
}

/* Wrapper for absolute centering - disabled */
.availability-centering-wrapper {
  display: contents !important;
}

/* Ensure the availability cell acts as a standard table cell */
td.availability-cell,
.table-container td.availability-cell,
#beer-table td.availability-cell,
#wine-table td.availability-cell,
#spirits-table td.availability-cell,
#cider-table td.availability-cell,
td[id^="availability-"] {
  display: table-cell !important;
  vertical-align: middle !important;
  text-align: center !important;
  padding: 0 0 0 0.5rem !important; /* Add left padding for separation from Size column */
  line-height: 0 !important; /* Kill baseline strut */
  position: static !important;
  height: auto !important;
}

td.availability-cell .availability-content.availability-link .check-inventory-link,
.table-container td.availability-cell .availability-content.availability-link .check-inventory-link,
#beer-table td.availability-cell .availability-content.availability-link .check-inventory-link,
#wine-table td.availability-cell .availability-content.availability-link .check-inventory-link,
#spirits-table td.availability-cell .availability-content.availability-link .check-inventory-link,
#cider-table td.availability-cell .availability-content.availability-link .check-inventory-link,
td[id^="availability-"] .availability-content.availability-link .check-inventory-link {
  display: inline-block !important;
  text-align: center !important;
  margin: 0 auto !important;
  vertical-align: middle !important;
}