/* catalogo.css */

/* Hero section */
.hero-section {
    background-color: #f8f9fa;
    padding: 40px 0;
    margin-bottom: 30px;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: #343a40;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.1rem;
    color: #6c757d;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* Product Card */
.product-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-card-image {
    width: 100%;
    /* Maintain 1:1 aspect ratio */
    padding-bottom: 100%; 
    position: relative;
    overflow: hidden;
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-card-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
    flex-grow: 1; /* Allow description to take available space */
    height: 40px; /* Limit height for short description */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
}

.product-card-prices {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.price-atacado {
    font-size: 0.95rem;
    color: #888;
    text-decoration: line-through; /* Optional, if you want to show it as a less prominent price */
    margin-bottom: 2px;
}

.price-varejo {
    font-size: 1.4rem;
    font-weight: bold;
    color: #28a745; /* Green for retail price */
}

.product-card-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 5px;
    align-self: flex-start;
    margin-bottom: 10px;
}

.status-ativo {
    background-color: #d4edda;
    color: #155724;
}

.status-indisponivel {
    background-color: #f8d7da;
    color: #721c24;
}

.product-card-actions {
    margin-top: auto; /* Push buttons to the bottom */
}

.btn-buy {
    background: linear-gradient(45deg, #007bff, #0056b3); /* Blue/Indigo gradient */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.btn-buy:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

.btn-indisponivel {
    background-color: #6c757d; /* Gray for unavailable */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    gap: 10px;
}

.pagination button, .pagination span {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.pagination button:hover:not(.active):not(:disabled) {
    background-color: #dee2e6;
    border-color: #ced4da;
}

.pagination button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    cursor: default;
    font-weight: bold;
}

.pagination button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pagination .ellipsis {
    background-color: transparent;
    border: none;
    cursor: default;
    padding: 8px 0;
}

/* Skeleton Loading */
.skeleton-card {
    background-color: #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-image {
    width: 100%;
    padding-bottom: 100%;
    background-color: #bdbdbd;
}

.skeleton-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.skeleton-line {
    background-color: #bdbdbd;
    height: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-line.title {
    width: 80%;
    height: 20px;
}

.skeleton-line.description {
    width: 95%;
    height: 15px;
}

.skeleton-line.price {
    width: 50%;
    height: 18px;
}

.skeleton-line.button {
    width: 100%;
    height: 40px;
    margin-top: 10px;
}

@keyframes pulse {
    0% { background-color: #e0e0e0; }
    50% { background-color: #f0f0f0; }
    100% { background-color: #e0e0e0; }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
    .product-card-title {
        font-size: 1.1rem;
    }
    .price-varejo {
        font-size: 1.2rem;
    }
}