/* Custom color overrides - THE LOWES STYLE (Blue) */

:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  /* Corporate Blue Palette */
  --bs-primary: #004990;
  /* The Lowes Blue */
  --bs-primary-rgb: 0, 73, 144;
  --bs-secondary: #F2F2F2;
  /* Light Grey Background */
  --bs-secondary-rgb: 242, 242, 242;
  --bs-info: #004990;
  /* Map info to primary */
  --bs-info-rgb: 0, 73, 144;

  /* Typography overrides */
  --bs-body-font-family: "Open Sans", "Segoe UI", sans-serif;
  --bs-headings-font-family: "Open Sans", "Segoe UI", sans-serif;
}

/* Friendly Button Styles */
.btn-primary {
  --bs-btn-bg: #004990 !important;
  --bs-btn-border-color: #004990 !important;
  --bs-btn-hover-bg: #003366 !important;
  --bs-btn-hover-border-color: #003366 !important;
  --bs-btn-active-bg: #002244 !important;
  --bs-btn-active-border-color: #002244 !important;
  background-color: #004990 !important;
  border-color: #004990 !important;
  font-weight: 600;
  border-radius: 4px;
  /* Softer corners */
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #003366 !important;
  border-color: #003366 !important;
}

.btn-primary:active {
  background-color: #002244 !important;
  border-color: #002244 !important;
}

/* Override for card headers with primary/info background */
.card-header.bg-primary,
.card-header.text-white[style*="background"],
.bg-primary {
  background-color: #004990 !important;
}

/* Override for primary text color */
.text-primary {
  color: #004990 !important;
}

/* Override for primary borders */
.border-primary {
  border-color: #004990 !important;
}

/* Mega Menu Dropdown Fix */
.dropdown-menu.show {
  display: block !important;
}

.position-static {
  position: static !important;
}

.dropdown-menu {
  position: absolute !important;
}

.btn-secondary {
  border-radius: 4px;
  font-weight: 600;
}

/* Soft Cards */
.card {
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ===================================
   Product Card Modernization
   =================================== */

/* Product card hover effect */
.product-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

/* Product image zoom on hover */
.product-image {
  transition: transform 0.4s ease;
}

.product-card:hover .product-image {
  transform: scale(1.08);
}

/* Hover overlay - hidden by default */
.product-overlay {
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

/* Smooth transitions for all interactive elements */
.card-title,
.btn {
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* Better responsive spacing */
@media (max-width: 576px) {
  .product-card {
    margin-bottom: 1rem;
  }
}

/* Success badge styling */
.bg-success-subtle {
  background-color: rgba(25, 135, 84, 0.1) !important;
}

.text-success {
  color: #198754 !important;
}

/* ===================================
   Product Detail Page
   =================================== */

/* Sticky product info on desktop */
@media (min-width: 992px) {
  .product-info-sticky {
    position: sticky;
    top: 140px;
    /* Account for fixed navbar */
  }
}

/* Product image container */
.main-image-container {
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 1rem;
}

/* Gallery image transitions */
.gallery-main-image {
  transition: opacity 0.3s ease;
}

/* Thumbnail button hover */
.thumbnail-btn {
  border-radius: 0.375rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.thumbnail-btn:hover {
  border-color: var(--bs-primary) !important;
  transform: scale(1.05);
}

.thumbnail-btn.active {
  box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.2);
}

/* Product info card enhancements */
.product-info-sticky .card {
  border-radius: 1rem;
}

/* Quantity input styling */
#product-qty {
  font-weight: 600;
  border-left: none;
  border-right: none;
}

/* Product highlights list */
.product-highlights li:last-child {
  border-bottom: none !important;
}

/* Responsive improvements for detail page */
@media (max-width: 991px) {
  .product-info-sticky {
    margin-top: 2rem;
  }

  .main-image-container {
    margin-bottom: 1rem;
  }
}

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

.toast-container {
  z-index: 1090;
}

.toast {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-success {
  background-color: #198754;
  color: white;
}

.toast-success .btn-close {
  filter: brightness(0) invert(1);
}

.toast-error {
  background-color: #dc3545;
  color: white;
}

.toast-error .btn-close {
  filter: brightness(0) invert(1);
}

/* ===================================
   Skeleton Loading States
   =================================== */

.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-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text-sm {
  height: 0.75em;
  width: 60%;
}

.skeleton-image {
  aspect-ratio: 1;
  width: 100%;
}

.skeleton-button {
  height: 38px;
  width: 100px;
}

/* ===================================
   Enhanced Form Styling
   =================================== */

.form-control:focus,
.form-select:focus {
  border-color: #004990;
  box-shadow: 0 0 0 0.2rem rgba(0, 73, 144, 0.25);
}

.form-control.is-valid:focus {
  border-color: #198754;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.form-control.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Better input transitions */
.form-control,
.form-select {
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* ===================================
   Enhanced Card & Shadow Styling
   =================================== */

.card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-hover:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Subtle resting shadow for product cards */
.product-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ===================================
   Scroll-Triggered Animations
   =================================== */

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* Stagger animations for grids */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* ===================================
   Sticky Mobile Add-to-Cart
   =================================== */

@media (max-width: 991px) {
  .sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .sticky-add-to-cart .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #004990;
  }

  .sticky-add-to-cart .btn {
    flex: 1;
  }

  /* Add padding to body to account for sticky bar */
  body.has-sticky-cart {
    padding-bottom: 80px;
  }
}

@media (min-width: 992px) {
  .sticky-add-to-cart {
    display: none;
  }
}

/* ===================================
   Better Empty States
   =================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 5rem;
  color: #dee2e6;
  margin-bottom: 1.5rem;
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.75rem;
}

.empty-state-text {
  color: #6c757d;
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ===================================
   Image Lightbox
   =================================== */

.lightbox-image {
  cursor: zoom-in;
}

#imageLightbox .modal-dialog {
  max-width: 90vw;
  margin: 1rem auto;
}

#imageLightbox .modal-content {
  background: transparent;
  border: none;
}

#imageLightbox .modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#imageLightbox img {
  max-height: 90vh;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

#imageLightbox .btn-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: white;
  border-radius: 50%;
  padding: 0.75rem;
  opacity: 0.9;
  z-index: 10;
}

#imageLightbox .btn-close:hover {
  opacity: 1;
}

/* Lightbox navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lightbox-nav.prev {
  left: 1rem;
}

.lightbox-nav.next {
  right: 1rem;
}

/* ===================================
   Price Typography
   =================================== */

.price-display {
  font-size: 1.75rem;
  font-weight: 700;
  color: #004990;
}

.price-msrp {
  font-size: 1rem;
  color: #6c757d;
  text-decoration: line-through;
}

.price-savings {
  font-size: 0.875rem;
  color: #198754;
  font-weight: 600;
}

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

.stock-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35em 0.75em;
  border-radius: 50px;
}

.stock-in {
  background-color: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.stock-low {
  background-color: rgba(255, 193, 7, 0.15);
  color: #997404;
}

.stock-out {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* ===================================
   Button Press/Active States
   =================================== */

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

.btn-primary:active {
  background-color: #002244 !important;
}

.btn-outline-primary:active {
  background-color: #004990 !important;
  color: white !important;
}

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

/* ===================================
   Cursor Improvements
   =================================== */

.clickable,
[role="button"],
.nav-link,
.dropdown-item,
.thumbnail-btn,
.variant-option {
  cursor: pointer;
}
