/**
 * GDA Ofertas - Frontend Styles
 * Estilo inspirado no Mercado Livre
 */

/* ==========================================================================
   GRID DE OFERTAS
   ========================================================================== */

.gda-ofertas-wrapper {
    margin: 24px 0;
}

.gda-ofertas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.gda-ofertas-titulo {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.gda-ofertas-grid {
    display: grid;
    gap: 16px;
}

/* ==========================================================================
   CARD DE OFERTA
   ========================================================================== */

.gda-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.gda-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Imagem do Card */
.gda-card-link {
    display: block;
    text-decoration: none;
}

.gda-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Aspect ratio 1:1 */
    background: #f5f5f5;
    overflow: hidden;
}

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

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

.gda-card-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.gda-card-no-image .dashicons {
    font-size: 48px;
    color: #ccc;
    width: 48px;
    height: 48px;
}

/* Conteúdo do Card */
.gda-card-content {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Label/Badge */
.gda-card-label {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background-color: #39b54a;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    align-self: flex-start;
}

/* Título */
.gda-card-title-link {
    text-decoration: none;
    color: inherit;
}

.gda-card-title {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    margin: 0 0 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.gda-card-title-link:hover .gda-card-title {
    color: #3483fa;
}

/* Preços */
.gda-card-pricing {
    margin-bottom: 12px;
}

.gda-card-price-original {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    display: block;
    margin-bottom: 4px;
}

.gda-card-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gda-card-price {
    font-size: 24px;
    font-weight: 400;
    color: #333;
    line-height: 1.2;
}

.gda-card-discount {
    font-size: 14px;
    font-weight: 600;
    color: #00a650;
}

.gda-card-installments {
    font-size: 14px;
    color: #333;
    display: block;
    margin-top: 4px;
}

/* Extras */
.gda-card-extra-discount {
    display: inline-block;
    font-size: 12px;
    color: #00a650;
    margin-top: 8px;
}

.gda-card-extra-info {
    display: block;
    font-size: 12px;
    color: #00a650;
    margin-top: 4px;
}

/* Botão */
.gda-card-button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    text-decoration: none;
    background-color: #3483fa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    margin-top: auto;
}

.gda-card-button:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

.gda-card-button:active {
    transform: scale(0.98);
}

/* ==========================================================================
   SINGLE OFERTA
   ========================================================================== */

.gda-single-oferta {
    margin: 0;
}

.gda-single-price-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.gda-single-price-original {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    display: block;
    margin-bottom: 4px;
}

.gda-single-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gda-single-price {
    font-size: 36px;
    font-weight: 300;
    color: #333;
    line-height: 1.2;
}

.gda-single-discount {
    font-size: 18px;
    font-weight: 600;
    color: #00a650;
}

.gda-single-installments {
    font-size: 18px;
    color: #333;
    display: block;
    margin-top: 8px;
}

.gda-single-extra-discount {
    display: inline-block;
    font-size: 14px;
    color: #00a650;
    margin-top: 12px;
    padding: 4px 8px;
    background: #e6f7ec;
    border-radius: 4px;
}

.gda-single-extra-info {
    display: block;
    font-size: 14px;
    color: #00a650;
    margin-top: 8px;
}

.gda-single-validity {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.gda-single-content {
    margin-bottom: 24px;
}

/* CTA Button */
.gda-single-cta {
    text-align: center;
    margin: 32px 0;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gda-single-button {
    display: inline-block;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background-color: #3483fa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.gda-single-button:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.gda-single-button:active {
    transform: scale(0.98);
}

.gda-single-seller {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}

/* Disclaimer */
.gda-single-disclaimer {
    margin-top: 32px;
    padding: 16px;
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    border-radius: 0 4px 4px 0;
}

.gda-single-disclaimer p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 768px) {
    .gda-ofertas-titulo {
        font-size: 18px;
    }
    
    .gda-card-content {
        padding: 10px 12px 14px;
    }
    
    .gda-card-title {
        font-size: 13px;
        min-height: 36px;
    }
    
    .gda-card-price {
        font-size: 20px;
    }
    
    .gda-card-discount {
        font-size: 12px;
    }
    
    .gda-card-installments {
        font-size: 12px;
    }
    
    .gda-card-button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .gda-single-price {
        font-size: 28px;
    }
    
    .gda-single-discount {
        font-size: 16px;
    }
    
    .gda-single-button {
        display: block;
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* ==========================================================================
   CORES PERSONALIZADAS (via inline style)
   ========================================================================== */

/* As cores são aplicadas via inline style no PHP */

/* ==========================================================================
   ANIMAÇÕES
   ========================================================================== */

@keyframes gdaPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.gda-card-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 131, 250, 0.3);
}

/* ==========================================================================
   DARK MODE SUPPORT
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Caso o tema suporte dark mode */
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .gda-card-button,
    .gda-single-button {
        display: none;
    }
    
    .gda-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
