/* Custom CSS Variables */
:root {
  --brand-accent: #2563eb;
  --brand-accent-strong: #1d4ed8;
  --brand-dark: #1e3a8a;
  --navbar-dark-soft: #1e40af;
  --page-bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --border-soft: #dbe5f1;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --btn-primary-height: 46px;
  --section-space: 4.5rem;
  --light-blue: #e8f0ff;
  --light-green: #e9f6ff;
  --light-yellow: #edf4ff;
  --light-purple: #eff3ff;
  --light-red: #eef2ff;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  background: var(--page-bg);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.55) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}

.btn {
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  min-height: 42px;
  padding: 0.62rem 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.btn-lg {
  min-height: 48px;
  padding: 0.78rem 1.5rem;
  font-size: 1rem;
  border-radius: 14px;
}

.btn-sm {
  min-height: 34px;
  padding: 0.42rem 0.85rem;
  font-size: 0.86rem;
  border-radius: 10px;
}

.btn-primary,
.btn-success,
.btn-warning,
.order-btn,
.add-to-cart-btn,
#addToCartBtn,
#productsCtaLink,
button[data-action="remove"] {
  min-height: var(--btn-primary-height) !important;
}

section {
  position: relative;
}

#categories,
#products,
#services,
#testimonials {
  padding-top: var(--section-space) !important;
  padding-bottom: var(--section-space) !important;
}

.display-3 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.display-5 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
}

.text-center>.text-muted,
.text-center>.lead {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Navigation Bar */
.navbar {
  min-height: 84px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.navbar.bg-white {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.navbar-brand .brand-text {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--brand-accent) !important;
}

.brand-logo {
  height: 70px;
  width: auto;
  max-width: 420px;
  object-fit: contain;
  display: block;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  filter: none !important;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.navbar-brand {
  background-color: #ffffff;
  padding-top: 0;
  padding-bottom: 0;
}

.footer-brand-logo {
  height: 110px;
  max-width: 480px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.18));
}

@media (max-width: 991px) {
  .navbar {
    min-height: 74px;
  }

  .brand-logo {
    height: 58px;
    max-width: 340px;
  }

  .footer-brand-logo {
    height: 80px;
    max-width: 260px;
  }
}

@media (max-width: 600px) {
  .navbar {
    min-height: 66px;
  }

  .brand-logo {
    height: 50px;
    max-width: 280px;
  }

  .footer-brand-logo {
    height: 44px;
    max-width: 120px;
  }
}

.navbar-brand img {
  transition: transform 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.04);
}

.nav-link {
  color: var(--brand-dark) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.65rem !important;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--brand-accent) !important;
  background-color: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.nav-link:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.nav-link.active {
  color: var(--brand-accent) !important;
  background-color: rgba(37, 99, 235, 0.14);
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--brand-accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link.active::after {
  width: 80%;
}

#cartCount {
  background-color: #dc3545 !important;
  color: #fff !important;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.28rem 0.42rem;
  margin-left: 0.4rem;
  min-width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
  position: relative;
  top: -1px;
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.35);
}

.btn-signup {
  background-color: var(--brand-accent) !important;
  color: white !important;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 46px;
  min-width: 118px;
  padding: 0.62rem 1.28rem !important;
  border: 1px solid var(--brand-accent-strong);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-signup:hover {
  background-color: var(--brand-accent-strong) !important;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.35);
  transform: translateY(-1px) !important;
}

.btn-signin {
  border: 1px solid rgba(37, 99, 235, 0.38);
  background-color: #ffffff;
  color: var(--brand-accent) !important;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 46px;
  min-width: 118px;
  padding: 0.62rem 1.28rem !important;
  margin-right: 0.6rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-signin::after,
.btn-signup::after {
  display: none;
}

.btn-signin:hover {
  background-color: rgba(37, 99, 235, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.52);
  color: var(--brand-accent-strong) !important;
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px) !important;
}

/* Navbar Responsive Fix */
@media (max-width: 991px) {
  .navbar-collapse {
    text-align: center;
  }

  .navbar-nav {
    align-items: center;
  }

  .nav-item {
    margin: 0.25rem 0;
  }

  .btn-signup {
    margin-top: 0.5rem;
    display: inline-flex !important;
    min-width: 132px;
  }

  .btn-signin {
    margin-top: 0.5rem;
    margin-right: 0;
    display: inline-flex !important;
    min-width: 132px;
  }
}

/* Hero Section */
.hero-section {
  background-image:
    linear-gradient(115deg, rgba(15, 23, 42, 0.78) 0%, rgba(30, 58, 138, 0.56) 55%, rgba(37, 99, 235, 0.35) 100%),
    url("../assets/shop.jpeg");
  background-size: cover;
  background-position: 50% 28%;
  background-repeat: no-repeat;
  min-height: 64vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

@media (max-width: 991px) {
  .hero-section {
    background-position: 50% 22%;
  }
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.26) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-content .lead {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.hero-section h1 {
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-section p {
  color: white;
}

.btn-primary {
  background-color: var(--brand-accent) !important;
  border: none !important;
  box-shadow: 0 8px 14px rgba(26, 29, 41, 0.14);
}

.btn-primary:hover {
  background-color: var(--brand-accent-strong) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.btn-outline-light {
  border: 2px solid white;
}

.btn-outline-light:hover {
  background-color: white;
  color: var(--brand-accent) !important;
  transform: translateY(-3px);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.fade-in-up.delay-1 {
  animation-delay: 0.2s;
}

.fade-in-up.delay-2 {
  animation-delay: 0.4s;
}

.fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.fade-in.delay-1 {
  animation-delay: 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in-up,
  .fade-in {
    opacity: 1;
    animation: none !important;
  }
}

/* Category Cards */
.category-card {
  padding: 2rem 1rem;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  cursor: pointer;
}

.category-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.bg-light-blue {
  background-color: var(--light-blue);
  color: var(--brand-accent-strong);
}

.bg-light-green {
  background-color: var(--light-green);
  color: var(--brand-accent-strong);
}

.bg-light-yellow {
  background-color: var(--light-yellow);
  color: var(--brand-accent);
}

.bg-light-purple {
  background-color: var(--light-purple);
  color: var(--brand-accent-strong);
}

.bg-light-red {
  background-color: var(--light-red);
  color: var(--brand-accent-strong);
}

.card-hover {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(17, 24, 39, 0.1);
}

.category-card:hover .category-icon {
  transform: scale(1.05);
}

/* Product Cards */
.product-card {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.product-card img {
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.product-card .card-body {
  padding: 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
}

.product-card .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-accent);
}

.product-card .btn-sm {
  min-height: 36px;
  padding: 0.45rem 0.95rem;
}

.btn-success {
  background-color: #16a34a !important;
  border-color: #16a34a !important;
}

.btn-success:hover {
  background-color: #15803d !important;
  border-color: #15803d !important;
  transform: translateY(-1px);
}

.btn-outline-secondary,
.btn-secondary {
  border-color: #c4d1e2 !important;
  color: #334155 !important;
}

.btn-outline-secondary:hover,
.btn-secondary:hover {
  background-color: #eef3fa !important;
  border-color: #b2c3da !important;
  color: #0f172a !important;
  transform: translateY(-1px);
}

.btn-outline-primary:hover {
  transform: translateY(-1px);
}

.btn-danger:hover {
  transform: translateY(-1px);
}

.order-btn {
  background-color: var(--brand-accent) !important;
  border: none !important;
}

.order-btn:hover {
  background-color: var(--brand-accent-strong) !important;
}

/* Service Cards */
.service-card {
  padding: 2.25rem 1.5rem;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  height: 100%;
}

.service-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Testimonial Cards */
.testimonial-card {
  padding: 2rem;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  height: 100%;
  transition: all 0.3s ease;
}

.testimonial-card img {
  border: 3px solid var(--brand-accent);
}

/* Circular avatar for testimonials: enforces circle and crops images */
.testimonial-avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  border: 3px solid var(--brand-accent);
  display: inline-block;
}

/* Smaller avatar on very small screens */
@media (max-width: 576px) {
  .testimonial-avatar {
    width: 48px;
    height: 48px;
    border-width: 2px;
  }
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #1f4fc0 60%, #2563eb 100%);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.cta-section .container {
  position: relative;
  z-index: 1;
}

.btn-warning {
  background-color: var(--brand-accent) !important;
  color: #fff !important;
  border: none !important;
}

.btn-warning:hover {
  background-color: var(--brand-accent-strong) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
}

#products,
#testimonials {
  background-color: var(--surface-soft) !important;
}

/* Footer */
.footer {
  background:
    radial-gradient(circle at 20% 20%,
      rgba(37, 99, 235, 0.18) 0%,
      rgba(37, 99, 235, 0) 35%),
    var(--brand-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer .footer-title {
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.footer .footer-text {
  color: rgba(255, 255, 255, 0.78) !important;
}

.footer .footer-links li {
  margin-bottom: 0.6rem;
}

.footer a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.86) !important;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.footer a:hover {
  color: var(--brand-accent) !important;
  transform: translateX(4px);
}

.social-icons a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-5px);
  background: rgba(37, 99, 235, 0.22);
  color: var(--brand-accent) !important;
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.footer-bottom {
  color: rgba(255, 255, 255, 0.72) !important;
  letter-spacing: 0.02em;
}

/* Responsive Design */
@media (max-width: 768px) {

  #categories,
  #products,
  #services,
  #testimonials {
    padding-top: 3.75rem !important;
    padding-bottom: 3.75rem !important;
  }

  .hero-section {
    min-height: 60vh;
    padding: 2rem 0;
    background-attachment: scroll;
  }

  .hero-section h1 {
    font-size: 2.5rem;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 300px;
    margin: 0 !important;
  }

  .category-card {
    padding: 1.5rem 0.5rem;
  }

  .category-icon {
    width: 60px;
    height: 60px;
  }

  .category-icon i {
    font-size: 1.5rem !important;
  }

  .product-card img {
    height: 200px;
  }

  .service-card {
    padding: 2rem 1rem;
  }

  .service-icon {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 576px) {

  #categories,
  #products,
  #services,
  #testimonials {
    padding-top: 3.1rem !important;
    padding-bottom: 3.1rem !important;
  }

  .hero-section {
    min-height: 50vh;
    background-attachment: scroll;
  }

  .hero-section h1 {
    font-size: 1.75rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  }

  .hero-section .lead {
    font-size: 1rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
  }

  .btn-lg {
    min-height: 44px;
    padding: 0.68rem 1.15rem;
    font-size: 0.95rem;
  }

  .hero-buttons .btn {
    max-width: 280px;
  }

  .display-5 {
    font-size: 2rem;
  }

  .category-card h5 {
    font-size: 0.9rem;
  }

  .navbar-brand .brand-text {
    font-size: 1.1rem;
  }

  .brand-logo {
    height: 48px;
  }
}

/* Loading Animation */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Toast Notifications */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.toast-container-custom {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: auto;
  min-width: 320px;
  max-width: 90vw;
  pointer-events: none;
}

.toast-custom {
  min-width: 320px;
  max-width: 90vw;
  width: min(560px, 90vw);
  padding: 1.25rem 1.75rem;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  animation: slideOutUp 0.25s ease forwards;
  font-size: 1.05rem;
  font-weight: 500;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.5;
}

.toast-message {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-custom.show {
  animation: slideInDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-warning {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.toast-info {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.toast-close {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.toast-close:active {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
  .toast-custom {
    font-size: 1rem;
    padding: 1rem 1.5rem;
  }
}

@media (max-width: 576px) {
  .toast-container-custom {
    top: 0.75rem;
    left: 50%;
    right: auto;
    width: 96vw;
    min-width: 0;
    max-width: 96vw;
    padding: 0;
    gap: 0.5rem;
  }

  .toast-custom {
    min-width: 0;
    width: 100%;
    font-size: 0.95rem;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }

  .toast-close {
    font-size: 1.2rem;
    min-width: 1.8rem;
    min-height: 1.8rem;
    margin-left: 0.75rem;
  }
}