/*
|--------------------------------------------------------------------------
| Core Site CSS
|--------------------------------------------------------------------------
*/

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
}

.container {
    width: min(1100px, calc(100% - 30px));
    margin: 0 auto;
}

.site-header {
    background: #2c3e50;
    color: #fff;
    padding: 30px 0;
}

.site-header h1 {
    margin: 0 0 8px;
}

.site-header p {
    margin: 0;
    opacity: 0.8;
}

.diagnostic {
    margin: 30px 0;
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.diagnostic h2 {
    margin-top: 0;
}

.status-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.status-row:last-child {
    border-bottom: 0;
}

.success {
    color: #16803c;
}

.error {
    color: #b42318;
}

.success-box,
.error-box {
    margin-top: 25px;
    padding: 18px;
    border-radius: 6px;
}

.success-box {
    background: #eaf7ef;
    border: 1px solid #b8e2c7;
}

.error-box {
    background: #fcebea;
    border: 1px solid #f1b8b5;
}

.module-list {
    margin-top: 30px;
}

.module-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

@media (max-width: 600px) {

    .status-row,
    .module-row {
        flex-direction: column;
        gap: 5px;
    }

    .diagnostic {
        padding: 18px;
    }
}


/* =========================================================
   Category / Product Listing
   ========================================================= */

.category-page {
    padding: 30px 0 50px;
}

.category-header {
    margin-bottom: 30px;
}

.category-header h1 {
    margin: 0 0 15px;
}

.category-description {
    line-height: 1.7;
    max-width: 900px;
}

.category-empty {
    padding: 40px 20px;
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(
        var(--mobile-portrait-columns),
        minmax(0, 1fr)
    );
    gap: 20px;
}

.product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border: 1px solid #ddd;
    background: #fff;
}

.product-card-image {
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #f3f3f3;
}

.product-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #777;
    font-size: 14px;
}

.product-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 15px;
}

.product-card-title {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.3;
}

.product-card-title a {
    color: inherit;
    text-decoration: none;
}

.product-card-title a:hover {
    text-decoration: underline;
}

.product-card-price {
    margin-bottom: 8px;
    font-size: 17px;
    font-weight: 700;
}

.product-card-stock {
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
}

.product-card-content .admin-button {
    margin-top: auto;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 35px;
}

.pagination a,
.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    text-decoration: none;
}

.pagination a {
    color: inherit;
}

.pagination-current {
    font-weight: 700;
}

/* Mobile landscape */
@media (min-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(
            var(--mobile-landscape-columns),
            minmax(0, 1fr)
        );
    }
}

/* Tablet portrait */
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(
            var(--tablet-portrait-columns),
            minmax(0, 1fr)
        );
    }
}

/* Tablet landscape */
@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(
            var(--tablet-landscape-columns),
            minmax(0, 1fr)
        );
    }
}

/* Desktop */
@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(
            var(--desktop-columns),
            minmax(0, 1fr)
        );
    }
}

/* =========================================================
   Basic Frontend Layout
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: #f5f5f5;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

img {
    max-width: 100%;
}

.container {
    width: min(1200px, calc(100% - 30px));
    margin-left: auto;
    margin-right: auto;
}

.site-header {
    background: #222;
    color: #fff;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    gap: 20px;
}

.site-logo {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}

.site-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-navigation a {
    color: #fff;
    text-decoration: none;
}

.site-navigation a:hover {
    text-decoration: underline;
}

.site-main {
    min-height: 60vh;
}

.site-footer {
    margin-top: 50px;
    padding: 30px 0;
    background: #222;
    color: #fff;
    text-align: center;
}

.site-footer p {
    margin: 0;
}