/* Importando a fonte usada no template */
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700&display=swap');

/* Reset básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Corpo e fonte padrão */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f8f8f8;
    color: #333;
}

/* =========================================================
   GRELHA RESPONSIVA DE PRODUTOS
   ========================================================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    padding: 20px;
}

/* =========================================================
   CARTÕES DE PRODUTOS
   ========================================================= */

.product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease-in-out,
                box-shadow 0.2s ease-in-out;
    text-align: center;
    padding: 15px;

    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.product-card .w3-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card .offers-toggle {
    margin-top: auto;
}


/* =========================================================
   IMAGEM DO PRODUTO
   ========================================================= */

.product-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 5px;
}

/* =========================================================
   BOTÕES
   ========================================================= */

.product-card .w3-button {
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* =========================================================
   TÍTULO DO PRODUTO
   ========================================================= */

.product-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 10px 0 6px;

    min-height: 42px;
    max-height: 42px;

    overflow: hidden;
}

.product-title a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease-in-out;
}

.product-title a:hover {
    text-decoration: underline;
    color: blue;
}

/* =========================================================
   DESCRIÇÃO DO PRODUTO
   ========================================================= */

.product-description {
    font-size: 13px;
    line-height: 1.4;
    color: #555;

    min-height: 55px;
    max-height: 55px;

    margin: 0 0 4px;

    overflow: hidden;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* =========================================================
   CATEGORIA / SUBCATEGORIA
   ========================================================= */

.product-category {
    font-size: 11px;
    color: #777;
    margin: 6px 0 10px;
    line-height: 1.4;
    min-height: 16px;
}

/* =========================================================
   IDENTIDADE DO PRODUTO
   ========================================================= */

.product-identity {
    font-size: 11px;
    color: #777;
    margin: 4px 0 8px;
    line-height: 1.4;
}

/* =========================================================
   PREÇO
   ========================================================= */

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
    margin: 8px 0 12px;
}

/* =========================================================
   BOTÃO EBAY
   ========================================================= */

.ebay-link {
    display: inline-block;
    padding: 10px 15px;
    background: #000;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.3s;
}

.ebay-link:hover {
    background: #444;
}

/* =========================================================
   OFERTAS
   ========================================================= */

.offers-toggle {
    width: 100%;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    margin-top: 10px;
}

.offers-toggle:hover {
    background-color: #444 !important;
    color: #fff !important;
}

.offers-list {
    display: none;
    margin-top: 10px;
    text-align: left;
}

.offer-row {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.offer-row:last-child {
    border-bottom: none;
}

.offer-price {
    font-weight: bold;
}

.offer-link {
    margin-left: 8px;
    font-size: 13px;
}

/* =========================================================
   RESPONSIVIDADE
   ========================================================= */

/* Tablets / ecrãs médios */
@media screen and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablets pequenos */
@media screen and (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Smartphones */
@media screen and (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}
