:root {
    --primary-color: #2a6f97;
    --secondary-color: #61a5c2;
    --text-color: #333;
    --bg-color: #fff;
    --card-bg: #f8f9fa;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.dark {
    --text-color: #e9ecef;
    --bg-color: #212529;
    --card-bg: #343a40;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

.alegreya-sans-sc-regular {
    font-family: "Alegreya Sans SC", sans-serif;
    font-weight: 400;
    font-style: normal;
  }  

.raleway-font {
    font-family: "Raleway", serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Raleway', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
nav {
    position: fixed;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo img {
    max-height: 60px; /* Adjust this based on the desired size */
    width: auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .logo img {
        max-height: 40px; /* Slightly smaller logo on smaller screens */
    }
}


.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 2rem;
    transition: var(--transition);
}

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

.theme-toggle, .mobile-menu {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                url('https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?q=80&w=2000');
    background-size: cover;
    background-position: center;
    color: white;
}

.hero-content h1 {
    font-size: 6rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
    font-family: "Alegreya Sans SC", sans-serif;
    font-weight: 750;
    font-style: bold;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: var(--transition);
    animation: fadeInUp 1s ease 0.4s;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* About Section */
.about {
    padding: 6rem 0;
}

.about h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.about-stats {
    display: flex;
    grid-template-columns: repeat(3, 2fr);
    gap: 5rem;
    text-align: center;
}

.stat h3 {
    font-size: 3rem;
    color: var(--primary-color);
}

/* Products Section */
.products {
    padding: 6rem 0;
    background-color: var(--card-bg);
}

.products h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr)); /* Responsive grid layout */
    gap: 2rem; /* Space between cards */
    align-items: stretch; /* Ensure consistent card height */
}

.product-card:hover {
    transform: translateY(-5px);
}

/* Add perspective to create a 3D effect */
.product-card {
    perspective: 1000px;
    width: 100%;
    height: 350px; /* Fixed card height (adjust as needed) */
    background-color: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column; /* Align content in column */
}

/* Inner container with front and back sides */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
}

/* Front and back faces */
.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.card-front {
    background-color: var(--bg-color);
    padding: 1rem 1.3rem; /* Add more horizontal spacing if needed */
    display: flex;
    flex-direction: column; /* Stack content vertically */
    justify-content: flex-start; /* Align content to the top */
    align-items: center; /* Align content to the left */
    text-align: center; /* Ensure text is aligned left */
}

.card-back {
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem; /* Increased padding */
    transform: rotateY(180deg);
    text-align: center;
    gap: 5px;
}

.card-back h3 {
    margin-bottom: 20px; /* Space between title and description */
    font-size: 1.5rem; /* Adjust font size as needed */
}

.card-back p {
    margin-top: 0; /* Remove default margin */
    font-size: 1rem; /* Adjust font size as needed */
    max-width: 80%; /* Limit width for better readability */
}

/* Flip effect on hover or click */
.card-inner.flipped {
    transform: rotateY(180deg);
}

/* Ensure responsiveness */
.product-image {
    width: 100%;
    height: 200px; /* Consistent fixed height */
    object-fit: cover; /* Crop and resize proportionally */
    border-radius: 9px 9px 9px 9px; /* Optional: Add rounded corners for images */
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.5); /* Small shadow towards bottom right */
}

.product-info {
    padding: 0.5rem; /* Consistent padding */
    display: flex;
    flex-direction: column; /* Stack title and description */
    justify-content: flex-start; /* Align content to the top */
    height: 100%; /* Stretch to fill available space */
}

.card-front .product-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1rem 0;
    line-height: 1.2; /* Adjust this value to reduce the spacing */
    word-wrap: break-word; /* Ensure long words wrap onto the next line */
}

.card-front .product-info p {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary); /* Softer color for descriptions */
    line-height: 1.5; /* Improve readability */
    margin: 0;
    height: 5rem; /* Constrain height */
    overflow: hidden; /* Prevent overflow */
    display: -webkit-box; /* Enable line clamping */
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis; /* Add ellipsis for overflowed text */
}

/* Contact Section */
.contact {
    padding: 6rem 0;
    background-color: var(--bg-color);
}

.contact h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-family: "Poppins", sans-serif;
    color: var(--primary-color);
}

.contact-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: 0 1rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
}

.info-item {
    background-color: var(--card-bg);
    box-shadow: 0 3px 10px var(--shadow-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px; /* Limit maximum width */
    margin: 0 auto; /* Center the box horizontally */
}

.info-item p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    word-wrap: break-word; /* Allow long words to break and wrap */
    overflow-wrap: break-word; /* Ensure long words break properly */
    max-width: 100%; /* Ensure text doesn't exceed the container width */
    padding: 0 0.5rem; /* Add some padding to prevent text from touching the edges */
}

@media (max-width: 768px) {
    .info-item {
        max-width: 100%; /* Allow the box to take full width on small screens */
        padding: 1rem; /* Reduce padding for smaller screens */
    }

    .info-item p {
        font-size: 0.9rem; /* Slightly reduce font size for better fit */
    }
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 2rem 0;
    text-align: center;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu {
        display: block;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-color);
        padding: 1rem;
        box-shadow: 0 2px 10px var(--shadow-color);
    }

    .nav-links.active a {
        margin: 0.5rem 0;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

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

    .product-grid {
        grid-template-columns: 1fr;
    }
}