/* === Reset and General Layout === */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #1a4054, #68a6aa);
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
  background-image: url("../images/black-thread-light.png")
}

/* DESKTOP - Your Original Header Layout */
header {
  background: #333;
  color: white;
  padding: 0.8rem 2rem;
  display: grid;
  grid-template-columns: 1fr;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 60px;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-content: center;
}

#logo{
  width: 100%;
}

.header-logo {
  max-height: 72px;
  margin: 0 auto;
  display: block; /* Hidden by default, shown when loaded */
}

.header-flex nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  text-align: center;
}

/* Hamburger Menu Styles */
    .hamburger {
      display: flex;
      background-color: #333;
      flex-direction: column;
      cursor: pointer;
      padding: 10px;
      z-index: 1001;
      background-color: transparent;
      border: none;
    }
    
    .hamburger span {
      width: 25px;
      height: 3px;
      background-color: white;
      margin: 3px 0;
      transition: 0.3s;
      border-radius: 2px;
    }
    
    .hamburger.active span:nth-child(1) {
      transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
      opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
      transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu {
      position: fixed;
      top: 0;
      left: -100%;
      width: 80%;
      max-width: 300px;
      height: 100vh;
      background-color: #333;
      box-shadow: 2px 0 10px rgba(0,0,0,0.3);
      transition: left 0.3s ease;
      z-index: 1000;
      padding-top: 60px;
    }
    
    .mobile-menu.active {
      left: 0;
    }
    
    .mobile-menu nav {
      display: flex;
      flex-direction: column;
      padding: 20px;
    }
    
    .mobile-menu nav a {
      padding: 15px 10px;
      text-decoration: none;
      color: white;
      font-size: 18px;
      font-weight: 500;
      border-bottom: 1px solid #e0e0e0;
      transition: background-color 0.2s;
    }
    
    .mobile-menu nav a:hover {
      background-color: #f0f0f0;
      color: #000;
    }
    
    .menu-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100vh;
      background-color: rgba(0,0,0,0.5);
      display: none;
      z-index: 999;
    }
    
    .menu-overlay.active {
      display: block;
    }
    
    /* Hide the regular desktop nav since we're using hamburger everywhere */
    .header-flex > nav {
      display: none;
    }

/* === Main Section === */
main h1 {
  text-align: center;
  color: #D2762B;
  font-size: 1.5rem;
}

/* === Hero Section === */
.hero-section {
  text-align: center; /* fallback centering for text */
  background: linear-gradient(0deg, #061e2b, #1a4054);
  color: white;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center; /* centers logo + text horizontally */
  justify-content: center; /* if you ever need vertical centering */
}

.hero-logo {
  max-width: 300px;   /* keeps it from getting too large */
  height: auto;
  margin-bottom: 20px; /* space between logo and heading */
}

.hero-section h1 {
  font-size: 3rem;
  margin: 20px 0 10px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 0;
}

header nav a {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

header nav a:hover {
  background-color: rgba(255,255,255,0.1);
}

#cart-icon {
  background: #68a6aa;
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: bold;
  color: white;
  justify-self: flex-end;
}

#cart-icon:hover {
  background: #1a4054;
}

/* === Carousel Styles === */
.carousel-section {
  display: flex;
  justify-content: center;
  padding: 20px 20px 40px 20px;
}

.carousel-container {
  width: 100%;
  max-width: 900px;
  position: relative;
}

.carousel-window {
  width: 50%;
  max-width: 800px;
  height: 400px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  background: #1a4054;
}

.carousel {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease-in-out;
  width: 500%; /* 4 images = 400% */
}

.carousel-image {
  width: 20%;
  height: 100%;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 15px 20px;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.8);
}

.carousel-btn.prev {
  left: 15px;
}

.carousel-btn.next {
  right: 15px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dot.active {
  background: white;
}

/* === Welcome Section === */
.welcome {
  text-align: center;
  padding: 40px 20px;
  color: white;
  max-width: 800px;
  margin: 0 auto;
}

.welcome-logo {
  max-height: 120px;
  max-width: 250px;
  width: auto;
  height: auto;
  margin-bottom: 30px;
  display: none; /* Hidden by default, shown when loaded */
}

.welcome h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.welcome p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* === Category Buttons === */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin: 30px 0;
}

.category-buttons button {
  background: #D2762B;
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  min-width: 160px;
}

.category-buttons button:hover {
  background: #D2762B;
  transform: scale(1.05);
  box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
}

/* === Product Grid === */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  padding: 6px;
  max-width: 1200px;
  margin: 0 auto;
}

.product {
  display: flex;
  background: white;
  border-radius: 12px;
  padding: 6px;
  text-align: center;
  flex-direction: column;
  justify-content: space-around;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.product img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 5px;
}

.product video {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 5px;
}

.product h3 {
  margin: 5px 0;
  color: #333;
  font-size: 1.3rem;
}

.price {
  font-size: 1.4rem;
  font-weight: bold;
  color: #4CAF50;
  margin: 5px 0;
}

.quantity-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
}

.quantity-controls button {
  background: #ddd;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

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

.quantity-input {
  width: 60px;
  padding: 8px;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.add-to-cart-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  width: 100%;
  margin-top: 10px;
}

.add-to-cart-btn:hover {
  background: #45a049;
}

/* === Filament Styles === */
.filaments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  padding: 6px;
  max-width: 1200px;
  margin: 0 auto;
}

.filament {
  display: flex;
  background: white;
  border-radius: 12px;
  padding: 6px;
  text-align: center;
  flex-direction: column;
  justify-content: space-around;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.filament:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.filament img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 5px;
}

.filament h3 {
  margin: 5px 0;
  color: #333;
  font-size: 1.3rem;
}

/* === Modal Styles === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  margin-top: 0;
  color: #333;
  text-align: center;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 10px;
}

.close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.close:hover {
  background: #f0f0f0;
  color: #333;
}

/* === Color Selection Modal === */
.color-selection-modal {
  max-width: 400px;
}

.color-selection-content {
  text-align: center;
}

.product-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.product-info h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.2rem;
}

.product-info .quantity-display {
  font-size: 1rem;
  color: #666;
  margin-bottom: 5px;
}

.product-info .price-display {
  font-size: 1.1rem;
  font-weight: bold;
  color: #4CAF50;
}

.color-selection-group {
  margin: 20px 0;
}

.color-selection-group label {
  display: block;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.color-dropdown {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.color-dropdown:focus {
  outline: none;
  border-color: #4CAF50;
}

.color-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.confirm-add-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.confirm-add-btn:hover {
  background: #45a049;
}

.cancel-color-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.cancel-color-btn:hover {
  background: #5a6268;
}

/* === Cart Display === */
.cart-items {
  margin: 20px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

.item-info {
  text-align: left;
}

.item-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.item-details {
  font-size: 0.9rem;
  color: #666;
}

.item-color {
  font-size: 0.85rem;
  color: #007bff;
  font-style: italic;
  margin-top: 2px;
}

.item-total {
  font-weight: bold;
  color: #4CAF50;
  text-align: right;
}

.remove-item {
  background: #ff4444;
  color: white;
  border: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-item:hover {
  background: #cc0000;
}

#cart-total {
  text-align: right;
  font-size: 1.2rem;
  margin: 20px 0;
  padding: 15px;
  background: #f0f0f0;
  border-radius: 8px;
}

/* === Button Styles === */
.checkout-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  width: 100%;
  margin: 10px 0;
  transition: background-color 0.3s ease;
}

.checkout-btn:hover {
  background: #45a049;
}

.close-btn-modal {
  background: #6c757d;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  margin: 5px 0;
}

.close-btn-modal:hover {
  background: #5a6268;
}

/* === Form Styles === */
.order-form {
  max-width: 600px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4CAF50;
}

.form-group textarea {
  height: 120px;
  resize: vertical;
}

.notification {
  background: #e3f2fd;
  color: #1976d2;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #2196F3;
  margin: 15px 0;
}

.payment-info {
  background: #f0f8ff;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #4CAF50;
  margin: 20px 0;
  text-align: center;
}

.submit-order-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  width: 48%;
  margin-right: 4%;
  transition: background-color 0.3s ease;
}

.submit-order-btn:hover {
  background: #45a049;
}

.cancel-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  width: 48%;
  transition: background-color 0.3s ease;
}

.cancel-btn:hover {
  background: #5a6268;
}

/* === Notification Popup === */
.notification-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #4CAF50;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10000;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
}

.notification-popup.show {
  transform: translateX(0);
  opacity: 1;
}

/* === Utility Classes === */
.hidden {
  display: none !important;
}

/* === Vendor Logo Strip === */
.vendor-strip {
  background: #2c2c2c;
  padding: 20px 0;
  overflow: hidden;
  position: relative;
  margin-top: auto;
}

.vendor-strip-container {
  width: 100%;
  overflow: hidden;
}

.vendor-logos {
  display: flex;
  align-items: center;
  gap: 60px;
  animation: scroll 30s linear infinite;
  width: fit-content;
}

.vendor-logos img {
  height: 60px;
  width: auto;
  object-fit: contain;
  /*filter: grayscale(100%) brightness(2);*/
  opacity: 0.7;
  transition: all 0.3s ease;
}

.vendor-logos img:hover {
  filter: grayscale(0%) brightness(1);
  opacity: 1;
  transform: scale(1.1);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Pause animation on hover */
.vendor-strip:hover .vendor-logos {
  animation-play-state: paused;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .vendor-logos {
    gap: 40px;
    animation: scroll 20s linear infinite;
  }
  
  .vendor-logos img {
    height: 40px;
  }
}

/* === MOBILE-ONLY RESPONSIVE CHANGES === */

/* === PORTRAIT PHONE SPECIFIC === */
@media (max-width: 480px) and (orientation: portrait) {
  .product {
    height: 500px !important;
  }
  
  .product img,
  .product video {
    height: 200px !important;
    width: 100% !important;
    object-fit: cover !important;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
  }
  
  .header-flex {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
  }
  
  /* Logo - should appear first */
  #logo {
    width: 100%;
    order: -1;
    display: flex;
    justify-content: center;
  }
  
  .header-logo {
    max-height: 60px;
    margin: 0;
  }
  
  /* Navigation - should appear second */
  .header-flex nav {
    order: 0;
    justify-content: center;
    gap: 15px;
    align-self: center;
  }
  
  /* Cart Icon - should appear last */
  #cart-icon {
    order: 1;
    align-self: center;
    padding: 10px 16px;
    font-size: 16px;
  }
  
  .hero-logo {
    max-width: 250px;
  }
  
  .hero-section h1 {
    font-size: 2.2rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  .carousel-window {
    width: 85%;
    height: 280px;
  }
  
  .carousel-btn {
    padding: 10px 15px;
    font-size: 18px;
  }
  
  .carousel-btn.prev {
    left: 10px;
  }
  
  .carousel-btn.next {
    right: 10px;
  }
  
  .welcome {
    padding: 40px 20px 20px 20px;
  }
  
  .welcome h2 {
    font-size: 1.8rem;
  }
  
  .products {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /*justify-content: center;*/
    gap: 20px;
    padding: 20px 15px;
  }
  
  .product {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 350px;
    margin: 0 auto;
    height: 480px;
    overflow: hidden;
  }
  
  .product img,
  .product video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  }

  .product h3 {
    margin: 10px 0;
    color: #333;
    font-size: 1.2rem;
    line-height: 1.4;
    flex-grow: 0;
    word-wrap: break-word;
    hyphens: auto;
    min-height: 3.4em;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .product .add-to-cart-btn {
    margin-top: auto;
  }
  
  .cart-item {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }
  
  .modal-content {
    padding: 20px;
    margin: 10px;
  }
  
  .submit-order-btn,
  .cancel-btn {
    width: 100%;
    margin: 5px 0;
  }
  
  .color-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .carousel-window {
    width: 95%;
    height: 220px;
  }
  
  .product {
    height: 500px !important;
  }
  
  .product img,
  .product video {
    height: 200px !important;
  }
  
  .notification-popup {
    right: 10px;
    left: 10px;
    transform: translateY(-100px);
  }
  
  .notification-popup.show {
    transform: translateY(0);
  }
}
