
/* =========================================
   BLURANCY CARTIFY - MAIN STYLESHEET
   ========================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f6f8;
  color: #222;
  line-height: 1.5;
}

/* =========================================
   HEADER
   ========================================= */

header,
.navbar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 5%;
  gap: 20px;
}

.logo,
.logo a {
  color: #2874f0;
  text-decoration: none;
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: #222;
  text-decoration: none;
  font-weight: 600;
}

.nav-links a:hover {
  color: #2874f0;
}

/* =========================================
   SEARCH
   ========================================= */

.search-container {
  flex: 1;
  max-width: 600px;
  display: flex;
  align-items: center;
}

.search-container input,
#searchInput,
.search-input {
  width: 100%;
  height: 42px;
  border: 1px solid #d8d8d8;
  border-radius: 6px 0 0 6px;
  padding: 0 15px;
  font-size: 15px;
  outline: none;
  background: #fff;
}

.search-container input:focus,
#searchInput:focus,
.search-input:focus {
  border-color: #2874f0;
}

.search-container button,
#searchButton,
.search-button {
  height: 42px;
  border: none;
  padding: 0 18px;
  background: #2874f0;
  color: #fff;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  font-weight: 700;
}

.search-container button:hover,
#searchButton:hover,
.search-button:hover {
  background: #1259c7;
}

/* =========================================
   BUTTONS
   ========================================= */

button,
.btn {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.btn,
.primary-btn,
.add-cart,
.add-to-cart,
.buy-now {
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-btn,
.add-cart,
.add-to-cart {
  background: #2874f0;
  color: #fff;
}

.primary-btn:hover,
.add-cart:hover,
.add-to-cart:hover {
  background: #1259c7;
  transform: translateY(-1px);
}

.buy-now {
  background: #ff9f00;
  color: #fff;
}

.buy-now:hover {
  background: #e58c00;
}

/* =========================================
   HERO SECTION
   ========================================= */

.hero {
  width: 100%;
  background: linear-gradient(135deg, #2874f0, #174ea6);
  color: #fff;
  padding: 55px 6%;
  text-align: center;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 52px);
  margin-bottom: 12px;
  font-weight: 800;
}

.hero p {
  font-size: 18px;
  max-width: 700px;
  margin: 0 auto 24px;
  opacity: 0.95;
}

/* =========================================
   MAIN CONTAINER
   ========================================= */

main,
.container {
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 25px 20px;
}

section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 25px;
  margin-bottom: 18px;
  font-weight: 800;
}

/* =========================================
   CATEGORY SECTION
   ========================================= */

.categories {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 5px 0 15px;
}

.category,
.category-btn {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
}

.category:hover,
.category-btn:hover {
  border-color: #2874f0;
  color: #2874f0;
}

/* =========================================
   PRODUCT GRID
   ========================================= */

.products,
.product-grid,
#productContainer,
#productsContainer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

/* =========================================
   PRODUCT CARD
   ========================================= */

.product-card {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  overflow: hidden;
  transition: 0.25s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.10);
}

.product-image,
.product-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #fff;
  padding: 12px;
}

.product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-name,
.product-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #222;
}

.product-description {
  font-size: 14px;
  color: #666;
}

.product-price,
.price {
  font-size: 20px;
  font-weight: 800;
  color: #222;
}

.original-price {
  color: #888;
  text-decoration: line-through;
  font-size: 14px;
  margin-left: 6px;
}

.discount {
  color: #168a3a;
  font-size: 14px;
  font-weight: 700;
}

.product-card .add-cart,
.product-card .add-to-cart {
  width: 100%;
  margin-top: auto;
}

/* =========================================
   RATING
   ========================================= */

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}

.stars {
  color: #f5a623;
}

/* =========================================
   CART
   ========================================= */

.cart-container {
  max-width: 900px;
  margin: 25px auto;
  padding: 20px;
}

.cart-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-item img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.cart-item-info {
  flex: 1;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  font-size: 18px;
}

.quantity-controls button:hover {
  background: #f0f0f0;
}

/* =========================================
   CART SUMMARY
   ========================================= */

.cart-summary {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.cart-total {
  border-top: 1px solid #ddd;
  margin-top: 10px;
  padding-top: 15px;
  font-size: 20px;
  font-weight: 800;
}

/* =========================================
   MODAL
   ========================================= */

.modal,
#cartModal,
#loginModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.55);
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.modal.active,
.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 25px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 15px;
  top: 10px;
  border: none;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

/* =========================================
   FORMS / LOGIN
   ========================================= */

form {
  width: 100%;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  font-family: inherit;
}

.form-group input,
.form-group select,
.form-group textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2874f0;
}

/* =========================================
   EMPTY STATE
   ========================================= */

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #666;
}

.empty-state h2 {
  color: #333;
  margin-bottom: 10px;
}

/* =========================================
   ALERT / MESSAGE
   ========================================= */

.alert,
.message {
  padding: 12px 15px;
  border-radius: 6px;
  margin: 10px 0;
}

.success {
  background: #e8f7ed;
  color: #176b31;
}

.error {
  background: #fdecec;
  color: #a32121;
}

.warning {
  background: #fff5df;
  color: #8a5a00;
}

/* =========================================
   FOOTER
   ========================================= */

footer {
  background: #172337;
  color: #fff;
  margin-top: 40px;
  padding: 40px 6%;
}

.footer-container {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

footer h3,
footer h4 {
  margin-bottom: 12px;
}

footer a {
  display: block;
  color: #ddd;
  text-decoration: none;
  margin: 7px 0;
}

footer a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 30px;
  padding-top: 20px;
  color: #bbb;
}

/* =========================================
   LOADING
   ========================================= */

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.spinner {
  width: 35px;
  height: 35px;
  border: 4px solid #ddd;
  border-top-color: #2874f0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================
   MOBILE MENU
   ========================================= */

.menu-button {
  display: none;
  border: none;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
}

/* =========================================
   RESPONSIVE - TABLET
   ========================================= */

@media (max-width: 900px) {
  .products,
  .product-grid,
  #productContainer,
  #productsContainer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    gap: 12px;
  }
}

/* =========================================
   RESPONSIVE - MOBILE
   ========================================= */

@media (max-width: 650px) {
  .navbar {
    padding: 10px 15px;
    flex-wrap: wrap;
  }

  .logo,
  .logo a {
    font-size: 20px;
  }

  .search-container {
    order: 3;
    width: 100%;
    max-width: none;
  }

  .nav-links {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .hero {
    padding: 35px 18px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 15px;
  }

  main,
  .container {
    padding: 20px 12px;
  }

  .products,
  .product-grid,
  #productContainer,
  #productsContainer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-image,
  .product-card img {
    height: 160px;
  }

  .product-info {
    padding: 10px;
  }

  .product-name,
  .product-card h3 {
    font-size: 15px;
  }

  .product-price,
  .price {
    font-size: 17px;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item img {
    width: 70px;
    height: 70px;
  }

  .footer-container {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   VERY SMALL PHONES
   ========================================= */

@media (max-width: 380px) {
  .products,
  .product-grid,
  #productContainer,
  #productsContainer {
    grid-template-columns: 1fr;
  }

  .product-image,
  .product-card img {
    height: 210px;
  }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #2874f0;
  outline-offset: 2px;
}

/* Prevent accidental horizontal scrolling */
body {
  overflow-x: hidden;
    }
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
