/* ============================================
   Global Styles
   ============================================ */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --light-bg: #ecf0f1;
    --dark-text: #1e40af;
    --border-color: #bdc3c7;
    --success-color: #27ae60;
    --warning-color: #f39c12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    background-color: white;
    color: var(--dark-text);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    flex: 0 0 auto;
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex: 1 1 auto;
    margin-left: 2rem;
}

.navbar-menu li {
    position: relative;
}

.navbar-menu a {
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.navbar-menu a:hover {
    color: var(--secondary-color);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--secondary-color);
    list-style: none;
    padding: 1rem 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 0.7rem 1.5rem;
    color: white;
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background-color: rgba(255,255,255,0.1);
}

.navbar-icons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-icons a {
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

.navbar-icons a:hover {
    color: var(--secondary-color);
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 100px 20px;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background-color: var(--accent-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* ============================================
   Section Titles
   ============================================ */

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

/* ============================================
   Product Grid
   ============================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: #7f8c8d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    min-height: 2.2rem;
}

.product-price {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-original-price {
    font-size: 0.95rem;
    color: #95a5a6;
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.product-rating {
    color: #f39c12;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions button {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-add-cart {
    background-color: var(--secondary-color);
    color: white;
    flex: 2;
}

.btn-add-cart:hover {
    background-color: #c0392b;
}

.btn-wishlist {
    background-color: #ecf0f1;
    color: var(--primary-color);
}

.btn-wishlist:hover {
    background-color: #bdc3c7;
}

/* ============================================
   Categories Grid
   ============================================ */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.category-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-name {
    padding: 1.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

/* ============================================
   Features Grid
   ============================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.feature-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.feature-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: white;
    color: var(--dark-text);
    padding: 3rem 20px 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #1e40af;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.7rem;
    font-size: 1.05rem;
}

.footer-section a {
    color: #1e40af;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 1.05rem;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-section p {
    color: #1e40af;
    margin-bottom: 0.7rem;
    font-size: 1.05rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--light-bg);
    border-radius: 50%;
    color: #1e40af;
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--secondary-color);
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
    color: #1e40af;
    font-size: 1rem;
}

/* ============================================
   Newsletter Section
   ============================================ */

.newsletter {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 3rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.newsletter h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.newsletter p {
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 4px;
}

/* ============================================
   Page Header
   ============================================ */

.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 3rem 20px;
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ============================================
   Responsive Design
   ============================================ */

/* ============================================
   Mobile Responsive Design
   ============================================ */

/* Tablets and medium screens (768px and below) */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .navbar {
        flex-direction: column;
        gap: 10px;
    }

    .navbar-menu {
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        margin-left: 0;
    }

    .navbar-icons {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    .hero {
        padding: 60px 20px;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .section-title {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-card i {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input {
        min-width: auto;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .header-section {
        background-color: white;
    }
}

/* Phones and small screens (600px and below) */
@media (max-width: 600px) {
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-size: 13px;
        line-height: 1.5;
    }

    .container {
        padding: 0 12px;
        max-width: 100%;
    }

    /* Navigation */
    .navbar {
        flex-direction: column;
        padding: 0.5rem 0;
        gap: 0;
    }

    .navbar-brand {
        width: 100%;
    }

    .logo {
        font-size: 1.3rem;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-left: 0;
    }

    .navbar-menu li {
        width: 100%;
    }

    .navbar-menu a {
        display: block;
        padding: 0.6rem 1rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .dropdown-menu {
        position: static !important;
        display: none !important;
        box-shadow: none;
        background-color: #f9f9f9;
        min-width: auto;
        border-top: none;
        padding: 0;
    }

    .navbar-menu li:hover .dropdown-menu,
    .dropdown:hover .dropdown-menu {
        display: block !important;
    }

    .dropdown-menu li a {
        padding: 0.5rem 1.5rem;
        font-size: 0.85rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-icons {
        width: 100%;
        justify-content: flex-start;
        gap: 1rem;
    }

    /* Hero */
    .hero {
        padding: 40px 15px;
        min-height: 300px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.6rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    .hero-buttons {
        gap: 0.8rem;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Section styling */
    section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .section-title::after {
        width: 60px;
    }

    /* Products */
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.8rem;
    }

    .product-card {
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }

    .product-image {
        height: 120px;
    }

    .product-name {
        font-size: 0.95rem;
        min-height: auto;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .product-actions {
        gap: 0.3rem;
        flex-wrap: wrap;
    }

    .product-actions button {
        flex: 1;
        min-width: 70px;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-card {
        display: flex;
        flex-direction: column;
    }

    .category-image {
        height: 150px;
    }

    .category-name {
        padding: 1rem;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-card i {
        font-size: 2rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
        margin: 1rem 0 0.5rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.6rem;
        font-size: 1rem; /* Prevent zoom on mobile */
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-section h4 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .footer-section p,
    .footer-section ul li {
        font-size: 1rem;
    }

    .footer-section a {
        font-size: 1rem;
    }

    .newsletter {
        padding: 2rem 1rem;
    }

    .newsletter h2 {
        font-size: 1.5rem;
    }

    .newsletter p {
        font-size: 0.9rem;
    }

    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
        gap: 0.8rem;
    }

    .newsletter-form input {
        width: 100%;
        min-width: auto;
        padding: 0.8rem;
    }

    .newsletter-form button {
        width: 100%;
    }

    /* Page styling */
    .page-header {
        padding: 2rem 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .header-section {
        background-color: white;
    }
}

/* Extra small screens (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    body {
        font-size: 12px;
    }

    /* Smaller text for all sections */
    .navbar-menu a {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
    }

    .hero {
        padding: 30px 10px;
        min-height: 250px;
    }

    .hero h1 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .hero-buttons {
        gap: 0.6rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    section {
        padding: 30px 0;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.6rem;
    }

    .product-image {
        height: 100px;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-info {
        padding: 0.8rem;
    }

    .product-actions button {
        min-width: 60px;
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }

    .categories-grid {
        gap: 0.8rem;
    }

    .category-image {
        height: 120px;
    }

    .category-name {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-card i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .feature-card h3 {
        font-size: 1rem;
        margin: 0.5rem 0;
    }

    .feature-card p {
        font-size: 0.8rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 0.8rem;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.5rem;
        font-size: 1rem;
        min-height: 44px; /* Touch-friendly size */
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0 1rem;
    }

    .footer-section h4 {
        font-size: 1.05rem;
        margin-bottom: 0.8rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.95rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    /* Forms & Input */
    input, textarea, select, button {
        min-height: 44px; /* iOS recommended touch target size */
    }

    button {
        min-width: 44px;
    }
}

/* Ultra small screens (320px and below) */
@media (max-width: 320px) {
    .container {
        padding: 0 8px;
    }

    .logo {
        font-size: 1rem;
    }

    .navbar-menu a {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }

    .hero h1 {
        font-size: 1.1rem;
    }

    .hero p {
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 1.2rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        width: 100%;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }

    .footer-section h4 {
        font-size: 0.9rem;
    }
}