/**
 * DealKart Core CSS
 * Production-ready Deal & E-Commerce Components
 */

:root {
  --dk-primary: #ff5722;
  --dk-primary-dark: #e64a19;
  --dk-primary-light: #fff3e0;
  --dk-secondary: #1e293b;
  --dk-accent: #f59e0b;
  --dk-success: #10b981;
  --dk-danger: #ef4444;
  --dk-gray-50: #f8fafc;
  --dk-gray-100: #f1f5f9;
  --dk-gray-200: #e2e8f0;
  --dk-gray-300: #cbd5e1;
  --dk-gray-500: #64748b;
  --dk-gray-700: #334155;
  --dk-gray-900: #0f172a;
  --dk-radius-sm: 6px;
  --dk-radius-md: 10px;
  --dk-radius-lg: 16px;
  --dk-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --dk-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --dk-shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

/* Toast Notifications */
.dk-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  z-index: 99990;
  background: var(--dk-gray-900);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--dk-radius-md);
  box-shadow: var(--dk-shadow-lg);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.dk-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dk-toast.success {
  background: #064e3b;
  border-left: 4px solid var(--dk-success);
}
.dk-toast.error {
  background: #7f1d1d;
  border-left: 4px solid var(--dk-danger);
}

@keyframes dk-cart-badge-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.45); filter: brightness(1.2); }
  100% { transform: scale(1); }
}
.dk-pulse-animate {
  animation: dk-cart-badge-pulse 0.45s ease-in-out !important;
}

/* Flash Sale Banner */
.dk-flash-sale-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  border-radius: var(--dk-radius-lg);
  color: #ffffff;
  padding: 36px 32px;
  margin: 32px 0;
  box-shadow: 0 15px 35px rgba(49, 46, 129, 0.25);
  overflow: hidden;
  position: relative;
}
.dk-flash-sale-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,87,34,0.15) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.dk-flash-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.dk-flash-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.dk-flash-badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fde047;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.dk-flash-pct {
  background: var(--dk-primary);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.dk-flash-title {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
  line-height: 1.2;
}
.dk-flash-prod-name {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 16px 0;
}
.dk-flash-pricing {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
}
.dk-flash-price-sale {
  font-size: 30px;
  font-weight: 800;
  color: #38bdf8;
}
.dk-flash-price-reg {
  font-size: 18px;
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.5);
}
.dk-flash-save {
  font-size: 13px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Countdown Timer */
.dk-countdown-wrapper {
  margin-bottom: 20px;
}
.dk-countdown-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.dk-countdown-boxes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dk-countdown-unit {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: var(--dk-radius-sm);
  padding: 8px 12px;
  text-align: center;
  min-width: 58px;
}
.dk-timer-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  line-height: 1;
}
.dk-timer-lbl {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}
.dk-timer-sep {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

/* Stock Progress */
.dk-flash-stock-progress {
  max-width: 400px;
  margin-bottom: 24px;
}
.dk-flash-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.dk-flash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ff5722);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.dk-flash-stock-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.dk-flash-urgent {
  color: #fde047;
  font-weight: 700;
}

/* Actions */
.dk-flash-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dk-btn-flash {
  background: linear-gradient(135deg, #ff5722 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--dk-radius-md);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.dk-btn-flash:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.4);
  color: #ffffff;
}
.dk-btn-flash-outline {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  padding: 11px 20px;
  border-radius: var(--dk-radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.dk-btn-flash-outline:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.dk-flash-image-wrap {
  text-align: center;
}
.dk-flash-img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.3));
  border-radius: var(--dk-radius-md);
  transition: transform 0.3s ease;
}
.dk-flash-img:hover {
  transform: scale(1.04);
}

/* Today's Deals Section & Grid */
.dk-deals-section {
  margin: 40px 0;
}
.dk-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--dk-gray-200);
  padding-bottom: 14px;
}
.dk-section-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--dk-primary);
  margin-bottom: 4px;
}
.dk-section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--dk-gray-900);
  margin: 0;
}
.dk-section-subtitle {
  font-size: 14px;
  color: var(--dk-gray-500);
  margin: 4px 0 0 0;
}
.dk-btn-view-all {
  font-size: 14px;
  font-weight: 700;
  color: var(--dk-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.dk-btn-view-all:hover {
  color: var(--dk-primary-dark);
  text-decoration: underline;
}

.dk-deals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) {
  .dk-deals-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .dk-deals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .dk-flash-inner {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .dk-deals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Deal Card */
.dk-deal-card {
  background: #ffffff;
  border: 1px solid var(--dk-gray-200);
  border-radius: var(--dk-radius-md);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.dk-deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--dk-shadow-md);
  border-color: var(--dk-primary-light);
}
.dk-deal-card-badge-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
}
.dk-badge-discount {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.dk-wishlist-toggle {
  background: #ffffff;
  border: 1px solid var(--dk-gray-200);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dk-gray-500);
  transition: all 0.2s ease;
  box-shadow: var(--dk-shadow-sm);
}
.dk-wishlist-toggle:hover,
.dk-wishlist-toggle.active {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fef2f2;
}
.dk-deal-image-link {
  display: block;
  text-align: center;
  margin: 12px 0 16px 0;
  height: 180px;
  overflow: hidden;
  border-radius: var(--dk-radius-sm);
}
.dk-deal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.dk-deal-card:hover .dk-deal-img {
  transform: scale(1.05);
}
.dk-deal-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.dk-deal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}
.dk-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dk-rating .star-rating {
  font-size: 12px;
}
.dk-rating-count {
  color: var(--dk-gray-500);
  font-size: 11px;
}
.dk-stock-badge {
  font-size: 11px;
  font-weight: 600;
}
.dk-stock-badge.in-stock {
  color: var(--dk-success);
}
.dk-stock-badge.out-of-stock {
  color: var(--dk-danger);
}
.dk-deal-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}
.dk-deal-title a {
  color: var(--dk-gray-900);
  text-decoration: none;
  transition: color 0.2s ease;
}
.dk-deal-title a:hover {
  color: var(--dk-primary);
}
.dk-deal-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.dk-current-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--dk-gray-900);
}
.dk-original-price {
  font-size: 13px;
  color: var(--dk-gray-500);
  text-decoration: line-through;
}

/* Card Stock Progress */
.dk-deal-progress-wrap {
  margin-bottom: 14px;
}
.dk-progress-bar {
  height: 6px;
  background: var(--dk-gray-100);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.dk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ff5722);
  border-radius: 999px;
}
.dk-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dk-gray-500);
}
.dk-urgency {
  color: var(--dk-primary);
  font-weight: 600;
}

/* Card Actions */
.dk-deal-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.dk-btn-deal-cart {
  flex-grow: 1;
  background: var(--dk-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--dk-radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}
.dk-btn-deal-cart:hover {
  background: var(--dk-primary-dark);
  color: #ffffff;
}
.dk-btn-quickview {
  background: var(--dk-gray-100);
  color: var(--dk-gray-700);
  border: 1px solid var(--dk-gray-200);
  border-radius: var(--dk-radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dk-btn-quickview:hover {
  background: var(--dk-secondary);
  color: #ffffff;
  border-color: var(--dk-secondary);
}

/* Quick View Modal */
.dk-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.dk-modal.show {
  opacity: 1;
  visibility: visible;
}
.dk-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}
.dk-modal-dialog {
  position: relative;
  z-index: 2;
  background: #ffffff;
  width: 90%;
  max-width: 820px;
  max-height: 90vh;
  border-radius: var(--dk-radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.dk-modal.show .dk-modal-dialog {
  transform: scale(1);
}
.dk-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: var(--dk-gray-100);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--dk-gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.dk-modal-close:hover {
  background: var(--dk-gray-200);
}
.dk-modal-body {
  padding: 32px;
}
.dk-modal-loading {
  text-align: center;
  padding: 60px 0;
}
.dk-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--dk-gray-200);
  border-top-color: var(--dk-primary);
  border-radius: 50%;
  animation: dk-spin 0.8s linear infinite;
  margin: 0 auto 16px auto;
}
@keyframes dk-spin {
  to { transform: rotate(360deg); }
}

/* Quick View Inner Grid */
.dk-qv-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 768px) {
  .dk-qv-container {
    grid-template-columns: 1fr;
  }
}
.dk-qv-gallery {
  background: var(--dk-gray-50);
  border-radius: var(--dk-radius-md);
  padding: 20px;
  text-align: center;
}
.dk-qv-main-img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}
.dk-qv-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--dk-gray-900);
}
.dk-qv-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--dk-gray-500);
}
.dk-qv-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  color: var(--dk-primary);
  margin-bottom: 12px;
}
.dk-discount-tag {
  background: #fee2e2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.dk-qv-stock {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.dk-qv-stock.in-stock { color: var(--dk-success); }
.dk-qv-stock.out-of-stock { color: var(--dk-danger); }
.dk-qv-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--dk-gray-700);
  margin-bottom: 24px;
}
.dk-qv-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dk-qv-cart-form {
  display: flex;
  gap: 12px;
}
.dk-qty-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--dk-gray-300);
  border-radius: var(--dk-radius-sm);
  overflow: hidden;
}
.dk-qty-btn {
  background: var(--dk-gray-100);
  border: none;
  width: 36px;
  height: 42px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.dk-qty-input {
  width: 50px;
  height: 42px;
  border: none;
  text-align: center;
  font-weight: 700;
}
.dk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--dk-radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.dk-btn-primary {
  background: var(--dk-primary);
  color: #ffffff;
}
.dk-btn-primary:hover {
  background: var(--dk-primary-dark);
  color: #ffffff;
}
.dk-btn-outline {
  background: transparent;
  border-color: var(--dk-gray-300);
  color: var(--dk-gray-700);
}
.dk-btn-outline:hover {
  border-color: var(--dk-gray-700);
}
.dk-btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* Wishlist Table */
.dk-wishlist-wrap {
  margin: 30px 0;
}
.dk-wishlist-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: var(--dk-radius-md);
  overflow: hidden;
  box-shadow: var(--dk-shadow-sm);
}
.dk-wishlist-table th {
  background: var(--dk-gray-100);
  color: var(--dk-gray-700);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  text-align: left;
}
.dk-wishlist-table td {
  padding: 16px;
  border-top: 1px solid var(--dk-gray-200);
  vertical-align: middle;
}
.dk-wl-thumb {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: var(--dk-radius-sm);
  background: var(--dk-gray-50);
}
.dk-wl-title a {
  color: var(--dk-gray-900);
  text-decoration: none;
  font-weight: 600;
}
.dk-wl-title a:hover {
  color: var(--dk-primary);
}
.dk-wl-sku {
  font-size: 12px;
  color: var(--dk-gray-500);
}
.dk-wl-remove-btn {
  background: transparent;
  border: none;
  color: var(--dk-gray-500);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}
.dk-wl-remove-btn:hover {
  color: var(--dk-danger);
}
.dk-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: var(--dk-radius-md);
  border: 1px dashed var(--dk-gray-300);
}
.dk-empty-state h3 {
  font-size: 20px;
  color: var(--dk-gray-900);
  margin: 16px 0 8px 0;
}
.dk-empty-state p {
  color: var(--dk-gray-500);
  margin-bottom: 24px;
}

/* Live Search Dropdown */
.dk-live-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--dk-gray-200);
  border-radius: var(--dk-radius-md);
  box-shadow: var(--dk-shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  margin-top: 6px;
}
.dk-live-search-results.active {
  display: block;
}
.dk-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dk-gray-100);
  text-decoration: none;
  transition: background 0.15s ease;
}
.dk-search-item:hover {
  background: var(--dk-gray-50);
}
.dk-search-thumb {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: var(--dk-radius-sm);
  background: var(--dk-gray-100);
}
.dk-search-details {
  flex-grow: 1;
}
.dk-search-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dk-gray-900);
  margin: 0 0 2px 0;
}
.dk-search-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--dk-primary);
}
