/* ===========================================
   WELTKIT - Optimized CSS
   Version: 1.0.0 | Last Updated: 2025-08-14
   Theme: Red and White
   Lines: ~400 (optimized from 540+)
============================================ */

/* 1. RESET AND VARIABLES */
:root {
  /* Colors */
  --red: #E60000;      /* Darker red */
  --dark-red: #B30000;
  --light-red: #FF3333;
  --white: #FFFFFF;
  --background: #FFF8F8;     /* Slightly darker background */
  --border: #FFD6D6;     /* Softer border */
  --text: #1A0000;     /* Black with reddish tint */
  --light-text: #800000; /* Wine red */
  --soft-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  
  /* Spacing */
  --spacing: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  
  /* Shadows */
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  
  /* Transitions */
  --transition: all 0.3s ease;
}

/* Basic Reset */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html { 
    font-size: 16px; 
    scroll-behavior: smooth; 
}

/* Base Elements */
body { 
    font: 1rem/1.7 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text); 
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { 
    display: block;
    max-width: 100%; 
    height: auto; 
}

a { 
    color: var(--red); 
    text-decoration: none; 
    transition: var(--transition); 
}

a:hover { 
    color: var(--dark-red); 
    text-decoration: underline;
}

button, input, textarea, select { 
    font: inherit; 
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* 2. TYPOGRAPHY */
/* Typography */
h1, h2, h3, h4, h5, h6 { 
    font: 700 1em/1.3 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    margin: 2rem 0 1rem;
    color: var(--dark-red);
    letter-spacing: -0.02em;
}

h1 { 
    font-size: 2.5rem; 
    line-height: 1.1;
    margin: 0 0 1rem;
}

h2 { 
    display: inline-block;
    font-size: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

p {
    margin: 0 0 1.5rem;
    color: var(--text);
    line-height: 1.6;
}

h3 { font-size: 1.75rem; }

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

.section {
    padding: 5rem 0;
    position: relative;
}

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

.centered-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Header & Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.5rem 0;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 70px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.header.scroll-down {
    transform: translateY(-100%);
}

.header.scroll-up {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Ensure nav pushes to the right on desktop */
.main-nav {
    margin-left: auto;
}

.logo {
    font: 800 1.75rem/1.2 'Montserrat', sans-serif;
    color: var(--red);
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

/* Navigation */
.main-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.menu-item a:hover,
.menu-item a.active {
    color: var(--red);
    background: var(--background);
}

/* 6. HERO */
.hero {
    background: linear-gradient(135deg, var(--red) 0%, var(--dark-red) 100%);
    color: white;
    padding: 8rem 1rem 4rem;
    text-align: center;
    margin-top: 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero h1 {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* 7. CARDS */
.features-grid,
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    padding: 0 1rem;
}

.card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

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

.card-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-info h3 {
    color: var(--red);
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

/* Feature card icons */
.card.feature i {
    display: inline-block;
    font-size: 1.25rem; /* base size for mobile */
    color: var(--red);
    margin-right: 0.5rem;
    vertical-align: middle;
}

@media (min-width: 768px) {
  .card.feature i {
      font-size: 1.5rem;
      margin-right: 0.6rem;
  }
}

.card-info p {
    color: var(--text);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.button {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    margin: 0.5rem;
    min-width: 160px;
}

.button:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.button-secondary {
    background: transparent;
    border: 2px solid var(--red);
    color: var(--red);
}

.button-secondary:hover {
    background: rgba(230, 0, 0, 0.05);
    color: var(--dark-red);
    text-decoration: none;
}

/* 9. FOOTER */
.footer {
    background: var(--text);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer a {
    color: var(--white);
    opacity: 0.8;
    transition: var(--transition);
}

.footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

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

/* 10. Utilities */
.utility { margin-top: var(--spacing); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

/* Mobile Menu */
.mobile-menu-btn {
    background: none;
    border: 2px solid var(--red);
    border-radius: 4px;
    color: var(--red);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    margin-left: 1rem;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1001;
}

.mobile-menu-btn:hover {
    background: rgba(230, 0, 0, 0.05);
}

.mobile-menu-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.2);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--text);
    text-decoration: none;
    padding: 0.75rem 1rem;
    position: relative;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--red);
    background: rgba(230, 0, 0, 0.05);
    outline: none;
}

.main-nav a.active {
    color: var(--red);
    font-weight: 600;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--red);
    border-radius: 2px;
}

/* Base defaults to keep desktop tidy */
.mobile-menu-overlay { display: none; }
.main-nav i { display: none; }

/* Responsive Styles (mobile) */
@media (max-width: 767px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.98);
        padding: 1.5rem 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 999;
        -webkit-overflow-scrolling: touch;
        will-change: transform, opacity;
    }
    
    .main-nav::before {
        content: '';
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .main-nav.active::before {
        opacity: 1;
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Add a subtle overlay when menu is open */
    .mobile-menu-overlay {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 998;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .main-nav a {
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        border-radius: 6px;
        transition: all 0.2s ease;
    }
    
    .main-nav a:hover,
    .main-nav a:focus,
    .main-nav a.active {
        background: rgba(230, 0, 0, 0.05);
        color: var(--red);
        transform: translateX(4px);
    }
    
    .main-nav a::before {
        content: '';
        display: inline-block;
        width: 6px;
        height: 6px;
        background: var(--red);
        border-radius: 50%;
        margin-right: 12px;
        opacity: 0;
        transform: translateX(-8px);
        transition: all 0.3s ease;
    }
    
    .main-nav a:hover::before,
    .main-nav a:focus::before,
    .main-nav a.active::before {
        opacity: 1;
        transform: translateX(0);
    }
    
    .main-nav a.active::after {
        display: none;
    }
}

/* Base mobile styles (<=767px) */
@media (max-width: 767px) {
    /* Header & Navigation */
    .header {
        height: auto;
        min-height: 70px;
        padding: 0.5rem 0;
    }
    
    .header-container {
        flex-wrap: wrap;
        padding: 0.5rem var(--spacing);
    }
    
    .logo {
        font-size: 1.5rem;
        margin-right: auto;
    }
    
    .mobile-menu-btn {
        order: 2;
    }
    
    .main-nav {
        order: 3;
        flex: 0 0 100%;
        margin-top: 0.5rem;
    }
    
    .main-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
    }
    
    .menu-item {
        width: 100%;
        text-align: left;
    }
    
    .menu-item a {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        border-radius: 6px;
    }
    
    /* Hero Section */
    .hero {
        padding: 6rem 1rem 3rem;
        min-height: 70vh;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    /* Layout Adjustments */
    .features-grid,
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-card {
        margin-bottom: 2rem;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-text,
    .about-image {
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        margin: 1.5rem 0;
    }
    
    /* Typography Adjustments */
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    /* Buttons */
    .button {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .button + .button {
        margin-left: 0;
    }
}

/* Tablet Styles (768px - 1023px) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero {
        padding: 9rem 2rem 5rem;
    }
    
    .features-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 2rem;
    }
    .features-grid,
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .about-content {
        gap: 2rem;
    }
    
    .about-text,
    .about-image {
        flex: 1;
    }
}

/* Tablet and up (>=768px): ensure inline nav, hide hamburger, remove overlay/dots */
@media (min-width: 768px) {
  .mobile-menu-btn { display: none !important; }
  .main-nav {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .main-nav ul { flex-direction: row !important; gap: 1.25rem; align-items: center; }
  .main-nav i { display: none !important; }
  .main-nav a { padding: 0.5rem 0.75rem !important; background: transparent !important; }
  .main-nav a::before { content: none !important; }
  .mobile-menu-overlay { display: none !important; opacity: 0 !important; visibility: hidden !important; }
}

/* Desktop overrides to guarantee clean layout */
@media (min-width: 992px) {
  /* Hide hamburger on desktop */
  .mobile-menu-btn { display: none !important; }

  /* Ensure nav is inline and visible */
  .main-nav {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .main-nav ul { flex-direction: row !important; gap: 1.25rem; }

  /* Clean desktop nav appearance */
  .main-nav i { display: none !important; }
  .main-nav a {
    padding: 0.5rem 0.75rem !important;
    background: transparent !important;
  }
  .main-nav a:hover,
  .main-nav a.active {
    background: var(--background) !important;
    color: var(--red) !important;
  }

  /* Remove mobile dot indicators */
  .main-nav a::before { content: none !important; }

  /* Never show overlay on desktop */
  .mobile-menu-overlay { display: none !important; opacity: 0 !important; visibility: hidden !important; }
}

.grid { display: grid; }
.hidden { display: none; }
