/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.parts-search-form {
  --search-border: #d7dee8;
  --search-border-strong: #b8c4d6;
  --search-bg: #f8fafc;
  --search-text: #0f172a;
  --search-muted: #4b5563;
  --search-focus: #2563eb;
}

.parts-search-form .search-grid {
  gap: 1.25rem;
}

.parts-search-form .search-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.parts-search-form .search-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--search-muted);
}

.parts-search-form .search-input,
.parts-search-form .search-select {
  width: 100%;
  border: 1px solid var(--search-border);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--search-bg);
  color: var(--search-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.parts-search-form .search-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.parts-search-form .search-input:focus,
.parts-search-form .search-select:focus {
  outline: none;
  border-color: var(--search-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

.parts-search-form .search-input:disabled,
.parts-search-form .search-select:disabled {
  background: #edf2f7;
  color: #94a3b8;
  cursor: not-allowed;
}

.parts-search-form .search-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 0.35rem;
  border: 1px solid var(--search-border-strong);
  accent-color: var(--search-focus);
}

.parts-search-form .search-checkbox-label {
  font-size: 0.9rem;
  color: var(--search-muted);
}

.parts-search-form .search-submit {
  width: 100%;
  border: none;
  border-radius: 0.9rem;
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 45%, #0ea5e9 100%);
  box-shadow: 0 12px 24px -18px rgba(37, 99, 235, 0.9);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

.parts-search-form .search-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.parts-search-form .search-submit:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.parts-search-form .search-dropdown {
  border: 1px solid var(--search-border);
  background: #ffffff;
  border-radius: 0.85rem;
  box-shadow: 0 18px 40px -30px rgba(15, 23, 42, 0.8);
}

.parts-search-form .search-dropdown-item {
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: var(--search-text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.parts-search-form .search-dropdown-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.parts-search-form .search-field--complete .search-label {
  color: #15803d;
}

.parts-search-form .search-field--complete .search-input,
.parts-search-form .search-field--complete .search-select {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

.parts-search-form .search-field--next .search-label {
  color: #dc2626;
}

.parts-search-form .search-field--next .search-input,
.parts-search-form .search-field--next .search-select {
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.12);
}

.image-zoom-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  /* Above storefront chrome: sticky .header (60), .mobile-buybar (55), cart toast (70) */
  z-index: 80;
}

.image-zoom-modal.active {
  display: flex;
}

.image-zoom-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
}

.image-zoom-modal__dialog {
  position: relative;
  width: min(95vw, 960px);
  height: min(90vh, 720px);
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.image-zoom-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.image-zoom-modal__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.image-zoom-modal__btn {
  border: 1px solid #cbd5f5;
  background: #ffffff;
  color: #0f172a;
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.image-zoom-modal__btn:hover {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.15);
}

.image-zoom-modal__zoom-level {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.image-zoom-modal__close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.image-zoom-modal__close:hover {
  color: #0f172a;
}

.image-zoom-modal__body {
  flex: 1;
  background: #0f172a;
  display: flex;
}

.image-zoom-modal__image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
}

.image-zoom-modal__image {
  max-width: 100%;
  max-height: 100%;
  user-select: none;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
}

@media (max-width: 640px) {
  .image-zoom-modal__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Cart badge pop animation */
@keyframes cart-badge-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  65%  { transform: scale(1.25); }
  100% { transform: scale(1);   opacity: 1; }
}

.cart-badge-pop {
  animation: cart-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Cart toast notification */
@keyframes cart-toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes cart-toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}
@keyframes cart-toast-progress {
  from { width: 100%; }
  to   { width: 0%;   }
}

.cart-toast-item {
  animation: cart-toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.cart-toast-item--leaving {
  animation: cart-toast-out 0.25s ease-in forwards;
}
.cart-toast-progress {
  animation: cart-toast-progress 3.5s linear forwards;
}
