/* ================================================
   PROFESSIONAL LAYOUT - WIDTH & SPACING FIXES
   Fixed container widths and professional spacing
   ================================================ */

/* ===== CONTAINER SYSTEM ===== */

/* Main container - professional width */
.container-custom {
  max-width: 1400px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 2.5rem !important;
  box-sizing: border-box !important;
}

/* Extra wide screens */
@media (min-width: 1920px) {
  .container-custom {
    max-width: 1600px !important;
    padding: 0 4rem !important;
  }
}

/* Large desktop */
@media (min-width: 1600px) and (max-width: 1919px) {
  .container-custom {
    max-width: 1500px !important;
    padding: 0 3rem !important;
  }
}

/* Standard desktop */
@media (min-width: 1280px) and (max-width: 1599px) {
  .container-custom {
    max-width: 1300px !important;
    padding: 0 2.5rem !important;
  }
}

/* Small desktop/laptop */
@media (min-width: 1024px) and (max-width: 1279px) {
  .container-custom {
    max-width: 1100px !important;
    padding: 0 2rem !important;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .container-custom {
    max-width: 95% !important;
    padding: 0 1.5rem !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .container-custom {
    max-width: 100% !important;
    padding: 0 1rem !important;
  }
}

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

/* Product grid - better spacing */
.products-grid,
#productsGrid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

/* Responsive grid columns */
@media (min-width: 640px) {
  .products-grid,
  #productsGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .products-grid,
  #productsGrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1400px) {
  .products-grid,
  #productsGrid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }
}

/* ===== CARD IMPROVEMENTS ===== */

/* Product cards - better proportions */
.card {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

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

/* Card image container */
.card-image,
.card > .bg-gray-100 {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1400px) {
  .card-image,
  .card > .bg-gray-100 {
    height: 280px;
  }
}

/* Card content */
.card-content,
.card > div:not(.bg-gray-100) {
  padding: 1.5rem;
  flex: none;
  display: flex;
  flex-direction: column;
}

/* ===== SECTION SPACING ===== */

/* Section padding - professional */
section {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  section {
    padding: 5rem 0;
  }
}

@media (min-width: 1024px) {
  section {
    padding: 6rem 0;
  }
}

/* First section (after header) */
section:first-of-type,
.pt-32 {
  padding-top: calc(var(--header-height, 72px) + 16px);
}

@media (min-width: 768px) {
  section:first-of-type,
  .pt-32 {
    padding-top: calc(var(--header-height, 72px) + 20px);
  }
}

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

/* Header text spacing */
.text-center.mb-16 {
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .text-center.mb-16 {
    margin-bottom: 4rem;
  }
}

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

/* Filter button container */
.flex.flex-wrap.justify-center.gap-4 {
  gap: 1rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .flex.flex-wrap.justify-center.gap-4 {
    margin-bottom: 4rem;
  }
}

/* ===== BUTTON IMPROVEMENTS ===== */

/* Professional button styling */
.btn-primary,
.btn-outline {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .btn-primary,
  .btn-outline {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
}

/* ===== GRID UTILITIES ===== */

/* Grid gap improvements */
.gap-8 {
  gap: 2rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-4 {
  gap: 1rem;
}

@media (min-width: 1024px) {
  .gap-8 {
    gap: 2.5rem;
  }
  
  .gap-6 {
    gap: 2rem;
  }
}

/* Grid columns - responsive */
.grid.md\:grid-cols-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid.md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid.lg\:grid-cols-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .grid.lg\:grid-cols-3 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== TYPOGRAPHY SPACING ===== */

/* Heading margins */
h1, h2, h3, h4 {
  margin-bottom: 1rem;
}

.text-4xl,
.text-5xl {
  line-height: 1.2;
}

/* Paragraph spacing */
p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ===== CONTENT WIDTH ===== */

/* Max content widths */
.max-w-2xl {
  max-width: 42rem;
}

.max-w-4xl {
  max-width: 56rem;
}

.max-w-6xl {
  max-width: 72rem;
}

/* ===== MOBILE OPTIMIZATIONS ===== */

@media (max-width: 640px) {
  /* Reduce section padding on mobile */
  section {
    padding: 3rem 0;
  }
  
  /* Smaller headings */
  .text-4xl {
    font-size: 1.875rem;
  }
  
  .text-5xl {
    font-size: 2.25rem;
  }
  
  /* Tighter grid gaps */
  .gap-8 {
    gap: 1.25rem;
  }
}

/* ===== TABLET OPTIMIZATIONS ===== */

@media (min-width: 768px) and (max-width: 1023px) {
  /* Optimal spacing for tablets */
  .container-custom {
    padding: 0 2rem !important;
  }
  
  .gap-8 {
    gap: 1.75rem;
  }
}

/* ===== PREVENT OVERFLOW ===== */

/* Prevent horizontal scroll */
body, html {
  overflow-x: hidden;
  max-width: 100vw;
}

/* All sections stay within viewport */
section, main, div {
  max-width: 100%;
  box-sizing: border-box;
}

/* Images stay within bounds */
img {
  max-width: 100%;
  height: auto;
}

/* ===== FLEXBOX IMPROVEMENTS ===== */

/* Better flex wrapping */
.flex-wrap {
  flex-wrap: wrap;
  gap: 1rem;
}

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

.items-center {
  align-items: center;
}

/* ===== PROFESSIONAL SHADOWS ===== */

/* Card shadows */
.shadow-sm {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.shadow {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.shadow-lg {
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

/* Hover shadows */
.card-hover:hover {
  box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}

/* ===== ROUNDED CORNERS ===== */

/* Professional border radius */
.rounded-lg {
  border-radius: 12px;
}

.rounded-xl {
  border-radius: 16px;
}

.rounded-2xl {
  border-radius: 24px;
}

/* ===== Z-INDEX MANAGEMENT ===== */

/* Proper stacking */
header {
  z-index: 1000;
}

.modal {
  z-index: 9999;
}

.dropdown {
  z-index: 999;
}

/* ===== PRINT STYLES ===== */

@media print {
  .container-custom {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  section {
    padding: 1rem 0;
  }
}
