/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

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

/* Navigation */
nav {
    background-color: #1e293b;
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav a:hover {
    color: #fff;
    text-decoration: none;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #e2e8f0;
    margin-bottom: 0.75rem;
}

.product-card h2 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.product-card h2 a {
    color: #1e293b;
}

.product-card h2 a:hover {
    color: #2563eb;
}

/* Price */
.price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #16a34a;
}

/* Product Detail Page */
.product-detail {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.product-detail img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    background-color: #e2e8f0;
    margin-bottom: 1.5rem;
}

.product-detail h1 {
    margin-bottom: 0.75rem;
}

.product-detail .price {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.product-detail .description {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.product-detail .category {
    font-size: 0.9rem;
    color: #64748b;
}

.product-detail .category a {
    color: #2563eb;
}

/* Login Form */
.login-form {
    max-width: 400px;
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #1e293b;
}

.form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-form button {
    width: 100%;
    padding: 0.7rem;
    background-color: #2563eb;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-form button:hover {
    background-color: #1d4ed8;
}

/* Hidden deals link (not visible, but present in the DOM) */
.hidden-deals-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Deals page */
.deals-subtitle {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.product-card {
    position: relative;
}

.discount-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: #dc2626;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    z-index: 1;
}

.old-price {
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.sale-price {
    color: #dc2626;
}

/* Headers table (/hh) */
.headers-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.headers-table th,
.headers-table td {
    text-align: left;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.headers-table thead th {
    background-color: #1e293b;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.headers-table tbody tr:last-child td {
    border-bottom: none;
}

.headers-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.headers-table .header-name {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.headers-table .header-value {
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

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

    .product-detail img {
        height: 220px;
    }
}

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

    h1 {
        font-size: 1.4rem;
    }

    .product-detail {
        padding: 1.25rem;
    }
}
