/* SokoGo E-Commerce System - Main Frontend Stylesheet */
/* Color Scheme: Green (#28a745), White (#ffffff), Black (#000000) */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 15px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    padding: 5px 10px;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #28a745;
}

.cart-icon {
    position: relative;
    color: #333;
    text-decoration: none;
    padding: 5px 10px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 5px 10px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 150px;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.user-dropdown a:hover {
    background-color: #f8f9fa;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 400px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.slider-container {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
}

.slide h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.slide p {
    font-size: 18px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #218838;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.slider-dot.active {
    background-color: #28a745;
}

/* Categories Section */
.categories {
    padding: 50px 0;
    background-color: white;
}

.categories h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-card h3 {
    padding: 15px;
    text-align: center;
    color: #333;
}

/* Featured Products */
.featured-products {
    padding: 50px 0;
    background-color: #f8f9fa;
}

.featured-products h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
}

.product-info h3 {
    margin-bottom: 8px;
    color: #333;
    font-size: 18px;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 10px;
}

.product-stock {
    font-size: 14px;
    margin-bottom: 10px;
}

.stock-in-stock {
    color: #28a745;
}

.stock-low-stock {
    color: #ffc107;
}

.stock-out-of-stock {
    color: #dc3545;
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #218838;
}

.add-to-cart-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Features Section */
.features {
    padding: 50px 0;
    background-color: white;
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 15px;
}

.feature-item h3 {
    margin-bottom: 10px;
    color: #333;
}

.feature-item p {
    color: #666;
}

/* Newsletter Section */
.newsletter {
    padding: 50px 0;
    background-color: #28a745;
    color: white;
    text-align: center;
}

.newsletter h2 {
    margin-bottom: 15px;
}

.newsletter p {
    margin-bottom: 20px;
    font-size: 18px;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
}

.newsletter-form .btn {
    background-color: white;
    color: #28a745;
}

.newsletter-form .btn:hover {
    background-color: #f8f9fa;
}

/* Footer */
.footer {
    background-color: #333;
    color: white;
    padding: 30px 0;
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    color: #28a745;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #28a745;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    margin-top: 20px;
}

/* Product Detail Page */
.product-detail {
    padding: 50px 0;
    background-color: white;
}

.product-detail .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.product-gallery {
    position: relative;
}

.product-gallery img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-info h1 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #333;
}

.product-price-detail {
    font-size: 28px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 20px;
}

.product-description {
    margin-bottom: 20px;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 18px;
    border-radius: 4px;
}

.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.add-to-cart-large {
    padding: 15px 30px;
    font-size: 18px;
    margin-right: 15px;
}

.related-products {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* Cart Page */
.cart-page {
    padding: 50px 0;
    background-color: white;
}

.cart-items {
    margin-bottom: 30px;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info h3 {
    margin-bottom: 5px;
}

.cart-item-price {
    font-weight: bold;
    color: #28a745;
}

.cart-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-total {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: right;
}

.cart-total h3 {
    margin-bottom: 10px;
    color: #333;
}

.checkout-btn {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
}

.checkout-btn:hover {
    background-color: #218838;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .product-detail .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 10px;
    }

    .cart-item .cart-quantity,
    .cart-item .cart-price,
    .cart-item .cart-remove {
        grid-column: 2;
        justify-self: start;
        margin-top: 10px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form .btn {
        margin-top: 10px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
