/* ===== BASE ===== */
body {
    background: #f6f6f6;
    color: #111;
    font-family: 'Montserrat', sans-serif;
}

.container {
    max-width: 1280px;
    margin: 50px auto;
    padding: 30px 20px 1000px 20px;
    padding-bottom: 50px
}

/* ===== HERO ===== */
.page-hero {
    padding: 100px 0 60px;
    text-align: center;
    background-size: cover;
    background-position: center;
    position: relative;
    height: 40vh;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(201 210 217 / 80%), rgba(10, 46, 77, 0.6));
    backdrop-filter: blur(6px);
}

.page-hero .container {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.page-hero h1 {
    font-size: 40px;
    font-weight: 600;
    color: #fff;
}

.page-hero p {
    color: #fff;
}

/* ===== FILTER ===== */
.filter-bar {
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 18px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(15px);
    border-radius: 14px;
}

.form-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.form-group {
    flex: 1;
}

.form-control {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 0 12px;
}

.btn-primary {
    height: 44px;
    padding: 18px;
    border-radius: 10px;
    background: #0A2E4D;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: 0.3s all;
}

.btn-primary:hover {
    background: #123d66;
}

/* ===== GRID ===== */
.grid {
    display: grid;
    gap: 20px;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== CARD ===== */
.card {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(18px);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.card-link {
    position: relative;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.1);
}

/* Stretched link: card title <a> covers entire card */
.stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* IMAGE */
.card-img-wrap {
    height: 180px;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
}

/* BODY */
.card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-body-top {
    flex: 1;
}

.card-text {
    font-size: 11px;
    color: #888;
}

.card-title {
    font-size: 15px;
    margin: 5px 0;
}

.card-title a {
    text-decoration: none;
    color: #111;
}

.card-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
    margin: 6px 0 12px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    font-size: 15px;
    font-weight: 600;
}

.old-price {
    font-size: 13px;
    color: #aaa;
    text-decoration: line-through;
    margin-left: 8px;
}

.card-login-prompt a {
    color: #000;
}

/* ===== PAGINATION ===== */
.pagination {
    margin-top: 40px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: #111;
}

.pagination .active {
    background: #111;
    color: #fff;
}

/* ===== EMPTY ===== */
.empty-state {
    text-align: center;
    padding: 60px;
}

.empty-state-text{
    margin-bottom: 30px;
}

.empty-state h3{
    font-size: 24px;
    margin-bottom: 50px;
}

/* ===== STOCK ===== */
.card-stock {
    font-size: 12px;
    margin-top: 6px;
    margin-bottom: 10px;
    font-weight: 500;
}

.in-stock {
    color: #2e7d32;
}

.out-stock {
    color: #c62828;
}

/* ===== ADD TO CART ===== */
.add-to-cart-form {
    margin-top: 10px;
    position: relative;
    z-index: 2;
}

.cart-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* qty input */
.qty-input {
    width: 60px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
}

/* button */
.btn-add-cart {
    flex: 1;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #0A2E4D;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-add-cart:hover {
    background: #0c385e;
}

/* ===== MOBILE ===== */
@media (max-width: 500px) {

    .cart-row {
        flex-direction: column;
        align-items: stretch;
    }

    .qty-input {
        width: 80%;
        margin: 0 auto;
    }

    .btn-add-cart {
        width: 100%;
         width: 80%;
        padding: 10px;
        margin: 0 auto;
    }
}

/* HERO */

.page-hero {
    padding: 120px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, #f9f9f9, #ffffff);
}

.page-hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

/* SECTION */

.products-section {
    padding: 60px 0 120px;
}

/* GRID */

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* CARD */

.card-product {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.35s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);

    display: flex;
    flex-direction: column;
}

.card-product:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

/* IMAGE */

.product-image img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: 0.5s;
}

.card-product:hover img {
    transform: scale(1.05);
}

/* BODY */

.product-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* CATEGORY */

.product-category {
    font-size: 12px;
    color: #777;
}

/* TITLE */

.product-body h3 {
    font-size: 16px;
    margin: 10px 0;
}

.product-body h3 a {
    text-decoration: none;
    color: #0A2E4D;
}

/* DESC */

.card-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
    margin-bottom: 10px;
    min-height: 40px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* PRICE */

.product-price {
    font-weight: 600;
    margin-top: 10px;
}

.old-price {
    margin-left: 10px;
    text-decoration: line-through;
    color: #999;
}

/* STOCK */

.product-stock {
    margin-top: 8px;
    font-size: 12px;
}

.product-stock.in { color: #065F46; }
.product-stock.out { color: #991B1B; }

/* CART */

.cart-row {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.qty-input {
    width: 60px;
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.btn-add {
 flex: 1;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #0A2E4D;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;

}

/* LOGIN */

.product-login {
    margin-top: auto;
    font-size: 13px;
    color: #0A2E4D;
}

/* PAGINATION */

.pagination {
    margin-top: 50px;
    text-align: center;
}

.pagination a,
.pagination span {
    margin: 0 5px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    background: #f1f1f1;
}

.pagination .active {
    background: #0A2E4D;
    color: white;
}

/* MOBILE */

@media (max-width: 900px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-add {
        padding: 10px;
    }
}

@media (max-width: 600px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary {
        width: 100%;
    }
}