/* ========================================
   Modern E-Commerce Theme for ClickserviceTheme
   ======================================== */

/* === CSS Variables for Easy Customization === */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-dark: #111827;
  --border-color: #e5e7eb;
  --border-radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Global Resets and Base Styles === */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  line-height: 1.6;
  font-size: 16px;
  margin: 0;
  padding: 0;
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.75rem;
}
h4 {
  font-size: 1.5rem;
}
h5 {
  font-size: 1.25rem;
}
h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* === Modern Header Styles === */
.header,
header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.top-bar {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-menu a:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

/* === Modern Search Bar === */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 600px;
  margin: 0 2rem;
}

.search-input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-secondary);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: var(--shadow-md);
}

.search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.search-button:hover {
  background: var(--primary-dark);
}

/* === Modern Buttons === */
.btn,
button:not(.search-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-success {
  background: var(--secondary-color);
  color: white;
}

/* === Modern Card Styles === */
.card,
.product-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.card:hover,
.product-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-text {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* === Product Price === */
.price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.price-old {
  font-size: 1.25rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.price-badge {
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* === Modern Footer === */
.footer,
footer {
  background: var(--bg-dark);
  color: #d1d5db;
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #d1d5db;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 1.5rem;
  text-align: center;
  color: #9ca3af;
}

/* === Basket/Cart Styles === */
.basket-preview,
.cart-preview {
  position: relative;
  cursor: pointer;
}

.basket-badge,
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.basket-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.basket-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

/* === Breadcrumbs === */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  margin: 1rem auto;
  max-width: 1400px;
  font-size: 0.875rem;
}

.breadcrumb-item {
  color: var(--text-secondary);
}

.breadcrumb-item::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-light);
}

.breadcrumb-item:last-child::after {
  content: "";
}

/* === Filter Sidebar === */
.filter-sidebar {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

/* === Badges and Tags === */
.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-new {
  background: var(--secondary-color);
  color: white;
}

.badge-sale {
  background: var(--accent-color);
  color: white;
}

/* === Rating Stars === */
.rating {
  display: flex;
  gap: 0.25rem;
  color: var(--accent-color);
  font-size: 1rem;
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  .search-wrapper {
    margin: 0;
    max-width: 100%;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }

  h1 {
    font-size: 1.875rem;
  }
  h2 {
    font-size: 1.5rem;
  }
}

/* === Animations === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* === Loading States === */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === Notifications === */
.notification {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-md);
}

.notification-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--secondary-color);
}

.notification-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.notification-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--primary-color);
}

/* === Override Ceres Default Styles === */

/* Top Bar Styling */
.top-bar,
.wrapper-top {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
  color: white !important;
  padding: 0.5rem 0 !important;
}

.top-bar a,
.wrapper-top a {
  color: white !important;
}

/* Header Styling */
.wrapper-header,
#page-header {
  background: var(--bg-primary) !important;
  box-shadow: var(--shadow-md) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
}

/* Navigation */
.mainmenu,
.navbar-nav {
  gap: 1rem !important;
}

.mainmenu a,
.nav-link {
  border-radius: 8px !important;
  padding: 0.5rem 1rem !important;
  transition: var(--transition) !important;
}

.mainmenu a:hover,
.nav-link:hover {
  background: var(--bg-secondary) !important;
  color: var(--primary-color) !important;
}

/* Search Bar */
.search-box input,
.search-input {
  border-radius: var(--border-radius) !important;
  border: 2px solid var(--border-color) !important;
  padding: 0.75rem 1rem !important;
  transition: var(--transition) !important;
}

.search-box input:focus,
.search-input:focus {
  border-color: var(--primary-color) !important;
  box-shadow: var(--shadow-md) !important;
  outline: none !important;
}

/* Buttons - Override Ceres */
.btn,
button[class*="btn"] {
  border-radius: var(--border-radius) !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: none !important;
}

.btn-primary,
.btn-appearance {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
  color: white !important;
  box-shadow: var(--shadow-md) !important;
}

.btn-primary:hover,
.btn-appearance:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-lg) !important;
}

.btn-secondary,
.btn-outline {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 2px solid var(--border-color) !important;
}

.btn-secondary:hover,
.btn-outline:hover {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}

/* Product Cards - Override Ceres */
.product-list .cmp-product-thumb,
.category-item,
.widget-item-list .item-list-frame {
  background: var(--bg-primary) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-sm) !important;
  border: 1px solid var(--border-color) !important;
  overflow: hidden !important;
  transition: var(--transition) !important;
}

.product-list .cmp-product-thumb:hover,
.category-item:hover {
  box-shadow: var(--shadow-xl) !important;
  transform: translateY(-4px) !important;
}

.product-list img,
.category-item img {
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  transition: var(--transition) !important;
}

.product-list .cmp-product-thumb:hover img,
.category-item:hover img {
  transform: scale(1.05) !important;
}

/* Product Prices */
.price,
.product-price {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--primary-color) !important;
}

.crossprice,
.price-old {
  color: var(--text-light) !important;
  text-decoration: line-through !important;
}

/* Badges */
.badge-primary {
  background: var(--primary-color) !important;
  border-radius: 20px !important;
}

.badge-success {
  background: var(--secondary-color) !important;
  border-radius: 20px !important;
}

.badge-warning {
  background: var(--accent-color) !important;
  border-radius: 20px !important;
}

/* Footer */
.wrapper-footer,
#page-footer {
  background: var(--bg-dark) !important;
  color: #d1d5db !important;
  padding: 3rem 2rem 1rem !important;
  margin-top: 4rem !important;
}

.wrapper-footer a,
#page-footer a {
  color: #d1d5db !important;
  transition: var(--transition) !important;
}

.wrapper-footer a:hover,
#page-footer a:hover {
  color: var(--primary-light) !important;
}

.wrapper-footer h3,
.wrapper-footer h4,
#page-footer h3,
#page-footer h4 {
  color: white !important;
}

/* Breadcrumbs */
.breadcrumbs,
.breadcrumb {
  background: var(--bg-primary) !important;
  border-radius: var(--border-radius) !important;
  padding: 1rem !important;
  margin: 1rem 0 !important;
}

/* Shopping Cart */
.basket-preview-hover {
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-lg) !important;
}

.basket-item {
  border-radius: var(--border-radius) !important;
  padding: 1rem !important;
  margin-bottom: 1rem !important;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
}

/* Category Filters */
.sidebar-categories,
.filter-sidebar {
  background: var(--bg-primary) !important;
  border-radius: var(--border-radius) !important;
  padding: 1.5rem !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Pagination */
.pagination {
  gap: 0.5rem !important;
}

.page-item .page-link {
  border-radius: 8px !important;
  border: 1px solid var(--border-color) !important;
  padding: 0.5rem 1rem !important;
  transition: var(--transition) !important;
}

.page-item.active .page-link {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.page-item .page-link:hover {
  background: var(--bg-secondary) !important;
  border-color: var(--primary-color) !important;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  border-radius: var(--border-radius) !important;
  border: 2px solid var(--border-color) !important;
  padding: 0.75rem 1rem !important;
  transition: var(--transition) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: var(--shadow-md) !important;
  outline: none !important;
}

/* Tabs */
.nav-tabs {
  border-bottom: 2px solid var(--border-color) !important;
}

.nav-tabs .nav-link {
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  padding: 1rem 2rem !important;
  color: var(--text-secondary) !important;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color) !important;
  border-bottom-color: var(--primary-color) !important;
  background: transparent !important;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius) !important;
  border-left: 4px solid !important;
  padding: 1rem 1.5rem !important;
}

.alert-success {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border-left-color: var(--secondary-color) !important;
}

.alert-danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-left-color: #ef4444 !important;
}

.alert-info {
  background: #dbeafe !important;
  color: #1e40af !important;
  border-left-color: var(--primary-color) !important;
}

/* Single Item View */
.single-item,
.product-single {
  background: var(--bg-primary) !important;
  border-radius: var(--border-radius) !important;
  padding: 2rem !important;
  box-shadow: var(--shadow-md) !important;
}

/* Improve spacing and layout */
.container-max,
.container {
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

/* Add smooth transitions to everything */
* {
  transition: box-shadow 0.3s ease, transform 0.3s ease !important;
}
