/* ============================================
   WC PDF por Medida – Frontend Styles v1.1
   Layouts: vertical | horizontal | grid
   ============================================ */

.wcpm-downloads {
    margin: 20px 0;
    padding: 0;
}

.wcpm-downloads-title {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

/* ── Layout: Vertical (default) ─────────── */
.wcpm-downloads-list,
.wcpm-layout-vertical .wcpm-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Layout: Horizontal ─────────────────── */
.wcpm-layout-horizontal .wcpm-downloads-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.wcpm-layout-horizontal .wcpm-download-item {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 320px;
}

/* ── Layout: Grid ───────────────────────── */
.wcpm-layout-grid .wcpm-downloads-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.wcpm-layout-grid .wcpm-download-item {
    flex-direction: column;
    text-align: center;
    padding: 16px 12px;
}

.wcpm-layout-grid .wcpm-download-icon {
    margin-bottom: 8px;
}

.wcpm-layout-grid .wcpm-download-info {
    align-items: center;
}

/* ── Estilos base de cada item ──────────── */
.wcpm-download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.wcpm-download-item:hover {
    background: #edf2f7;
    border-color: #b0b5ba;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.wcpm-download-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #d63638;
    color: #fff;
    flex-shrink: 0;
}

.wcpm-download-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wcpm-download-info strong {
    font-size: 14px;
    color: #1e1e1e;
}

.wcpm-download-info small {
    font-size: 12px;
    color: #757575;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Fallback injected ──────────────────── */
.wcpm-injected-fallback {
    margin: 20px 0;
    clear: both;
}

/* ── Responsive ─────────────────────────── */
@media screen and (max-width: 600px) {
    .wcpm-download-item {
        padding: 10px 12px;
    }

    .wcpm-layout-horizontal .wcpm-download-item {
        min-width: 100%;
        max-width: 100%;
    }

    .wcpm-layout-grid .wcpm-downloads-list {
        grid-template-columns: 1fr;
    }
}

/* ── Elementor editor placeholder ───────── */
.elementor-editor-active .wcpm-downloads:empty::after {
    content: "📄 PDFs por Medida – Añade PDFs desde el panel de WooCommerce";
    display: block;
    padding: 20px;
    background: #f0f6fc;
    border: 2px dashed #2271b1;
    border-radius: 8px;
    text-align: center;
    color: #2271b1;
    font-size: 13px;
}
