@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #FFC700;
    --text-main: #111;
    --text-muted: #666;
    --bg-light: #f9f9f9;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

.dp-widget * {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

.dp-widget h2,
.dp-widget h3 {
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

.dp-widget {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Header Section */
.dp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.dp-header-text h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

.dp-header-text p {
    color: var(--text-muted);
    margin: 5px 0 0 0;
}

.dp-nav-btns {
    display: flex;
    gap: 8px;
}

.dp-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 24px;
    padding: 5px;
    transition: transform 0.2s;
}

.dp-nav-btn:hover {
    transform: scale(1.1);
}

/* Trending Companies Carousel */
.dp-trending-wrapper {
    position: relative;
    overflow-x: auto;
    display: flex;
    gap: 20px;
    padding: 10px 5px 25px 5px;
    scrollbar-width: none;
    /* Firefox */
}

.dp-trending-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.dp-company-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
    gap: 12px;
    border: 1px solid #f2f2f2;
    min-width: 300px;
    /* Largura mínima para layout horizontal */
    width: calc(33.333% - 14px);
    height: auto;
    /* Altura automática */
    flex-shrink: 0;
    color: inherit;
    cursor: pointer;
}

.dp-company-card:active {
    transform: scale(0.98);
}

.dp-company-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dp-company-logo {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    object-fit: cover;
    background: #f8f9fa;
    flex-shrink: 0;
    border: 1px solid #eaeaea;
}

/* Fallback se não tiver imagem (usar via JS class) */
.dp-company-logo-fallback {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    background: #ffffff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eaeaea;
    padding: 5px;
    font-size: 24px;
    font-weight: bold;
    color: #6c757d;
}

.dp-company-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Alinhamento à esquerda */
}

.dp-company-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    width: 100%;
    text-align: left;
}

.dp-company-category {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 3px 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
}

.dp-company-rating {
    font-size: 0.8rem;
    color: #ffb81c;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dp-company-rating .rating-count {
    color: #6c757d;
    font-weight: 400;
    font-size: 0.75rem;
}

.dp-company-status {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 10px;
}

.dp-company-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Status Colors */
.dp-company-status.open {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.dp-company-status.open .dot {
    background-color: #28a745;
}

.dp-company-status.closed {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.dp-company-status.closed .dot {
    background-color: #dc3545;
}

/* Product Grid */
.dp-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.dp-product-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    height: 100%;
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
}

.dp-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 199, 0, 0.3);
}

.dp-product-card:active {
    transform: scale(0.98);
}

.dp-product-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 11;
    flex-shrink: 0;
    overflow: hidden;
    background: #f8f8f8;
}

.dp-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.dp-product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    text-align: left;
}

/* New Elements */
.dp-store-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.dp-store-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(255, 199, 0, 0.1);
    border: 1px solid rgba(255, 199, 0, 0.4);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.dp-discount-badge-compact {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    z-index: 3;
}

.dp-product-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

.dp-product-prices-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.dp-price-old {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.dp-price-new {
    font-size: 18px;
    font-weight: 800;
    color: #10b981;
}

.dp-status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 3;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dp-status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.dp-status-open {
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #166534;
    background-color: rgba(255, 255, 255, 0.9);
}

.dp-status-open .dot {
    background-color: #22c55e;
    animation: dp-pulse-open 2s infinite;
}

.dp-status-closed {
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ffffff;
    background-color: #ef4444;
}

.dp-status-closed .dot {
    background-color: #ffffff;
}

@keyframes dp-pulse-open {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Section Headers */
.dp-section-header {
    margin-top: 50px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

/* Fix for when this is the first element (e.g. only Best Sellers selected) */
.dp-widget > .dp-section-header:first-child {
    margin-top: 0;
}

.dp-section-header .dp-header-text h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .dp-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .dp-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .dp-company-card {
        min-width: 260px;
    }

    .dp-header-text h2, .dp-section-header .dp-header-text h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .dp-product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dp-product-card {
        flex-direction: row;
        height: 140px;
        align-items: stretch;
    }

    .dp-product-img-wrapper {
        width: 130px;
        height: 100%;
        aspect-ratio: auto;
    }

    .dp-status-badge {
        top: 8px;
        left: 8px;
        padding: 3px 8px;
        font-size: 10px;
    }

    .dp-product-info {
        padding: 12px;
        gap: 4px;
        justify-content: center;
    }

    .dp-store-name {
        font-size: 10px;
        padding: 2px 8px;
    }

    .dp-product-name {
        font-size: 13px;
        height: auto;
        -webkit-line-clamp: 2;
    }

    .dp-price-new {
        font-size: 16px;
    }

    .dp-discount-badge-compact {
        top: auto;
        bottom: 8px;
        right: 8px;
        padding: 2px 6px;
        font-size: 10px;
    }
}
