@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
  --primary: #facc15;
  /* More vibrant, modern yellow */
  --primary-hover: #eab308;
  --bg: #f8fafc;
  /* Softer slate-gray background */
  --text: #1e293b;
  /* Sleeker dark slate text */
  --text-muted: #64748b;
  --header-bg: #0f172a;
  /* Deep, rich slate */
  --footer-bg: #0f172a;
  --card-bg: #ffffff;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: all 0.3s ease;
}

a {
  text-decoration: none;
  color: white;
}

/* ==== Buttons ==== */
.btn,
.actions button,
.btn1,
.search-bar button,
.shop-btn,
.pagination a {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #0f172a;
  /* Dark text on yellow for premium contrast */
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(250, 204, 21, 0.3), 0 2px 4px -2px rgba(250, 204, 21, 0.3);
}

.btn:hover,
.actions button:hover,
.btn1:hover,
.search-bar button:hover,
.shop-btn:hover,
.pagination a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(250, 204, 21, 0.4), 0 4px 6px -4px rgba(250, 204, 21, 0.4);
}

.btn:active,
.actions button:active,
.btn1:active,
.search-bar button:active,
.shop-btn:active {
  transform: translateY(0);
}

.btn i,
.actions button i,
.btn1 i {
  font-size: 16px;
  margin-right: 6px;
}

/* Header */
header {
  width: 100%;
  background: var(--header-bg);
  color: white;
  padding: 20px 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.logo img {
  width: 40px;
  height: 40px;
}

/* Search + category wrapper — takes all remaining header space */
.header-main-content {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  gap: 10px;
}

.search-bar {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.search-bar input {
  flex: 1;
  padding: 16px 18px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
}

.search-bar button {
  padding: 16px 20px;
  font-size: 16px;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--primary);
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: white;
  font-weight: 500;
}

.nav-links.show {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 70px;
  right: 30px;
  background: var(--header-bg);
  padding: 20px;
  border-radius: 8px;
  z-index: 1000;
}

/* 🔷 Categories Select Styling */
.categories-select {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 15px;
  flex: 1 1 auto;
  max-width: 220px;
}

.categories-select label {
  font-weight: bold;
  color: white;
  margin-right: 8px;
  white-space: nowrap;
}

.categories-select select {
  padding: 10px;
  font-size: 15px;
  font-weight: bold;
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 200px;
  max-width: 100%;
  box-sizing: border-box;

  /* remove default arrow */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* extra space for custom arrow */
  padding-right: 35px;
  background-image: none;
}

/* custom arrow */
.categories-select::after {
  content: "▼";
  font-size: 12px;
  color: #333;
  position: absolute;
  right: 12px;
  pointer-events: none;
  transition: color 0.3s ease;
}

.categories-select:hover::after,
.categories-select select:focus+ ::after {
  color: var(--primary);
}

/* Add lines between category options */
.categories-select select option {
  border-bottom: 1px solid #ddd;
  padding: 8px;
}

.categories-select select option:last-child {
  border-bottom: none;
}

/* 📱 Mobile adjustment */
@media (max-width: 768px) {
  .categories-select {
    display: block;
    margin: 10px 0;
    width: 100% !important;
  }

  .categories-select select {
    width: 100% !important;
  }
}

/* ===================== SLIDER ===================== */
.slider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px;
  gap: 30px;
  background: #fdfdfd;
}

.slider-left {
  flex: 1;
}

.slider-left h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.slider-left p {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #555;
}

.shop-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
}

.slider-right {
  flex: 2;
  overflow: hidden;
}

.slider-container {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.slide {
  flex: 0 0 100%;
  padding: 5px;
  box-sizing: border-box;
}

.slide img {
  width: 100%;
  height: 350px;
  object-fit: contain;
  border-radius: 8px;
}

/* ===================== Products ===================== */
.products {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  width: 100%;
}

.product-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 360px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow-hover);
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: transform 0.5s ease;
}

.product-card:hover img {
  transform: scale(1.03);
}

.product-card h4 {
  font-size: 18px;
  margin: 5px 0;
  font-weight: 600;
  color: var(--header-bg);
}

.product-card p {
  margin: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* Colors */
.color-options {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.color-btn {
  width: 22px;
  height: 22px;
  border: 2px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.color-btn:hover {
  transform: scale(1.2);
  border: 2px solid var(--primary);
}

/* Sizes */
.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  justify-content: center;
}

.size-btn {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease, border 0.2s ease;
}

.size-btn:hover {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
}

/* Stock & Price */
.selected-stock {
  font-weight: bold;
  color: #e63946;
}

.selected-price {
  font-size: 18px;
  font-weight: bold;
  color: var(--header-bg);
}

/* Quantity Input */
.quantity-input {
  width: 60px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s ease;
}

.product-card .quantity-input {
  margin-bottom: 10px;
}

.quantity-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 3px rgba(240, 192, 64, 0.5);
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  opacity: 0.5;
}

/* Cart Button inside Card */
.product-card form {
  width: 100%;
  margin-top: 12px;
}

.product-card .btn1 {
  padding: 12px;
  width: 100%;
  justify-content: center;
}

/* ✅ Always full width on smaller screens */
@media (max-width: 1024px) {
  .products {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* ✅ Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px auto;
  width: fit-content;
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.pagination {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination a {
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination a.active-page,
.pagination a[style*="font-weight:bold"] {
  background-color: var(--header-bg);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
  background: var(--footer-bg);
  color: #eee;
  padding: 40px 30px;
  font-size: 14px;
}

footer h4 {
  color: var(--primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
}

.footer-grid ul li {
  margin-bottom: 8px;
}

.footer-grid a {
  color: var(--primary);
}

.footer-grid a:hover {
  text-decoration: underline;
}

.footer-note {
  margin-top: 20px;
  font-style: italic;
  color: #ccc;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  font-size: 12px;
  color: #aaa;
}

footer i {
  margin-right: 8px;
  color: var(--primary);
}

/* === Cart Icon === */
.cart-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 14px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1001;
  transition: transform 0.2s ease, background 0.3s ease;
}

.cart-icon:hover {
  background: #d9a82d;
  transform: scale(1.1);
}

.cart-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e63946;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 7px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === Cart Panel === */
.cart-panel {
  position: fixed;
  top: 60px;
  right: -360px;
  /* Hidden state */
  width: 340px;
  max-height: 85vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  padding: 24px;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-radius: 16px 0 0 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.6);
}

.cart-panel.active {
  right: 20px;
}

.cart-panel h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

#cartItems {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
}

#cartItems::-webkit-scrollbar {
  width: 5px;
}

#cartItems::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 6px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cart-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item button {
  background: red;
  color: white;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}

#buyNowBtn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #0f172a;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(250, 204, 21, 0.3);
}

#buyNowBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(250, 204, 21, 0.4);
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
  }

  .nav-links.show {
    gap: 15px;
    padding: 15px;
    right: 20px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .search-bar {
    flex-direction: row;
    width: 100%;
  }

  .search-bar input {
    flex: 1;
    width: auto;
  }

  .search-bar button {
    width: auto;
  }

  .slider {
    flex-direction: column;
    padding: 20px;
    gap: 15px;
  }

  .slide img {
    height: 300px;
  }

  .slider-left h2 {
    font-size: 1.5rem;
  }

  .slider-left p {
    font-size: 0.9rem;
  }

  .shop-btn {
    padding: 8px 12px;
    font-size: 14px;
  }

  .pagination-wrapper {
    width: 100%;
    padding: 15px;
  }

  .pagination {
    gap: 8px;
  }

  /* ✅ Full width product cards on mobile */
  .products {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}

.h2 {
  margin: 0 auto;
}