.outlined-text {
  font-family: "Montserrat", sans-serif;
  font-size: 60px; /* Adjust as needed */
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), -2px -2px 4px rgba(0, 0, 0, 0.8),
    2px -2px 4px rgba(0, 0, 0, 0.8), -2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Ensure product card images render in a consistent square */
.product .product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* square */
  background: #fff;
}

.product .product-image > img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* change to cover if cropping is preferred */
  display: block;
}

/* Add padding to product card text area */
.product .py-2 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* Ensure product page hero carousel frames are square and centered */
.detail-full .detail-full-item {
  width: 100%;
  aspect-ratio: 1 / 1; /* square */
  background-size: contain; /* change to cover if cropping is preferred */
  background-repeat: no-repeat;
  background-position: center;
  /* override theme heights to keep a square frame */
  min-height: auto !important;
  height: auto !important;
}

/* ================================================
   Loading States & Skeleton Screens
   ================================================ */

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #333;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

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

/* Skeleton loading animation */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Skeleton product card */
.skeleton-product {
  padding: 1rem;
}

.skeleton-product .skeleton-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.5rem;
}

.skeleton-product .skeleton-category {
  height: 12px;
  width: 60%;
  margin-bottom: 0.5rem;
}

.skeleton-product .skeleton-title {
  height: 16px;
  width: 90%;
  margin-bottom: 0.5rem;
}

.skeleton-product .skeleton-price {
  height: 14px;
  width: 40%;
}

/* Button loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

/* Page loading overlay */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ================================================
   Cart Mini Preview
   ================================================ */

.cart-preview-dropdown .dropdown-menu {
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  padding: 0;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.cart-preview-header {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.cart-preview-item {
  display: flex;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.cart-preview-item:hover {
  background: #f8f9fa;
}

.cart-preview-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-preview-item-details {
  flex: 1;
  margin-left: 0.75rem;
}

.cart-preview-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.cart-preview-item-meta {
  font-size: 0.75rem;
  color: #666;
}

.cart-preview-footer {
  padding: 1rem;
  background: #fff;
  border-top: 1px solid #eee;
}

.cart-preview-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.cart-preview-empty {
  padding: 2rem;
  text-align: center;
  color: #999;
}

.cart-preview-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* ================================================
   Toast Notifications
   ================================================ */

#toast-container {
  z-index: 1100;
}

.toast {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast-error {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ================================================
   Product Hover Overlay Improvements
   ================================================ */

.product-hover-overlay .product-hover-overlay-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.product-hover-overlay .btn.btn-buy {
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-width: 120px;
}

/* Quick Add Button - Make it more visible */
.quick-add-btn {
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  background-color: #333 !important;
  color: #fff !important;
  border: 2px solid #333 !important;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-add-btn:hover {
  background-color: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.quick-add-btn:active {
  transform: scale(0.98);
}

/* VIEW Button - Match cart button style */
.product-hover-overlay .btn.btn-buy {
  background-color: #333 !important;
  color: #fff !important;
  border: 2px solid #333 !important;
  transition: all 0.2s ease;
}

.product-hover-overlay .btn.btn-buy:hover {
  background-color: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.product-hover-overlay .btn.btn-buy:active {
  transform: scale(0.98);
}

/* Ensure buttons are properly centered and spaced */
.product-hover-overlay {
  align-items: center;
  justify-content: center;
}

.product-hover-overlay .product-hover-overlay-buttons {
  position: relative;
  z-index: 10;
}

/* ================================================
   Search Autocomplete
   ================================================ */

#search-autocomplete {
  border: 1px solid #eee;
}

#search-autocomplete a {
  transition: background 0.2s;
}

#search-autocomplete a:hover {
  background-color: #f8f9fa;
}

/* ================================================
   Improved Breadcrumbs
   ================================================ */

.breadcrumb-enhanced {
  background: transparent;
  padding: 0;
  margin: 0;
}

.breadcrumb-enhanced .breadcrumb-item {
  font-size: 0.875rem;
}

.breadcrumb-enhanced .breadcrumb-item a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-enhanced .breadcrumb-item a:hover {
  color: #000;
  text-decoration: underline;
}

.breadcrumb-enhanced .breadcrumb-item.active {
  color: #000;
  font-weight: 500;
}

.breadcrumb-enhanced .breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: #999;
}

/* ================================================
   Product Card Enhancements
   ================================================ */

.product {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ================================================
   Pagination Styles
   ================================================ */

.pagination .page-link {
  border: none;
  color: #333;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.pagination .page-item.active .page-link {
  background: #333;
  color: #fff;
}

.pagination .page-link:hover {
  background: #f0f0f0;
  color: #333;
}

.pagination .page-item.disabled .page-link {
  background: transparent;
  color: #ccc;
}

/* ================================================
   Filter Sidebar Enhancements
   ================================================ */

.sidebar-block {
  margin-bottom: 1.5rem;
}

.sidebar-heading {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

/* Price slider custom styles */
.noUi-connect {
  background: #333 !important;
}

.noUi-handle {
  border-radius: 50% !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

.nouislider-values {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.875rem;
}

/* ================================================
   Cart Quantity Controls
   ================================================ */

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background-color: #333;
  border-color: #333;
  color: #fff;
}

.qty-btn i {
  font-size: 10px;
}

.qty-value {
  min-width: 32px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Cart item styling improvements */
.cart-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #eee;
}

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

.cart-item-img {
  max-width: 80px;
  height: auto;
  border-radius: 4px;
}

.cart-title {
  margin-left: 1rem;
}

.cart-remove {
  color: #999;
  transition: color 0.2s ease;
}

.cart-remove:hover {
  color: #dc3545;
}

/* ================================================
   Stock Status Badges
   ================================================ */

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

.product-badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.product-badge.bg-success {
  background-color: #28a745 !important;
  color: #fff !important;
}

/* ================================================
   Pre-Order Marker
   ================================================ */

.product-badge.bg-preorder {
  background-color: #6f42c1 !important;
  color: #fff !important;
}

/* Stock badge sits top-right; pre-order badge sits top-left so both can show at once */
.product-badge.product-badge-left {
  left: 10px;
  right: auto;
}

.badge-preorder {
  background-color: #6f42c1 !important;
  color: #fff !important;
}

.product-preorder .product-image {
  outline: 3px solid #6f42c1;
  outline-offset: -3px;
  border-radius: 4px;
}

.detail-full-preorder {
  outline: 3px solid #6f42c1;
  outline-offset: -3px;
  border-radius: 4px;
}

.preorder-thumb {
  outline: 2px solid #6f42c1;
  outline-offset: -2px;
  border-radius: 2px;
}

/* Stock quantity display */
.stock-info {
  font-size: 0.75rem;
  color: #666;
}

.stock-info.low-stock {
  color: #ffc107;
  font-weight: 600;
}

.stock-info.out-of-stock {
  color: #dc3545;
  font-weight: 600;
}

/* Disabled add to cart button for out of stock */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ================================================
   Mobile Usability Improvements
   ================================================ */

@media (max-width: 991.98px) {
  /* Prevent iOS Safari from auto-zooming the page when a form field
     under 16px is focused (form-control/form-select ship at 14.4px) */
  .form-control,
  .form-select,
  .form-control-sm {
    font-size: 16px;
  }

  /* Bring nav icon tap targets (search, cart, account) closer to the
     44x44px minimum recommended touch target size */
  .navbar-icon-link {
    padding: 0.75rem 0.5rem;
  }

  /* Cart quantity +/- buttons are only 28x28px by default */
  .qty-btn {
    width: 36px;
    height: 36px;
  }

  /* Fall back to the dynamic viewport height where supported so the
     fullscreen search overlay isn't taller than the visible area once
     iOS Safari's chrome collapses/expands */
  .search-area {
    height: 100dvh;
  }
}
