/* Base Styles */
:root {
    --primary-color: #3b7d34;
    --secondary-color: #f8f8f8;
    --accent-color: #e67e22;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

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

ul {
    list-style: none;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

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

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

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Header */
header {
    background-color: var(--header-bg);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    width: 270px;
    height: auto;
    margin-right: 10px;
    border-radius: 4px;
}

.company-name {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
}

.main-nav {
    display: flex;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    font-weight: 600;
    position: relative;
}

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

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

.language-selector {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

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

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 0;
    position: relative;
}

.hero-logo {
    display: none;
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.hero-logo-image {
    width: 25%;
    height: auto;
    opacity: 0.7;
    /* border-radius: 8px; */
    /* box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); */
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Products Section */
.products {
    padding: 80px 0;
    background-color: var(--products-bg);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

.product-image {
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-card h3 {
    padding: 15px 15px 10px;
    font-size: 1.3rem;
}

.product-card p {
    padding: 0 15px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.product-card .price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
    text-align: right;
    padding-right: 15px;
}

.product-card .btn {
    margin: 15px;
    width: calc(100% - 30px);
}

/* Add to cart button */
.add-to-cart {
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.add-to-cart:hover {
    background-color: #4CAF50;
}

.add-to-cart:active {
    transform: scale(0.95);
}

/* Animation when button is clicked */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.add-to-cart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.add-to-cart:active::after {
    animation: ripple 0.6s ease-out;
}

/* Order Section */
.order-section {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.order-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.cart-summary {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.cart-summary h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Order cart specific styles */
.order-cart table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed;
}

.order-cart th, 
.order-cart td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.order-cart th:first-child,
.order-cart td:first-child {
    width: 35%;
    text-align: left;
}

.order-cart th:nth-child(2),
.order-cart td:nth-child(2) {
    width: 30%;
    text-align: right;
}

.order-cart th:nth-child(3),
.order-cart td:nth-child(3) {
    width: 20%;
    text-align: right;
    padding-right: 20px;
}

.order-cart th:last-child,
.order-cart td:last-child {
    width: 15%;
    text-align: center;
}

.cart-item-quantity {
    text-align: right;
}

.quantity-controls {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.cart-item-price {
    font-weight: 600;
}

.cart-total {
    padding-right: 20px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-info {
    display: flex;
    align-items: center;
    grid-column: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-right: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    grid-column: 2;
    justify-self: end;
    min-width: 120px;
}

.quantity-btn {
    background: none;
    border: 1px solid var(--border-color);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.quantity-value {
    margin: 0 10px;
    text-align: right;
    min-width: 50px;
    display: inline-block;
    width: 60px;
}

/* Cart item alignment fixes */
#cart-items .cart-item {
    display: grid;
    grid-template-columns: 1fr 120px 120px 40px;
    gap: 15px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

#cart-items .cart-item-info {
    grid-column: 1;
}

#cart-items .cart-item-quantity {
    grid-column: 2;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

#cart-items .cart-item-price {
    grid-column: 3;
    justify-self: end;
    text-align: right;
    font-weight: 600;
    padding-right: 10px;
}

#cart-items .remove-item {
    grid-column: 4;
    justify-self: end;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: var(--transition);
}

#cart-items .remove-item:hover {
    color: #ff0000;
}

/* Mobile cart adjustments */
@media (max-width: 768px) {
    #cart-items .cart-item {
        grid-template-columns: 1fr 90px 80px 30px;
        gap: 8px;
    }
    
    .quantity-value {
        min-width: 40px;
        width: auto;
        font-size: 14px;
    }
    
    .quantity-btn {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 576px) {
    #cart-items .cart-item {
        grid-template-columns: 1fr 80px 70px 30px;
        gap: 5px;
    }
    
    .cart-item-name {
        font-size: 14px;
    }
    
    .cart-item-price {
        font-size: 14px;
    }
    
    .quantity-value {
        margin: 0 5px;
    }
}

.cart-item-price {
    font-weight: 600;
    text-align: right;
    min-width: 100px;
    grid-column: 3;
    justify-self: end;
}

.remove-item {
    grid-column: 4;
    justify-self: end;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-total p:last-child {
    text-align: right;
    min-width: 100px;
}

.empty-cart {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.order-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    position: relative;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.checkbox-container {
    display: flex;
    align-items: center;
    text-align: left;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

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

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    font-weight: 600;
    color: var(--primary-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Contact Section */
.contact {
    padding: 80px 0;
    background-color: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
}

.contact-form {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    position: relative;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo p {
    margin-top: 15px;
}

.footer-logo-img {
    width: 220px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 4px;
}

.footer-links h3 {
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

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

.footer-links ul li a {
    color: #ccc;
}

.footer-links ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    text-align: center;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal p {
    margin-bottom: 30px;
}

/* Mobile Menu */
.mobile-nav {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: var(--box-shadow);
    z-index: 99;
    padding: 20px 0;
}

.mobile-nav.show {
    display: block;
}

.mobile-nav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-nav li {
    margin: 10px 0;
}

.mobile-nav a {
    font-weight: 600;
    font-size: 1.2rem;
    padding: 8px 15px;
    display: block;
}

/* Touch Input Improvements */
input, textarea, select, button {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
}

button, .btn {
    min-height: 44px; /* Minimum touch target size */
    min-width: 44px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .contact-content,
    .order-content,
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .contact-item {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .logo {
        margin-bottom: 5px;
    }
    
    .logo-image {
        width: 65%;
    }
    .hero-logo {
        display: none;
    }
    .company-name {
        display: none;
    }
    
    .footer-logo-img {
        width: 100%;
    }
    
    .language-selector {
        position: absolute;
        top: 15px;
        right: 55px;
    }
    
    .mobile-menu-toggle {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group input, 
    .form-group textarea {
        padding: 12px;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
    }
}
