@import 'colors.css';

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Staatliches', sans-serif;
}

main {
    padding-top: 160px; /* Adjusted for fixed header + subnav */
    background: var(--natural-white);
    min-height: 100vh;
    padding-bottom: 100px;
}

/* Product grid layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Product card styles */
.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--hemp-beige);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--clay-red);
}

.product-image-container {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    background: var(--hemp-beige);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 1.75rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    background: white;
}

.product-info h3 {
    font-size: 1.4rem;
    color: var(--forest-green);
    margin: 0;
    line-height: 1.3;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--clay-red);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-price::before {
    font-size: 1rem;
    opacity: 0.8;
}

.product-description {
    color: var(--charcoal-gray);
    font-size: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--hemp-beige);
}

.product-stock {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

.product-stock.in {
    color: #059669;
    background-color: #ECFDF5;
}

.product-stock.low {
    color: #D97706;
    background-color: #FFFBEB;
}

.product-stock.out {
    color: #DC2626;
    background-color: #FEF2F2;
}

/* Product link styles */
.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Category section styles */
.category-section {
    margin: 2rem auto 4rem;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    max-width: 1400px;
}

.category-section h2 {
    font-size: 2.5rem;
    color: var(--forest-green);
    margin-bottom: 1.5rem;
    text-align: left;
}

.category-description {
    color: var(--charcoal-gray);
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    text-align: left;
    max-width: 800px;
}

/* No products found styles */
.no-products {
    padding: 6rem 2rem;
    text-align: center;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 2rem auto;
    max-width: 600px;
}

.no-products p {
    font-size: 1.3rem;
    color: var(--charcoal-gray);
    opacity: 0.8;
}

/* Inventory Management Styles */
.inventory-page {
    padding: 2rem;
    margin-top: 120px;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.add-product-btn {
    background-color: var(--btn-secondary);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.add-product-btn:hover {
    background-color: var(--btn-secondary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.inventory-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-bar {
    position: relative;
    flex: 1;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.category-filter select {
    padding: 0.75rem 2rem 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
}

.inventory-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #4b5563;
}

.product-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.stock-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    text-align: center;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status.in {
    background-color: #dcfce7;
    color: #15803d;
}

.status.low {
    background-color: #fff7ed;
    color: #c2410c;
}

.status.out {
    background-color: #fee2e2;
    color: #dc2626;
}

.action-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.view-btn, .edit-btn, .delete-btn {
    padding: 0.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 32px;
    height: 32px;
}

.view-btn {
    background-color: #6366f1;
}

.edit-btn {
    background-color: #10b981;
}

.delete-btn {
    background-color: #ef4444;
    width: 100%;
    height: 100%;
}

.delete-form {
    margin: 0;
    padding: 0;
    display: inline-block;
}

.action-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.no-products {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

/* Article section styles */
article h2 {
    font-size: 3rem;
    color: var(--clay-red);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: bold;
}

article h3 {
    font-size: 2rem;
    color: var(--forest-green);
    text-align: center;
    margin-bottom: 2rem;
    font-style: italic;
}

article p {
    font-size: 1.5rem;
    color: var(--charcoal-gray);
    text-align: center;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .category-section {
        padding: 2rem;
        margin: 1rem;
    }

    .category-section h2 {
        font-size: 2rem;
    }

    .product-info h3 {
        font-size: 1.2rem;
    }

    .product-price {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
}