/**
 * Souq7 - Main Stylesheet
 * Lightweight, responsive, performance-optimized CSS
 */

/* ========================================
   CSS Variables (Design Tokens)
   ======================================== */
:root {
    /* Colors */
    --primary-color: #ff6600;
    --primary-dark: #cc5200;
    --primary-light: #ff8533;
    --secondary-color: #ff9800;
    --accent-color: #f7931e;
    
    --text-dark: #1a1a1a;
    --text-gray: #4a4a4a;
    --text-light-gray: #999999;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    
    /* Typography - Improved fallback stacks to prevent layout shift */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Poppins', system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    
    /* Spacing */
    --section-padding: 80px;
    --section-padding-mobile: 50px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Optional: Local font-face with fallback adjustments */
@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial'), local('Helvetica Neue'), local('sans-serif');
    font-display: swap;
    size-adjust: 105%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Poppins Fallback';
    src: local('Arial'), local('Helvetica'), local('sans-serif');
    font-display: swap;
    size-adjust: 107%;
    ascent-override: 92%;
    descent-override: 28%;
    line-gap-override: 0%;
}

/* ========================================
   Base & Reset
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
    /* Prevent forced reflow during font loading */
    text-rendering: optimizeSpeed;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* ========================================
   Header & Navigation
   ======================================== */
.site-header {
    background: var(--bg-white);
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-brand .logo {
    height: 45px;
    width: auto;
}

.navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
    transition: var(--transition-fast);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    background: white;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    animation: fadeInUp 0.8s ease;
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero-buttons .btn {
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.hero-image {
    position: relative;
    animation: fadeInRight 0.8s ease;
    aspect-ratio: 3 / 2;
}

.hero-image img {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    height: auto;
    display: block;
}

.btn-light {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 6px;
}

.btn-light:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Section Styles
   ======================================== */
.section {
    padding: var(--section-padding) 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-title p {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 1.5rem auto 0;
}

.bg-light-section {
    background-color: var(--bg-light);
}

/* ========================================
   Product Cards
   ======================================== */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-card-image {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: var(--bg-light);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.08);
}

.product-category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.product-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.product-card-description {
    color: var(--text-gray);
    margin-bottom: 1.25rem;
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.product-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.btn-view-details {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-view-details:hover {
    color: var(--primary-dark);
    transform: translateX(5px);
}

.btn-view-details i {
    margin-left: 0.5rem;
    transition: var(--transition-fast);
}

/* ========================================
   Category Cards
   ======================================== */
.category-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    background: var(--bg-light);
    transition: var(--transition-normal);
}

.category-icon i {
    font-size: 2.5rem;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.category-description {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.category-count {
    display: inline-block;
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ========================================
   Product Detail Page
   ======================================== */
.product-detail-section {
    padding: 3rem 0;
}

.product-detail-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.product-detail-image img {
    width: 100%;
    height: auto;
}

.product-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.product-meta-item {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.9rem;
}

.product-meta-item i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li i {
    color: var(--primary-color);
    margin-right: 1rem;
    font-size: 1.2rem;
}

.specs-table {
    width: 100%;
    margin-top: 1.5rem;
}

.specs-table th,
.specs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.specs-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.specs-table tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Feature/Highlight Boxes
   ======================================== */
.feature-box {
    text-align: center;
    padding: 2rem 1.5rem;
    background: white;
    border-radius: 12px;
    transition: var(--transition-normal);
    height: 100%;
    box-shadow: var(--shadow-sm);
}

.feature-box:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    color: white;
    font-size: 2rem;
}

.feature-box h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.feature-box p {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================================
   Stats/Counter Section
   ======================================== */
.stats-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
    padding: 4rem 0;
}

.stat-box {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
    color: white;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* ========================================
   Contact Form
   ======================================== */
.contact-form {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.contact-info-box {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    height: 100%;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-info-item:last-child {
    margin-bottom: 0;
}

.contact-info-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.contact-info-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.contact-info-content p {
    margin: 0;
    color: var(--text-gray);
}

.contact-info-content a {
    color: var(--primary-color);
    transition: var(--transition-fast);
}

.contact-info-content a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========================================
   Map Embed
   ======================================== */
.map-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 400px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
    background: var(--bg-light);
    padding: 1rem 0;
    margin-bottom: 0;
    border-radius: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-gray);
}

/* ========================================
   Alert Messages
   ======================================== */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: #1a1a1a;
    color: #cccccc;
}

.site-footer h5 {
    color: white;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #cccccc;
    transition: var(--transition-fast);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.contact-info {
    list-style: none;
    padding: 0;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 0.75rem;
    margin-top: 0.25rem;
}

.contact-info a {
    color: #cccccc;
    text-decoration: none;
    transition: var(--transition-fast);
}

.contact-info a:hover {
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    color: white;
}

.text-light-gray {
    color: #999999;
}

/* ========================================
   WhatsApp Floating Button
   ======================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: var(--transition-normal);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background: #128c7e;
    transform: scale(1.1);
    color: white;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 998;
    transition: var(--transition-normal);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 991px) {
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
    }
    
    .navbar-nav .nav-link.active::after {
        left: 0;
        right: auto;
        width: 30px;
    }
    
    .hero-section {
        min-height: 500px;
        padding: 80px 0 60px;
    }
    
    .hero-section h1 {
        font-size: 2.25rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: var(--section-padding-mobile) 0;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    
    .product-card-image {
        height: 220px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 28px;
    }
    
    .back-to-top {
        bottom: 85px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.shadow-custom {
    box-shadow: var(--shadow-md);
}

.rounded-custom {
    border-radius: 12px;
}

/* ========================================
   Loading & Lazy Load
   ======================================== */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Print Styles */
@media print {
    .site-header,
    .whatsapp-float,
    .back-to-top,
    .site-footer {
        display: none;
    }
}
