:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --secondary: #7c3aed;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --dark: #1e293b;
  --darker: #0f172a;
  --light: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* Import Google Font */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* ===== CONTAINER ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== HEADER ===== */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--gray-200);
}

.top-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo a {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: var(--transition);
}

.logo a:hover {
  transform: scale(1.05);
}

.search-area {
  flex: 1;
  max-width: 600px;
}

.search-form {
  display: flex;
  position: relative;
}

.search-form input {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: 9999px;
  font-size: 1rem;
  transition: var(--transition);
  background: white;
}

.search-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.top-icons {
  display: flex;
  gap: 0.75rem;
}

.icon-btn {
  background: var(--gray-100);
  border: none;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark);
  position: relative;
}

.icon-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

#cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  min-width: 20px;
}

nav {
  background: var(--darker);
  padding: 0.75rem 1.5rem;
}

nav ul {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

nav a:hover::after {
  width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 2rem;
  padding: 4rem 2rem;
  margin-bottom: 3rem;
  text-align: center;
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.hero h2 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btn {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.hero-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: var(--gray-100);
}

/* ===== PRODUCT GRID ===== */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: white;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: var(--transition);
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover img {
  transform: scale(1.05);
}

.product-card h2 {
  padding: 1.5rem 1.5rem 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
}

.product-card p {
  padding: 0 1.5rem 0.5rem;
  color: var(--gray-500);
  font-size: 0.95rem;
  flex: 1;
}

.price {
  padding: 0.5rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.product-card .button {
  margin: 1rem 1.5rem 1.5rem;
  padding: 0.875rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.product-card .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===== DRAWER ===== */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 320px;
  background: white;
  box-shadow: var(--shadow-xl);
  transform: translateX(-100%);
  transition: var(--transition);
  z-index: 1100;
  padding: 2rem;
  overflow-y: auto;
}

.drawer.show {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.drawer-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--gray-400);
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

.drawer-categories {
  list-style: none;
}

.drawer-categories li {
  margin-bottom: 0.5rem;
}

.drawer-categories a {
  display: block;
  padding: 0.875rem 1rem;
  color: var(--dark);
  text-decoration: none;
  border-radius: 0.75rem;
  transition: var(--transition);
  font-weight: 500;
}

.drawer-categories a:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  transform: translateX(8px);
}

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 1200;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 2rem 2rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--gray-200);
}

.modal-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-body {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.modal-body img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 1rem;
}

.modal-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.modal-info p {
  color: var(--gray-500);
  margin-bottom: 1rem;
}

/* ===== PRODUCT DETAIL PAGE ===== */
.product-detail-container {
  background: white;
  border-radius: 2rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin: 2rem auto;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-500);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.back-button:hover {
  color: var(--primary);
  transform: translateX(-4px);
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.product-image-zoom {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-detail-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  transition: var(--transition);
}

.product-detail-image:hover {
  transform: scale(1.1);
}

.product-detail-info h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--dark);
}

.product-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.product-detail-description {
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.product-features {
  background: var(--gray-100);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.product-features h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.product-features ul {
  list-style: none;
}

.product-features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-500);
}

.product-features li:last-child {
  border-bottom: none;
}

.product-features strong {
  color: var(--dark);
}

.product-detail-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-detail-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  flex: 1;
  min-width: 150px;
}

.cancel-btn {
  background: var(--gray-200);
  color: var(--dark);
}

.cancel-btn:hover {
  background: var(--gray-300);
  transform: translateY(-2px);
}

.buy-btn,
.continue-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.buy-btn:hover,
.continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===== CART ===== */
#cartItems {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 2rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  color: var(--dark);
}

.cart-item-price {
  color: var(--primary);
  font-weight: 500;
}

.cart-item button {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition);
}

.cart-item button:hover {
  transform: scale(1.2);
}

.cart-total {
  padding: 1.5rem 2rem;
  text-align: right;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  border-top: 2px solid var(--gray-200);
}

.checkout-btn {
  margin: 0 2rem 2rem;
  padding: 1rem;
  width: calc(100% - 4rem);
  background: linear-gradient(135deg, var(--success), var(--primary));
  color: white;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ===== CONTACT PAGE ===== */
.contact-container {
  background: white;
  border-radius: 2rem;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 2rem auto;
}

.contact-container h1 {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-form label {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: -1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--darker);
  color: white;
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
  border-radius: 3rem 3rem 0 0;
}

.footer-item {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}

.footer-item h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.footer-item p {
  color: var(--gray-300);
  line-height: 1.8;
}

.footer-item a {
  color: var(--gray-300);
  text-decoration: none;
  transition: var(--transition);
}

.footer-item a:hover {
  color: var(--accent);
}

/* ===== NOTIFICATION ===== */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--success);
  color: white;
  padding: 1rem 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideInRight 0.3s ease;
  display: none;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .top-bar {
    flex-wrap: wrap;
  }

  .search-area {
    order: 3;
    max-width: 100%;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-detail-image {
    height: 400px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .top-icons {
    gap: 0.5rem;
  }

  .icon-btn span:not(#cart-count) {
    display: none;
  }

  nav ul {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .hero h2 {
    font-size: 2.5rem;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .product-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .footer-item {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .product-list {
    grid-template-columns: 1fr;
  }

  .product-detail-container {
    padding: 1rem;
  }

  .product-detail-buttons {
    flex-direction: column;
  }

  .product-detail-btn {
    width: 100%;
  }

  .contact-container {
    padding: 2rem 1rem;
  }

  .modal-content {
    width: 95%;
  }

  .cart-item {
    flex-wrap: wrap;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.5s ease forwards;
}

.product-card:nth-child(2) {
  animation-delay: 0.1s;
}

.product-card:nth-child(3) {
  animation-delay: 0.2s;
}

.product-card:nth-child(4) {
  animation-delay: 0.3s;
}

.product-card:nth-child(5) {
  animation-delay: 0.4s;
}

.product-card:nth-child(6) {
  animation-delay: 0.5s;
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.shine {
  position: relative;
  overflow: hidden;
}

.shine::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  from {
    transform: translateX(-100%) rotate(30deg);
  }
  to {
    transform: translateX(100%) rotate(30deg);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
