/* ===== COLOR PALETTE ===== */
:root {
  --bg: #ffffff;           /* white background */
  --card: #f5f5f5;         /* light gray for cards and sections */
  --primary: #00bfa5;      /* teal accent for buttons, price, links */
  --text: #111111;         /* main text black */
  --subtext: #555555;      /* secondary text gray */
  --button-bg: var(--primary);
  --button-hover: #00a08f;
  --input-bg: #fff;
  --input-border: #ccc;
}

/* ===== GLOBAL ===== */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 25px;
  background: var(--card);
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap;
}

.brand-name h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  font-family: "Times New Roman", serif;
}

/* ===== SEARCHBAR ===== */
.searchbar {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
  margin: 0 20px;
}

.searchbar input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid var(--input-border);
  border-radius: 25px 0 0 25px;
  outline: none;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
}

.searchbar button {
  padding: 10px 15px;
  border: none;
  border-radius: 0 25px 25px 0;
  background: var(--button-bg);
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.searchbar button:hover {
  background: var(--button-hover);
}

/* ===== PROFILE MENU ===== */
.profile-menu {
  position: relative;
}

.profile-icon {
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  line-height: 1;
  transition: all 0.3s ease;
}

.profile-icon:hover {
  background: var(--button-hover);
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background: var(--card);
  border-radius: 15px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  min-width: 200px;
  padding: 12px 0;
  z-index: 10;
  overflow: hidden;
}

.dropdown.show {
  display: flex;
}

.dropdown a {
  padding: 12px 20px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 2px 10px;
}

.dropdown a:hover {
  background: var(--button-hover);
  color: white;
  transform: translateX(5px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--card);
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
}

.sidebar a {
  padding: 12px 25px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.2s;
  border-radius: 8px;
}

.sidebar a:hover {
  background: var(--button-bg);
  color: white;
}

.sidebar .reels-link {
  font-size: 20px;
  font-weight: 600;
  padding: 15px 0;
  text-align: center;
  margin: 10px 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar .reels-link:hover {
  background: var(--button-bg);
  color: white;
}

/* ===== MAIN CONTENT ===== */
.layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.main-content {
  flex: 1;
  padding: 20px 40px;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 50px 20px;
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
}

.hero h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.hero p {
  opacity: 0.9;
}

/* ===== PRODUCT GRID ===== */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.product-card {
  background: var(--card);
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
  background: var(--card);
  color: var(--text);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 12px;
}

.product-card h3 {
  margin: 10px 0 5px;
  font-size: 16px;
}

.price {
  font-weight: bold;
  color: var(--primary);
  font-size: 18px;
}

/* ===== PRODUCT PAGE ===== */
.product-page {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  flex-wrap: wrap;
}

.product-image {
  flex: 1;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#productImg{
  width: 80%;
  height: auto;
}

.product-image img {
  max-width: 100%;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-image img:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.product-details {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.product-details h1 {
  font-size: 32px;
  color: var(--primary);
  margin: 0;
}

.product-details .price {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary);
}

.product-details .description {
  font-size: 16px;
  color: var(--subtext);
}

.product-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.add-to-cart,
.buy-now {
  padding: 12px 25px;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--button-bg);
}

.add-to-cart:hover,
.buy-now:hover {
  background: var(--button-hover);
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0,191,165,0.4);
}

/* ===== CART PAGE ===== */
.cart-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.cart-page {
  margin-left: 30px; 
  width: 100%;
  max-width: none;
  padding: 0 30px;
}

#cartItems {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cart-item {
  display: flex;
  align-items: center;
  background: var(--card);
  padding: 15px 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.remove-btn{
  margin-left: auto;
}

.cart-item-info{
  margin-left: 20px;
}

.cart-item img {
  width: 80px;
  border-radius: 12px;
  object-fit: cover;
}

.cart-item h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.cart-item p {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.cart-item button {
  padding: 8px 15px;
  background: var(--button-bg);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.cart-item button:hover {
  background: var(--button-hover);
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,191,165,0.4);
}

#cartTotal {
  font-size: 20px;
  font-weight: 600;
  margin-top: 20px;
  color: var(--primary);
  text-align: right;
}

.empty-cart {
  text-align: center;
  font-size: 18px;
  color: var(--subtext);
  margin-top: 50px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--card);
  border-top: 1px solid #eee;
  margin-top: 50px;
}

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

.footer-section h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.footer-section p, .footer-section a {
  font-size: 14px;
  color: var(--subtext);
  line-height: 1.6;
  text-decoration: none;
}

.footer-section a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding: 15px;
  font-size: 13px;
  color: var(--subtext);
  border-top: 1px solid #eee;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: -220px;
    top: 0;
    z-index: 999;
    transition: 0.3s;
  }

  .sidebar.active {
    left: 0;
  }

  .main-content {
    padding: 10px;
  }

  .product-page {
    flex-direction: column;
    align-items: center;
  }

  .product-details {
    text-align: center;
  }

  .product-actions {
    justify-content: center;
  }

  .cart-item {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  #productImg {
    max-width: 100%;
  }

  .add-to-cart {
    width: 100%;
  }

  #cartTotal {
    text-align: center;
  }

  .nav-links {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .topbar {
  flex-wrap: wrap;
  }

  .brand-name {
    width: 100%;
    text-align: center;
  }

  .searchbar {
    margin: 10px 0;
    width: 100%;
  }

  .searchbar input {
    border-radius: 25px 0 0 25px;
  }

  .searchbar button {
    border-radius: 0 25px 25px 0;
  }

  .profile-icon{
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
}

/* ===== LOGIN PAGE OVERRIDES ===== */
body.login-page {
  background: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  margin: 0;
}

body.login-page .login-container {
  background: var(--card);
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
  transition: all 0.3s ease;
}

body.login-page .login-container h2 {
  margin-bottom: 25px;
  font-size: 24px;
  color: var(--primary);
}

body.login-page .input-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 20px;
}

body.login-page .input-group label {
  margin-bottom: 5px;
  font-size: 14px;
  color: var(--text);
}

body.login-page .input-group input {
  padding: 10px 15px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s ease;
}

body.login-page .input-group input:focus {
  border-color: var(--primary);
}

body.login-page button {
  width: 100%;
  padding: 12px 0;
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

body.login-page button:hover {
  background: var(--button-hover);
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

body.login-page .home-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--subtext);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.3s ease;
}

body.login-page .home-link:hover {
  color: var(--primary);
}

body.login-page #otpBox {
  display: none;
}

body.login-page #recaptcha-container {
  margin-top: 15px;
}

@media (max-width: 500px) {
  body.login-page .login-container {
    padding: 30px 20px;
  }

  body.login-page .login-container h2 {
    font-size: 20px;
  }

  body.login-page button {
    font-size: 14px;
    padding: 10px 0;
  }
}