/* Frontend Store Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #3498db;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #3498db;
}

.cart-link {
    position: relative;
    font-weight: 600;
    color: #3498db;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    opacity: 0.9;
}

/* Section */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
    color: #2c3e50;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.product-description {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
    flex: 1;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
}

.compare-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.discount-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-block {
    width: 100%;
}

/* Single Product Page */
.product-detail {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.product-image-large {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.product-details h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

.stock-status {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
}

.in-stock {
    background: #d4edda;
    color: #155724;
}

.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.product-description-full {
    margin: 30px 0;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

.quantity-selector label {
    font-weight: 600;
}

.quantity-selector input {
    width: 80px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
}

/* Cart Page */
.cart-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.cart-table table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

.cart-table td {
    padding: 20px 15px;
    border-top: 1px solid #e0e0e0;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-name {
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
}

.cart-item-name:hover {
    color: #3498db;
}

.quantity-input {
    width: 70px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
}

.cart-summary {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-summary h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: #28a745;
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
    padding-top: 15px;
}

/* Checkout Form */
.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.checkout-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 40px;
}

.form-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Order Summary */
.order-summary {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
}

.order-summary h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
}

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

.footer-section h3 {
    margin-bottom: 15px;
}

.footer-section a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    margin-bottom: 8px;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.empty-state p {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 30px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}

.page-link {
    padding: 10px 16px;
    background: white;
    color: #3498db;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-link:hover {
    background: #3498db;
    color: white;
}

.page-link.active {
    background: #3498db;
    color: white;
}

/* Categories Filter */
.categories-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    justify-content: center;
}

.category-link {
    padding: 10px 20px;
    background: white;
    color: #555;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.category-link:hover,
.category-link.active {
    background: #3498db;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    nav {
        flex-direction: column;
        gap: 15px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .product-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cart-table {
        overflow-x: auto;
    }
}
