<div class="accordion accordion-bordered mt-3" id="accordionLibro">
    <div class="card accordion-item active">
        <h2 class="accordion-header" id="headingLibroDatos">
            <button type="button" class="accordion-button" data-bs-toggle="collapse"
                data-bs-target="#collapseLibroDatos" aria-expanded="true" aria-controls="collapseLibroDatos">
                <h5 class="mb-0"><?= lang("Catalogo.datosGenerales") ?? 'Datos generales del libro' ?></h5>
            </button>
        </h2>

        <div id="collapseLibroDatos" class="accordion-collapse collapse show" data-bs-parent="#accordionLibro">
            <div class="accordion-body">

                <div class="row">
                    <!-- COLUMNA IZQUIERDA: Imagen -->
                    <div class="col-md-12 col-lg-2 px-4 d-flex flex-column justify-content-center align-items-center"
                        style="min-height: 100%;">
                        <div class="mb-3 text-center w-100">
                            <?php if (!empty($catalogoLibrosEntity->cubierta_url)): ?>
                                <img src="<?= esc($catalogoLibrosEntity->cubierta_url) ?>" class="img-fluid mb-2"
                                    alt="Portada">
                            <?php else: ?>
                                <img src="https://static.cegal.es/imagenes/marcadas/9788415/978841f45711.gif" class="img-fluid mb-2"
                                    alt="Sin portada">
                            <?php endif; ?>                            
                        </div>
                    </div>


                    <!-- COLUMNA DERECHA: Datos -->
                    <div class="col-md-12 col-lg-10 px-4">
                        <div class="row">
                            <div class="col-md-4 mb-3">
                                <label for="cliente_id" class="form-label">Cliente *</label>
                                <select id="cliente_id" name="cliente_id" class="form-select select2bs5">
                                    <option value="<?= $catalogoLibrosEntity->cliente_id ?>" selected>
                                        <?= $catalogoLibrosEntity->clienteName ?>
                                    </option>
                                </select>
                            </div>

                            <div class="col-md-8 mb-3">
                                <label for="titulo" class="form-label">Título *</label>
                                <input type="text" id="titulo" name="titulo" class="form-control"
                                    value="<?= old('titulo', $catalogoLibrosEntity->titulo) ?>" required
                                    maxlength="300">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="autor" class="form-label">Autor</label>
                                <input type="text" id="autor" name="autor" class="form-control"
                                    value="<?= old('autor', $catalogoLibrosEntity->autor) ?>" maxlength="255">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="coleccion" class="form-label">Colección</label>
                                <input type="text" id="coleccion" name="coleccion" class="form-control"
                                    value="<?= old('coleccion', $catalogoLibrosEntity->coleccion) ?>" maxlength="255">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="editorial" class="form-label">Editorial</label>
                                <input type="text" id="editorial" name="editorial" class="form-control"
                                    value="<?= old('editorial', $catalogoLibrosEntity->editorial) ?>" maxlength="255">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="sello" class="form-label">Sello</label>
                                <input type="text" id="sello" name="sello" class="form-control"
                                    value="<?= old('sello', $catalogoLibrosEntity->sello) ?>" maxlength="255">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="isk" class="form-label">Identificador ISK</label>
                                <input type="text" id="isk" name="isk" class="form-control" readonly
                                    value="<?= old('isk', $catalogoLibrosEntity->isk) ?>" maxlength="64"
                                    style="background: #E8E8E8;">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="isbn" class="form-label">ISBN *</label>
                                <input type="text" id="isbn" name="isbn" class="form-control"
                                    value="<?= old('isbn', $catalogoLibrosEntity->isbn) ?>" maxlength="255">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="num_edic" class="form-label">Edición</label>
                                <input type="number" id="num_edic" name="num_edic" class="form-control"
                                    value="<?= old('num_edic', $catalogoLibrosEntity->num_edic ?? 1) ?>">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="ean" class="form-label">EAN</label>
                                <input type="text" id="ean" name="ean" class="form-control" readonly
                                    style="background: #E8E8E8;" value="<?= old('ean', $catalogoLibrosEntity->ean) ?>">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="ubicacion" class="form-label">Ubicación</label>
                                <input type="text" id="ubicacion" name="ubicacion" class="form-control"
                                    value="<?= old('ubicacion', $catalogoLibrosEntity->ubicacion) ?>">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="ancho" class="form-label">Ancho *</label>
                                <input type="number" step="0.01" id="ancho" name="ancho" class="form-control"
                                    value="<?= old('ancho', $catalogoLibrosEntity->ancho) ?>">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="alto" class="form-label">Alto *</label>
                                <input type="number" step="0.01" id="alto" name="alto" class="form-control"
                                    value="<?= old('alto', $catalogoLibrosEntity->alto) ?>">
                            </div>

                            <div class="col-md-3 mb-3">
                                <label for="paginas" class="form-label">Nº Páginas *</label>
                                <input type="number" id="paginas" name="paginas" class="form-control"
                                    value="<?= old('paginas', $catalogoLibrosEntity->paginas) ?>">
                            </div>
                        </div>
                    </div>
                </div> <!-- //.row -->

            </div> <!-- //.accordion-body -->
        </div> <!-- //.collapse -->
    </div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->