/* ==========================================================================
   GG CREATION — E-COMMERCE & SUPPLY CHAIN STYLESHEET
   Flipkart-Style Cart, Checkout, Delivery Address & Supply Chain Tracking
   ========================================================================== */

/* ── Floating Cart Trigger ── */
.floating-cart-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--accent-red), #b91c1c);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.45);
  cursor: pointer;
  z-index: 990;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.floating-cart-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.55);
}

.cart-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ffffff;
  color: var(--accent-red);
  font-size: 0.76rem;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--accent-red);
}

/* ── Cart Drawer (Slide-Over) ── */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1101;
}

.cart-drawer-backdrop.active .cart-drawer {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.cart-drawer-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-empty-state {
  text-align: center;
  padding: 40px 10px;
  color: var(--text-muted);
}

.cart-empty-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 14px;
}

.cart-item-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  align-items: center;
  transition: border-color 0.2s ease;
}

.cart-item-row:hover {
  border-color: rgba(220, 38, 38, 0.3);
}

.cart-item-thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  border: 1px solid var(--border-color);
}

.cart-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-red);
}

.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.cart-qty-btn:hover {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

.cart-qty-val {
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.cart-remove-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.cart-remove-btn:hover {
  color: #ef4444;
}

.cart-drawer-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

/* ── Flipkart Product Card Enhancements ── */
.ecommerce-product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.ecommerce-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  border-color: rgba(220, 38, 38, 0.4);
}

.product-card-img-wrap {
  position: relative;
  width: 100%;
  height: 210px;
  background: #0f1420;
  overflow: hidden;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.ecommerce-product-card:hover .product-card-img {
  transform: scale(1.05);
}

.product-tag-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  color: #10b981;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.product-card-details {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-brand {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-red);
  font-weight: 700;
  margin-bottom: 4px;
}

.product-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 8px;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: #f59e0b;
}

.product-card-pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.price-current {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.price-mrp {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-discount-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #10b981;
}

.product-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.btn-add-cart {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-cart:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: var(--accent-red-subtle);
}

.btn-buy-now {
  background: var(--accent-red);
  border: 1px solid var(--accent-red);
  color: #ffffff;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-buy-now:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
}

/* ── Flipkart Delivery Address Modal ── */
.ecommerce-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ecommerce-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.ecommerce-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-fk {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-fk {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body-fk {
  padding: 24px;
}

.modal-footer-fk {
  padding: 18px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.address-type-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.address-type-radio {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.address-type-radio.selected, .address-type-radio:hover {
  border-color: var(--accent-red);
  background: var(--accent-red-subtle);
}

/* ── Supply Chain Tracker (Flipkart 4-Step Stepper) ── */
.supply-chain-tracker {
  padding: 24px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 18px 0;
}

.stepper-progress {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 20px 10px 10px;
}

.stepper-progress::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  height: 4px;
  background: var(--border-color);
  z-index: 1;
}

.stepper-progress-fill {
  position: absolute;
  top: 16px;
  left: 20px;
  height: 4px;
  background: #10b981;
  z-index: 1;
  transition: width 0.5s ease;
}

.step-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 90px;
}

.step-circle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step-node.completed .step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.step-node.current .step-circle {
  background: var(--bg-card);
  border-color: var(--accent-red);
  color: var(--accent-red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.step-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 10px;
}

.step-node.completed .step-label, .step-node.current .step-label {
  color: var(--text-primary);
  font-weight: 700;
}

.step-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Admin Dashboard Component Styles ── */
.admin-badge-super {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.admin-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.admin-kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-badge.placed {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.processing {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.shipped {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-badge.out_for_delivery {
  background: rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.status-badge.delivered {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN — E-COMMERCE & SUPPLY CHAIN
   ========================================================================== */

/* ── Tablet & Small Laptop (max 1024px) ── */
@media (max-width: 1024px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  
  .cart-drawer {
    max-width: 400px;
  }
}

/* ── Tablet Portrait & Phablet (max 768px) ── */
@media (max-width: 768px) {
  .floating-cart-btn {
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
  }

  .cart-drawer {
    max-width: 100%;
    width: 100%;
  }

  .product-btn-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ecommerce-modal {
    max-width: 95%;
    margin: 12px;
    border-radius: var(--radius-md);
  }

  .modal-header-fk,
  .modal-footer-fk {
    padding: 14px 18px;
  }

  .modal-body-fk {
    padding: 18px;
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .admin-kpi-card {
    padding: 16px;
    gap: 12px;
  }

  .admin-kpi-val {
    font-size: 1.35rem;
  }

  .stepper-progress {
    overflow-x: auto;
    padding-bottom: 12px;
    justify-content: flex-start;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .step-node {
    min-width: 80px;
    flex-shrink: 0;
  }
}

/* ── Standard Mobile (max 480px) ── */
@media (max-width: 480px) {
  .floating-cart-btn {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }

  .cart-badge-count {
    min-width: 19px;
    height: 19px;
    font-size: 0.7rem;
    top: -2px;
    right: -2px;
  }

  .cart-drawer-header {
    padding: 14px 16px;
  }

  .cart-drawer-title {
    font-size: 1.05rem;
  }

  .cart-drawer-body {
    padding: 14px 16px;
    gap: 10px;
  }

  .cart-item-row {
    grid-template-columns: 60px 1fr auto;
    gap: 10px;
    padding: 10px;
  }

  .cart-item-thumb {
    width: 60px;
    height: 60px;
  }

  .cart-item-title {
    font-size: 0.85rem;
  }

  .cart-item-price {
    font-size: 0.9rem;
  }

  .cart-qty-btn {
    width: 28px;
    height: 28px;
  }

  .cart-drawer-footer {
    padding: 14px 16px;
  }

  .cart-summary-total {
    font-size: 1.05rem;
  }

  .address-type-selector {
    flex-direction: column;
    gap: 8px;
  }

  .address-type-radio {
    width: 100%;
    padding: 10px 12px;
  }

  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }

  .admin-kpi-card {
    padding: 14px;
  }

  .ecommerce-modal-backdrop {
    padding: 10px;
  }

  .modal-title-fk {
    font-size: 1.05rem;
  }

  .modal-footer-fk {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .modal-footer-fk .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Ultra-compact Mobile (max 360px) ── */
@media (max-width: 360px) {
  .cart-item-row {
    grid-template-columns: 50px 1fr;
    gap: 8px;
  }

  .cart-remove-btn {
    grid-column: 2 / -1;
    justify-self: end;
    padding: 4px;
  }

  .cart-item-thumb {
    width: 50px;
    height: 50px;
  }

  .product-tag-pill {
    font-size: 0.68rem;
    padding: 3px 8px;
  }
}

