/* ============================================
   RibbleHi - Main Stylesheet
   A clean, modern design for home innovation
   ============================================ */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary-dark: #1a365d;
    --primary: #2c5282;
    --primary-light: #4299e1;

    /* Secondary Colors */
    --secondary: #0891b2;
    --secondary-light: #22d3ee;

    /* Accent Colors */
    --accent: #059669;
    --accent-light: #34d399;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

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

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

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--secondary);
}

ul, ol {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: var(--spacing-md);
}

h4 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-md);
}

.lead {
    font-size: 1.25rem;
    color: var(--gray-600);
    line-height: 1.7;
}

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

.container-narrow {
    max-width: 900px;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.logo-text span {
    color: var(--secondary);
}

.logo-tagline {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.logo-img {
    height: 60px;
    width: auto;
}

.footer-logo-img {
    height: 50px;
    width: auto;
    margin-bottom: var(--spacing-md);
}

.nav-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.nav-main a {
    color: var(--gray-700);
    font-weight: 500;
    padding: var(--spacing-sm) 0;
    position: relative;
}

.nav-main a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width var(--transition-normal);
}

.nav-main a:hover::after,
.nav-main a.active::after {
    width: 100%;
}

.nav-main a:hover,
.nav-main a.active {
    color: var(--primary-dark);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    transition: var(--transition-fast);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-main {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: var(--spacing-xl);
        gap: var(--spacing-lg);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-normal);
    }

    .nav-main.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-dark);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================
   Hero Sections
   ============================================ */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: var(--spacing-3xl) 0;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/hero-pattern.svg') repeat;
    opacity: 0.1;
}

.hero-home {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero h1 {
    color: var(--white);
    margin-bottom: var(--spacing-lg);
}

.hero .lead {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-xl);
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.hero-page {
    padding: var(--spacing-3xl) 0;
    text-align: center;
}

.hero-page h1 {
    margin-bottom: var(--spacing-md);
}

.hero-page .lead {
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Sections
   ============================================ */
.section {
    padding: var(--spacing-3xl) 0;
}

.section-gray {
    background: var(--gray-50);
}

.section-dark {
    background: var(--primary-dark);
    color: var(--white);
}

.section-dark h2,
.section-dark h3 {
    color: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--gray-600);
}

.section-dark .section-header p {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-200);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.card-text {
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
}

/* Feature Cards */
.feature-card {
    text-align: center;
    padding: var(--spacing-xl);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--white);
    stroke-width: 2;
    fill: none;
}

/* Product Cards */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .card-text {
    flex: 1;
}

.product-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--secondary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   Grids
   ============================================ */
.grid {
    display: grid;
    gap: var(--spacing-xl);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Stats / Trust Signals
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xl);
    text-align: center;
}

.stat-item {
    padding: var(--spacing-lg);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   CTA Banner
   ============================================ */
.cta-banner {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: var(--white);
    padding: var(--spacing-3xl);
    border-radius: var(--radius-xl);
    text-align: center;
}

.cta-banner h2 {
    color: var(--white);
    margin-bottom: var(--spacing-md);
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
}

/* ============================================
   Service List
   ============================================ */
.service-item {
    display: flex;
    gap: var(--spacing-xl);
    align-items: flex-start;
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--gray-200);
}

.service-item:last-child {
    border-bottom: none;
}

.service-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--secondary);
    stroke-width: 1.5;
    fill: none;
}

.service-content h3 {
    margin-bottom: var(--spacing-sm);
}

.service-content p {
    color: var(--gray-600);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .service-item {
        flex-direction: column;
        text-align: center;
    }

    .service-icon {
        margin: 0 auto;
    }
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-700);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: var(--spacing-xs);
}

.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* ============================================
   Contact Info
   ============================================ */
.contact-info {
    background: var(--gray-50);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item svg {
    width: 24px;
    height: 24px;
    stroke: var(--secondary);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
    margin-top: 2px;
}

.contact-item strong {
    display: block;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: var(--spacing-3xl) 0 var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.footer-brand .logo-text {
    color: var(--white);
    margin-bottom: var(--spacing-md);
}

.footer-brand p {
    color: var(--gray-400);
    margin-bottom: var(--spacing-md);
}

.footer h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: var(--spacing-lg);
}

.footer-links a {
    display: block;
    color: var(--gray-400);
    padding: var(--spacing-xs) 0;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--gray-800);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    gap: var(--spacing-lg);
    font-size: 0.875rem;
}

.footer-legal a {
    color: var(--gray-400);
}

.footer-legal a:hover {
    color: var(--white);
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   About Page
   ============================================ */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: center;
}

.about-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-details {
    background: var(--gray-50);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-xl);
}

.company-details h4 {
    margin-bottom: var(--spacing-md);
}

.company-details dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--spacing-sm) var(--spacing-lg);
}

.company-details dt {
    font-weight: 600;
    color: var(--gray-700);
}

.company-details dd {
    color: var(--gray-600);
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Product Page Specific
   ============================================ */
.product-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
    padding: var(--spacing-2xl) 0;
    border-bottom: 1px solid var(--gray-200);
}

.product-featured:last-child {
    border-bottom: none;
}

.product-featured:nth-child(even) {
    direction: rtl;
}

.product-featured:nth-child(even) > * {
    direction: ltr;
}

.product-featured-image {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-features {
    margin: var(--spacing-lg) 0;
}

.product-features li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    color: var(--gray-600);
}

.product-features li::before {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
}

@media (max-width: 768px) {
    .product-featured {
        grid-template-columns: 1fr;
    }

    .product-featured:nth-child(even) {
        direction: ltr;
    }
}

/* ============================================
   Solutions Page
   ============================================ */
.solution-block {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.solution-block h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.solution-block h3 svg {
    width: 32px;
    height: 32px;
    stroke: var(--secondary);
    stroke-width: 2;
    fill: none;
}

/* ============================================
   Alert Messages
   ============================================ */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-xl); }
.mb-3 { margin-bottom: var(--spacing-2xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-md); }
.mt-2 { margin-top: var(--spacing-xl); }
.mt-3 { margin-top: var(--spacing-2xl); }

.py-1 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-2 { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
.py-3 { padding-top: var(--spacing-2xl); padding-bottom: var(--spacing-2xl); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Image placeholders */
.placeholder-image {
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}
