/*
 * Online Mall Shared Stylesheet
 * Brand Color: Energetic Crimson (#ff461f)
 * Target: Mainstream Chinese E-commerce style (Tmall/JD hybrid)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #dc2626; /* Sleek Red 600 */
  --primary-hover: #b91c1c; /* Sleek Red 700 */
  --secondary-color: #1e293b; /* Slate 800 */
  --bg-body: #f8f9fb; /* Soft Light Slate/Gray */
  --text-main: #1e293b; /* Deep Slate 800 */
  --text-muted: #64748b; /* Slate 500 */
  --text-light: #94a3b8; /* Slate 400 */
  --border-color: #e2e8f0; /* Slate 200 */
  --border-light: #f1f5f9; /* Slate 100 */
  --white: #ffffff;
  --success: #10b981; /* Emerald 500 */
  --warning: #f59e0b; /* Amber 500 */
  --danger: #ef4444; /* Red 500 */
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05); /* Modern slate soft shadow */
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.08); /* Modern slate medium shadow */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Reset Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-color);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: 1px solid var(--border-color);
  background: none;
}

button {
  cursor: pointer;
  background-color: transparent;
  border: none;
}

/* Common Layout Container */
.container {
  width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

@media (max-width: 1220px) {
  .container {
    width: 100%;
    padding: 0 20px;
  }
}

/* Top Shortcut Bar */
.shortcut {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
  height: 36px;
  line-height: 34px;
}

.shortcut-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shortcut-left, .shortcut-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.shortcut a {
  color: var(--text-muted);
}
.shortcut a:hover {
  color: var(--primary-color);
}

.shortcut-sep {
  color: var(--border-color);
  font-size: 10px;
}

/* Header Area */
.header {
  background-color: var(--white);
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.logo span {
  background: linear-gradient(135deg, var(--text-main) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo i {
  font-size: 28px;
  color: var(--primary-color) !important;
}

/* Search Box styling */
.search-container {
  flex: 1;
  max-width: 550px;
  margin: 0 50px;
}

.search-box {
  display: flex;
  border: 2px solid var(--primary-color);
  border-radius: 9999px; /* Pill shape search */
  overflow: hidden;
  height: 42px;
  box-shadow: var(--shadow-sm);
  background-color: var(--white);
}

.search-input {
  flex: 1;
  border: none;
  padding: 0 20px;
  font-size: 14px;
  color: var(--text-main);
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-btn {
  background-color: var(--primary-color);
  color: var(--white);
  width: 90px;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 0 9999px 9999px 0;
}

.search-btn:hover {
  background-color: var(--primary-hover);
}

.hot-words {
  margin-top: 6px;
  padding-left: 15px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.hot-words a:hover {
  color: var(--primary-color);
}

/* Mini Cart */
.header-cart {
  position: relative;
}

.cart-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-body);
  border: 1px solid var(--border-light);
  padding: 10px 22px;
  border-radius: 9999px; /* Pill-shaped cart button */
  color: var(--text-main);
  transition: all 0.2s;
  font-weight: 600;
  font-size: 13px;
}

.cart-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: rgba(220, 38, 38, 0.05);
}

.cart-count {
  background-color: var(--primary-color);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  line-height: 1;
}

/* Navigation Bar */
.nav-bar {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  height: 44px;
}

.nav-bar-content {
  display: flex;
  align-items: center;
  height: 100%;
}

.category-trigger {
  width: 210px;
  background-color: var(--primary-color);
  color: var(--white);
  font-weight: bold;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  cursor: pointer;
  position: relative;
}

.nav-links {
  display: flex;
  gap: 30px;
  margin-left: 30px;
  font-size: 15px;
  font-weight: bold;
}

.nav-links a {
  height: 44px;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-links a.active, .nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
}

/* Sidebar Categories Menu (Inside Trigger/Home page) */
.category-dropdown {
  position: absolute;
  top: 44px;
  left: 0;
  width: 210px;
  background-color: var(--white);
  color: var(--text-main);
  z-index: 100;
  padding: 10px 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
}

.category-trigger:hover .category-dropdown,
.category-dropdown.always-show {
  display: block;
}

.category-item {
  padding: 11px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.category-item:hover {
  background-color: #fef2f2; /* Soft red bg */
  color: var(--primary-color);
}

.category-submenu {
  position: absolute;
  top: 0;
  left: 210px;
  width: 700px;
  min-height: 420px;
  background-color: var(--white);
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  padding: 24px;
  display: none;
  z-index: 101;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.category-item:hover .category-submenu {
  display: block;
}

.submenu-section {
  margin-bottom: 20px;
  display: flex;
}

.submenu-section-title {
  width: 80px;
  font-weight: bold;
  color: var(--text-main);
  border-right: 1px solid var(--border-color);
  padding-right: 10px;
  margin-right: 15px;
  font-size: 12px;
}

.submenu-links {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.submenu-links a {
  font-size: 12px;
  color: #666;
}

.submenu-links a:hover {
  color: var(--primary-color);
}

/* Footer Section */
.footer {
  background-color: var(--white);
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
}

.copyright {
  text-align: center;
  padding: 30px 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 15px 0;
  font-size: 12px;
  color: #666666;
}

.breadcrumbs i {
  margin: 0 8px;
  color: var(--text-light);
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

/* Common Product Card */
.product-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-light);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(220, 38, 38, 0.2);
}

.product-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background-color: var(--bg-body);
  overflow: hidden;
}

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

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

.product-info {
  padding: 18px;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 8px;
}

.price-symbol {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 700;
}

.price-amount {
  font-size: 22px;
  color: var(--primary-color);
  font-weight: 800;
}

.price-original {
  font-size: 12px;
  text-decoration: line-through;
  color: var(--text-light);
  margin-left: 6px;
}

.product-title {
  font-size: 14px;
  line-height: 1.5;
  height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 12px;
  color: var(--text-main);
  font-weight: 600;
}

.product-title:hover {
  color: var(--primary-color);
}

.product-tags {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.product-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.tag-red {
  background-color: #fef2f2;
  color: var(--primary-color);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

.tag-gold {
  background-color: #fffbeb;
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md); /* Smooth rounder buttons */
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.2);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.12);
}

.btn-secondary:hover {
  opacity: 0.95;
  background-color: #0f172a;
  color: var(--white);
  box-shadow: 0 6px 16px rgba(30, 41, 59, 0.2);
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: var(--text-main);
  background-color: var(--white);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: rgba(220, 38, 38, 0.04);
}
  background-color: var(--white);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: #fff8f6;
}

.btn-lg {
  padding: 12px 30px;
  font-size: 16px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #444;
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 70, 31, 0.1);
}

textarea.form-control {
  height: auto;
  padding: 10px 12px;
}

/* Steps Indicator */
.steps-wrapper {
  background-color: var(--white);
  padding: 25px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.steps-list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.steps-list::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 5%;
  right: 5%;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 20%;
}

.step-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e5e5e5;
  color: #888888;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s;
}

.step-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.3s;
}

.step-item.active .step-node {
  background-color: var(--primary-color);
  color: var(--white);
}

.step-item.active .step-title {
  color: var(--primary-color);
  font-weight: bold;
}

.step-item.completed .step-node {
  background-color: #fff0f0;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.step-item.completed .step-title {
  color: #333;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-md);
  width: 450px;
  max-width: 90%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.3s ease;
}

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

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-weight: bold;
  font-size: 16px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: #fafafa;
}

.close-btn {
  font-size: 20px;
  color: var(--text-light);
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text-main);
}

/* Table Design */
.table-custom {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--white);
}

.table-custom th {
  background-color: #fafafa;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 15px;
  text-align: left;
  font-weight: bold;
  font-size: 13px;
  color: #666;
}

.table-custom td {
  padding: 15px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

/* Tab container */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--white);
}

.tab-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #666666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover, .tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active {
  border-bottom-color: var(--primary-color);
  font-weight: bold;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border-radius: 10px;
  text-align: center;
}

.badge-success { background-color: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.badge-warning { background-color: #fff7e6; color: #faad14; border: 1px solid #ffd591; }
.badge-danger { background-color: #fff1f0; color: #f5222d; border: 1px solid #ffa39e; }
.badge-neutral { background-color: #f5f5f5; color: #666; border: 1px solid #d9d9d9; }

/* Shopping Cart Floating Widget (Everywhere but Cart page itself) */
.floating-widget {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--white);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555555;
  font-size: 18px;
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  position: relative;
}

.widget-btn:hover {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.widget-btn .widget-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--danger);
  color: var(--white);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: bold;
}
