/* ============================================
   ShopEasy E-Commerce Website Styles
   Web Development Internship Project
   ============================================ */

/* CSS Reset - Reset default browser styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables - Define color palette and common values */
:root {
    /* Color Palette */
    --primary-color: #4a90e2;        /* Main brand color - blue */
    --primary-dark: #357abd;         /* Darker shade for hover */
    --secondary-color: #f5f5f5;      /* Light gray background */
    --text-dark: #333333;            /* Dark text */
    --text-light: #666666;           /* Light text */
    --white: #ffffff;                /* White */
    --border-color: #e0e0e0;         /* Border color */
    --success-color: #4caf50;        /* Success messages */
    --error-color: #f44336;          /* Error messages */
    
    /* Spacing */
    --container-width: 1200px;       /* Max container width */
    --section-padding: 60px;         /* Section padding */
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

/* Container - Center content with max width */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header & Navigation Styles
   ============================================ */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

/* Logo Styles */
.logo h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

/* Navigation Styles */
.navbar {
    display: flex;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Cart Styles */
.cart {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    position: relative;
}

.cart-icon {
    font-size: 24px;
}

.cart-count {
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -8px;
    right: -10px;
}

/* Mobile Menu Toggle (hidden on desktop) */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
}

/* ============================================
   Hero Section Styles
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 150px 0 100px;
    text-align: center;
    margin-top: 70px;
}

.hero-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-add-cart {
    background-color: var(--primary-color);
    color: var(--white);
    width: 100%;
    margin-top: 15px;
}

.btn-add-cart:hover {
    background-color: var(--primary-dark);
}

/* ============================================
   Products Section Styles
   ============================================ */
.products {
    padding: var(--section-padding) 0;
    background-color: var(--secondary-color);
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--text-dark);
}

/* Product Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* Product Card Styles */
.product-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 20px;
}

.product-category {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.product-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.product-description {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.product-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    margin-bottom: 10px;
}

.show-more-btn:hover {
    text-decoration: underline;
}

/* ============================================
   Contact Section Styles
   ============================================ */
.contact {
    padding: var(--section-padding) 0;
    background-color: var(--white);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Contact Form Styles */
.contact-form {
    background-color: var(--secondary-color);
    padding: 30px;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    font-family: var(--font-family);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--error-color);
}

.form-success {
    color: var(--success-color);
    font-weight: 600;
    margin-top: 15px;
    display: none;
}

.form-success.show {
    display: block;
}

/* Contact Info Styles */
.contact-info {
    padding: 20px;
}

.contact-info h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.6;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.info-icon {
    font-size: 20px;
}

/* ============================================
   Footer Styles
   ============================================ */
.footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
    color: var(--white);
}

.footer-section p {
    color: #aaa;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* ============================================
   Responsive Design - Mobile Styles
   ============================================ */
@media screen and (max-width: 768px) {
    /* Header Mobile Styles */
    .navbar {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--white);
        flex-direction: column;
        transition: left 0.3s ease;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    .navbar.active {
        left: 0;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
        padding: 40px 0;
        gap: 20px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    /* Hero Mobile Styles */
    .hero {
        padding: 120px 20px 80px;
    }
    
    .hero-content h2 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    /* Products Mobile Styles */
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Mobile Styles */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    /* Footer Mobile Styles */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Tablet Styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-wrapper {
        gap: 30px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}