/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
}
body {
  background-color: #f1f3f6;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  height: auto;
}

/* Header */
header {
  background: linear-gradient(
    90deg,
    #ff512f,
    #dd2476
  ); /* Vibrant Berry Gradient */
  color: white;
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 5px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.logo img {
  height: 40px;
}

.logo h1 {
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 800;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Search Bar */
.search-bar {
  flex-grow: 1;
  display: flex;
  background: white;
  border-radius: 2px;
  padding: 0 10px;
  max-width: 500px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.search-bar input {
  width: 100%;
  border: none;
  padding: 10px;
  outline: none;
}
.search-bar button {
  background: none;
  border: none;
  color: #2874f0;
  cursor: pointer;
  font-size: 1.1rem;
}

/* Hamburger Menu Button */
.menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Header Cart Icon */
.header-cart-btn {
  position: relative;
  color: white;
  font-size: 1.2rem;
  margin-left: 10px;
}

/* Login Button in Header */
.login-header-btn {
  background-color: white;
  color: #2874f0;
  padding: 5px 20px;
  font-weight: bold;
  border-radius: 2px;
  margin-left: 15px;
  border: 1px solid white;
  cursor: pointer;
}

.cart-badge {
  background-color: #ff6161;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  position: absolute;
  top: -8px;
  right: -12px;
  font-weight: bold;
}

/* Side Menu (Hamburger Drawer) */
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  transform: translateX(-100%); /* Hidden by default */
  width: 280px;
  height: 100%;
  background: white;
  z-index: 1100;
  transition: transform 0.3s ease;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}
.side-menu.active {
  transform: translateX(0);
}
.side-menu-header {
  background: linear-gradient(90deg, #ff512f, #dd2476);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}
.close-menu {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
}
.side-menu-links {
  padding: 10px 0;
  overflow-y: auto;
  flex-grow: 1;
}
.menu-link {
  display: block;
  padding: 15px 20px;
  color: #333;
  border-bottom: 1px solid #f1f1f1;
  font-weight: 500;
}
.menu-link:hover {
  background-color: #f9f9f9;
}
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: none;
}
.menu-overlay.active {
  display: block;
}

.menu-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid #f1f1f1;
}

.menu-heading:hover {
  background-color: #f9f9f9;
}

.menu-heading i {
  transition: transform 0.3s ease;
}
.menu-heading.active i {
  transform: rotate(180deg);
}

.menu-sub-link {
  display: block;
  padding: 12px 20px 12px 40px; /* Indent sub-links */
  color: #555;
  border-bottom: 1px solid #f1f1f1;
  font-weight: 400;
}

.menu-sub-link:hover {
  background-color: #f9f9f9;
}

.menu-sub-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: #f8f8f8;
}

.menu-separator {
  border: none;
  border-top: 1px solid #eee;
  margin: 5px 0;
}

/* Footer */
footer {
  background: #172337;
  color: #f1f1f1;
  padding-top: 60px;
  margin-top: 50px;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 40px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
}

.footer-section h2,
.footer-section h3 {
  color: white;
  margin-bottom: 20px;
  font-weight: 600;
}

.footer-section p {
  line-height: 1.6;
  color: #ccc;
  margin-bottom: 15px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: #ccc;
  transition: all 0.3s;
}

.footer-section ul li a:hover {
  color: white;
  padding-left: 5px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  margin-right: 10px;
  border-radius: 50%;
  transition: all 0.3s;
}

.social-links a:hover {
  background: #fb641b;
  transform: translateY(-3px);
}

.footer-bottom {
  background: #0f1926;
  text-align: center;
  padding: 20px 0;
  color: #888;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 8px 0; /* Reduce vertical padding on mobile */
  }
  .header-content {
    flex-wrap: wrap;
    gap: 10px; /* Reduce gap between elements */
  }
  .search-bar {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 5px; /* Reduce space above search bar */
    margin-bottom: 0;
  }
  /* Hide desktop login button on mobile */
  .login-header-btn {
    display: none;
  }
  .logo h1 {
    font-size: 0.9rem;
    white-space: normal;
    line-height: 1.2;
  }
  .logo img {
    height: 30px;
  }
}

/* --- Great Indian Festival Banner & Animations --- */
.festival-banner {
  background: linear-gradient(
    135deg,
    #ff8c00,
    #ff0080
  ); /* Vibrant Indian Festive Colors */
  color: white;
  padding: 60px 20px;
  text-align: center;
  border-radius: 15px;
  margin: 20px auto;
  max-width: 1100px;
  box-shadow: 0 15px 35px rgba(221, 36, 118, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.festival-banner h2 {
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.1);
  animation: pulseGlow 2s ease-in-out infinite alternate;
}

.festival-banner p {
  font-size: 1.4rem;
  font-weight: 500;
  animation: fadeInUp 1s ease-out both;
}

.festival-img {
  width: 180px;
  margin-bottom: 10px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  animation: floatImage 4s ease-in-out infinite;
}

@keyframes pulseGlow {
  from {
    transform: scale(1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  }
  to {
    transform: scale(1.05);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
  }
}

@keyframes floatImage {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Shared Form & Button Styles --- */

.form-card {
  background: white;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
}

.form-group input:focus {
  border-color: #2874f0;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.btn-primary {
  background-color: #2874f0;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #333;
  padding: 10px 20px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}

.btn-danger,
.btn-edit {
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 5px;
}

.btn-danger {
  background-color: #ff6161;
}
.btn-edit {
  background-color: #ff9f00;
}

/* --- Toast Notification --- */
#toast-box {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
}
.toast {
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  margin-top: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: fadeToast 3s forwards;
}
@keyframes fadeToast {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* --- Checkout Page Styles --- */
.checkout-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  align-items: flex-start;
  padding-bottom: 40px;
}
.checkout-left {
  flex: 2;
}
.checkout-right {
  flex: 1;
  position: sticky;
  top: 80px;
}
.checkout-step {
  background: white;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}
.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.step-number {
  background: #f0f0f0;
  color: #2874f0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 2px;
}
.checkout-address-item {
  display: flex;
  gap: 10px;
  padding: 15px;
  border: 1px solid #f0f0f0;
  cursor: pointer;
  margin-bottom: 10px;
  align-items: flex-start;
}
.checkout-address-item.selected {
  background-color: #fcfcfc;
  border-color: #2874f0;
}
.checkout-cart-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
}
.checkout-cart-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}
.price-details-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.price-total {
  border-top: 1px dashed #e0e0e0;
  padding-top: 10px;
  font-weight: bold;
  font-size: 1.1rem;
}
.btn-place-order {
  width: 100%;
  background: #fb641b;
  color: white;
  border: none;
  padding: 15px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .checkout-container {
    flex-direction: column;
  }
  .checkout-right {
    position: static;
    width: 100%;
  }
}

/* --- Profile Form Styles --- */
.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.profile-form-grid .full-width {
  grid-column: span 2;
}
.profile-actions {
  margin-top: 10px;
}
@media (max-width: 600px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
  .profile-form-grid .full-width {
    grid-column: span 1;
  }
}

/* --- Admin Order Management --- */
.order-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  min-width: 150px;
}

.current-status {
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 5px;
  display: inline-block;
  font-size: 0.9em;
  text-transform: capitalize;
}

.status-processing {
  background-color: #ff9f00; /* Orange */
  color: white;
}

.status-accepted {
  background-color: #28a745; /* Green */
  color: white;
}

.status-completed {
  background-color: #388e3c; /* Dark Green */
  color: white;
}

.status-cancelled,
.status-rejected {
  background-color: #dc3545; /* Red */
  color: white;
}

.btn-action {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 3px;
  border: 1px solid #ccc;
  cursor: pointer;
  background-color: #f0f0f0;
  color: #333;
}

.btn-action:hover:not(:disabled) {
  background-color: #e0e0e0;
}

.btn-action:disabled {
  cursor: not-allowed;
  opacity: 1;
  background-color: #e9ecef;
  color: #6c757d;
  border-color: #dee2e6;
}

.btn-action.btn-success {
  background-color: #28a745 !important;
  color: white !important;
  border-color: #28a745 !important;
}

.btn-action.btn-success-dark {
  background-color: #388e3c !important;
  color: white !important;
  border-color: #388e3c !important;
}

.btn-action.btn-info {
  background-color: #17a2b8 !important;
  color: white !important;
  border-color: #17a2b8 !important;
}

.btn-action.btn-danger {
  background-color: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

.btn-action.btn-success:hover:not(:disabled) {
  background-color: #218838 !important;
}

/* --- Profile Page Pagination --- */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.pagination-controls button {
  background-color: #fff;
  border: 1px solid #dcdcdc;
  padding: 8px 16px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 500;
}

.pagination-controls button:hover:not(:disabled) {
  background-color: #f0f0f0;
}

.pagination-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* --- Password Visibility Toggle --- */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 40px; /* Make space for icon */
}

.password-wrapper i {
  position: absolute;
  right: 15px;
  cursor: pointer;
  color: #878787;
}

/* --- Shared Product Card Styles --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.product-card {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.card-img-container {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.card-img-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.product-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
  padding: 15px;
}

.product-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rating {
  background-color: #388e3c;
  color: white;
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
  margin-bottom: 5px;
}
.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.current-price {
  font-size: 1.1rem;
  font-weight: bold;
}
.original-price {
  text-decoration: line-through;
  color: #878787;
  font-size: 0.9rem;
}
.discount {
  position: absolute;
  top: 10px;
  left: 0;
  background-color: #e44d26;
  color: white;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 0 4px 4px 0;
  z-index: 1;
}

/* Add to Cart Button */
.btn-add-cart {
  width: 100%;
  background-color: #ff9f00;
  color: white;
  border: none;
  padding: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 2px;
  transition: background 0.2s;
}
.btn-add-cart:hover {
  background-color: #f39400;
}

/* Responsive Product Grid */
@media (max-width: 768px) {
  .product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .product-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 15px 10px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    align-items: flex-start;
  }
  .product-card:hover {
    transform: none;
    box-shadow: none;
  }

  .card-img-container {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    margin-bottom: 0;
    margin-right: 15px;
    background: transparent;
  }

  .product-info {
    padding: 0;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .product-title {
    font-size: 0.9rem;
    white-space: normal; /* Allow text wrap */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
  }

  .btn-add-cart {
    width: auto;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    background-color: #f7ca00; /* Amazon Yellow */
    color: #111;
    margin-top: 10px;
  }
}

/* --- Product Detail Modal (Amazon/Flipkart Style) --- */
.product-detail-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.product-detail-content {
  background-color: white;
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  border-radius: 8px;
  position: relative;
  display: flex;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.close-detail {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 2.5rem;
  cursor: pointer;
  color: #333;
  z-index: 10;
}
.detail-left {
  flex: 1;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfbfb;
  border-right: 1px solid #eee;
}
.detail-left img {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
}
.detail-right {
  flex: 1.2;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.detail-category {
  color: #2874f0;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.detail-right h1 {
  font-size: 1.8rem;
  color: #212121;
  line-height: 1.4;
}
.discount-tag {
  background: #388e3c;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  margin-left: 10px;
}
.product-description {
  line-height: 1.6;
  color: #666;
  font-size: 1rem;
  margin: 10px 0;
}

@media (max-width: 992px) {
  .product-detail-content {
    flex-direction: column;
    max-height: 95vh;
  }
  .detail-left {
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid #eee;
  }
  .detail-left img {
    max-height: 300px;
  }
  .detail-right {
    padding: 25px;
  }
  .detail-right h1 {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .product-detail-modal {
    padding: 0;
  }
  .product-detail-content {
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}
