/* 
===========================================
🎨 BLACK FINALVERSION CSS - BLACKMAGIC PRODUCTS
===========================================
*/

/* ===== GLOBAL STYLES ===== */
:root {
  --primary-color: #ffffff;
  --secondary-color: #f7f7f7;
  --accent-color: #006699;
  --text-color: #333333;
  --border-radius: 8px;
  --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

body {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--primary-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* ===== PAGE HEADER ===== */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
}

/* Language Switch Button */
.language-switch {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.lang-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background-color: #005580;
  box-shadow: 0 0 10px rgba(0, 102, 153, 0.3);
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  color: #333;
}

/* ===== CATEGORY CONTAINER ===== */
.category-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 15px;
}

/* All category styling */
.all-category {
  display: flex;
  justify-content: center;
}

.all-category a {
  text-decoration: none;
  color: #555;
  transition: all var(--transition-speed) ease;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  width: 150px;
  overflow: hidden;
}

.all-category .cat-item {
  height: 150px; /* Increased height to match other categories */
  overflow: hidden;
}

/* Special styling for All category without image */
.all-category .all-text-only {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  background-color: #fff;
}

.all-category .all-text-only div {
  height: auto;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 1rem;
}

.all-category a:hover {
  background-color: #f9f9f9;
  border-color: #ccc;
}

/* No image hover effect needed for All category */

.all-category a.active {
  background-color: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

.all-category a.active .all-text-only {
  background-color: var(--accent-color);
}

.all-category a.active .all-text-only div {
  color: #fff;
  font-weight: 600;
}

/* Categories grid styling */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0; /* Remove gap */
  padding: 1px; /* Minimal padding */
  background-color: #f5f5f5;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.category-box {
  text-decoration: none;
  color: #555;
  transition: all var(--transition-speed) ease;
  background-color: #fff;
  border-radius: 0; /* Remove border radius */
  overflow: hidden;
  box-shadow: none; /* Remove individual box shadows */
  border: 1px solid #e0e0e0; /* Add border */
}

.category-box:hover {
  background-color: #f9f9f9;
  z-index: 1;
  border-color: #ccc;
}

.category-box:hover .cat-item img {
  transform: translateX(-12px) scale(1.05); /* Maintain adjusted left shift while scaling */
}

.category-box.active {
  background-color: var(--accent-color);
  color: #fff;
  z-index: 2;
  border-color: var(--accent-color);
}

.category-box.active .cat-item div {
  color: #fff;
  font-weight: 600;
}

/* Cat item styling */
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 150px; /* Increased height for better text display */
  text-align: center;
}

/* Image container - top half */
.cat-item img {
  width: 100%;
  height: 80px; /* Fixed height for top half */
  object-fit: contain; /* This ensures the image maintains its aspect ratio */
  padding: 0.75rem 0.75rem 0.5rem 0.75rem;
  background-color: #fff;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  object-position: center; /* Center the image within its container */
  max-height: 80px; /* Ensure images don't exceed this height */
  transform: translateX(-12px); /* Adjust shift - move slightly right from previous position */
}

/* Text container - bottom half */
.cat-item div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px; /* Increased height for text section */
  width: 100%;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
  font-size: 0.8rem; /* Smaller font size */
  line-height: 1.2;
  text-align: center;
}

/* ===== CATEGORY TITLES ===== */
h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
  color: #333;
}

/* ===== PRODUCT CARDS ===== */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem;
}

.product-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e0e0e0;
  /* Use flexbox to push button to bottom */
  justify-content: space-between;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.product-img {
  height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9f9f9;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-speed) ease;
}

.product-card:hover .product-img img {
  transform: scale(1.05);
}

/* Product content wrapper */
.product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  padding: 1rem;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  color: #333;
}

.product-card label {
  display: block;
  text-align: center;
  margin: 0.5rem 0;
  color: #555;
}

.view-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

.view-btn:hover {
  background-color: #005580;
  box-shadow: 0 0 10px rgba(0, 102, 153, 0.3);
}

/* ===== MODAL POPUP ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: #fff;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
  position: relative;
  border: 1px solid #e0e0e0;
  animation: modalFadeIn 0.3s ease;
}

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

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.8rem;
  color: #777;
  cursor: pointer;
  transition: color var(--transition-speed) ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.05);
}

.close-btn:hover {
  color: var(--accent-color);
}

#modal-body {
  padding: 2rem;
}

#modal-body h3 {
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #333;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
}

#modal-body ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#modal-body li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  flex-wrap: wrap;
}

#modal-body li:last-child {
  border-bottom: none;
}

#modal-body li strong {
  min-width: 150px;
  color: var(--accent-color);
  margin-right: 1rem;
}

/* ===== COMPARISON TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: #fff;
  box-shadow: var(--card-shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

th {
  background-color: #f7f7f7;
  font-weight: 600;
  color: #333;
}

th img {
  display: block;
  margin: 0 auto 0.5rem;
}

/* ===== FORM ELEMENTS ===== */
button[type="submit"] {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed) ease;
}

button[type="submit"]:hover {
  background-color: #005580;
  box-shadow: 0 0 10px rgba(0, 102, 153, 0.3);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .page-header h1 {
    font-size: 1.8rem;
  }
  
  .all-category a {
    width: 140px;
  }
  
  .all-category .cat-item,
  .all-category .all-text-only {
    height: 140px; /* Match the increased height */
  }
  
  .all-category .all-text-only div {
    font-size: 1.1rem;
  }
  
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 1px;
  }
  
  .cat-item {
    height: 140px; /* Taller for tablet but still smaller than desktop */
  }
  
  .cat-item img {
    height: 70px; /* Even smaller images for tablet */
    max-height: 70px;
    object-fit: contain;
    object-position: center;
  }
  
  .cat-item div {
    height: 70px; /* Increased height for text section */
    font-size: 0.85rem;
  }
  
  .card-container {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
  
  .product-img {
    height: 150px;
  }
  
  .view-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .modal-content {
    width: 95%;
  }
  
  #modal-body {
    padding: 1.5rem;
  }
  
  #modal-body h3 {
    font-size: 1.5rem;
  }
  
  #modal-body li strong {
    min-width: 100%;
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: 1.5rem 0.5rem;
  }
  
  .page-header h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.4rem;
  }
  
  .all-category a {
    width: 120px;
  }
  
  .all-category .cat-item,
  .all-category .all-text-only {
    height: 130px; /* Match the increased height */
  }
  
  .all-category .all-text-only div {
    font-size: 1rem;
    padding: 0.75rem;
  }
  
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 1px;
  }
  
  .cat-item {
    height: 130px; /* Taller for mobile but still smaller than tablet */
  }
  
  .cat-item img {
    height: 60px; /* Even smaller images for mobile */
    max-height: 60px;
    object-fit: contain;
    object-position: center;
  }
  
  .cat-item div {
    height: 70px; /* Increased height for text section */
    font-size: 0.8rem;
    padding: 0.25rem;
    line-height: 1.1;
  }
  
  .card-container {
    grid-template-columns: 1fr;
  }
  
  .product-img {
    height: 180px;
  }
  
  #modal-body {
    padding: 1rem;
  }
}

/* ===== PRODUCT DETAILS (HIDDEN) ===== */
.product-details {
  display: none;
}