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

:root {
    --brand-primary: #783132;
    --brand-primary-dark: #5a231f;
}

/* =================================================================
   GENERAL
   ================================================================= */

.container {
    max-width: 1050px;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    background-color: #fff;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1em;
    margin: 0 0 18px;
    font-weight: 600;
}

h1 {
    font-size: 2.5em;
    line-height: 1.4em;
    margin-bottom: 28px;
    margin-top: 0;
}

h2 { font-size: 30px; }
h3 { font-size: 16px; }
h4 { font-size: 15px; }
h5 { font-size: 14px; }
h6 { font-size: 13px; }

p {
    font-size: 13px;
    line-height: 1.55em;
}

a {
    color: var(--brand-primary);
}

a:hover {
    color: var(--brand-primary-dark);
}


a, .btn {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

section {
    margin-bottom: 40px;
}

.price {
    color: var(--brand-primary);
}

.badge-info, .label-info {
    background-color: var(--brand-primary);
}

.noUi-connect {
    background: var(--brand-primary) !important;
}

/* título con línea decorativa */
.title-line {
    display: flex;
    align-items: center;
    gap: 16px;
}

.title-line::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #c1c1c6;
}

/* títulos de sección con línea */
h2,
.home-featured-books h2,
.book-section h2,
.dynamicbooks-section h2,
.text-section h2,
.author-section h2 {
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 600;
}

.home-featured-books h2::after,
.book-section h2::after,
.dynamicbooks-section h2::after,
.text-section h2::after,
.author-section h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #c1c1c6;
}

/* botones */
.btn,
.btn:focus,
.btn:active,
.btn.active,
.btn.disabled,
.btn[disabled] {
    background-color: var(--brand-primary) !important;
    background: var(--brand-primary) !important;
    border: 1px solid var(--brand-primary) !important;
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary-dark) !important;
    color: #fff;
}

.btn i {
    margin-right: 10px;
    font-size: 16px !important;
}

.btn.btn-secondary,
.btn.btn-secondary:focus,
.btn.btn-secondary:active {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #676767 !important;
    font-size: 14px !important;
    padding: 8px 14px !important;
}

.btn.btn-secondary:hover {
    color: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary-dark) !important;
}


/* =================================================================
   HEADER
   ================================================================= */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top.hidden-phone {
    background-color: var(--brand-primary);
}

.header-top-nav > li a i {
    color: #fff;
}

.header-middle {
    background-color: #47474a;
    padding: 16px 0;
}

.header-middle li a {
    color: var(--brand-primary-dark);
}

.header-middle li a:hover {
    color: var(--brand-primary);
}

.header-middle .slogan h2 {
    color: #CCC;
    margin-top: 20px;
}

.header-middle-wrapper {
    align-items: center !important;
}

.header-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.header-row > [class*="span"] {
    float: none !important;
}

.header-right {
    justify-content: flex-end;
}

.image-logo {
    height: 60px;
    width: auto;
}

/* buscador */
.header-center {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.form-search-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.form-search {
    flex: 1;
    margin: 0;
}

.search-input-container {
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    display: flex;
    position: relative;
    width: 100%;
}

.search-input-container input,
#searchform input {
    width: 100%;
    height: 42px;
    padding: 0 12px !important;
    font-size: 14px;
    box-sizing: border-box;
    background: transparent !important;
    border: none !important;
    color: #fff;
    outline: none;
    box-shadow: none !important;
    margin-top: 0 !important;
    border-radius: 0 !important;
}

.search-input-container input::placeholder {
    color: #e5e5e5;
}

.btntwo {
    padding: 0 18px;
    border: 0;
    font-size: 1em;
    background: none;
    color: #e5e5e5;
    transition: color 0.3s ease;
}

.btntwo:hover {
    text-decoration: none;
    color: #fff;
}

.btntwo.search {
    position: relative;
}

.btntwo.search::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    border-left: 1px solid #e5e5e5;
}

.form-search input,
.enlace-busqueda-avanzada {
    height: 42px;
    line-height: 42px;
}

.enlace-busqueda-avanzada {
    margin: 0 0 0 20px;
    color: #e5e5e5;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 14px !important;
}

.enlace-busqueda-avanzada:hover {
    color: #fff !important;
    transform: translate(8px);
}

.enlace-busqueda-avanzada span {
    display: inline-block;
    font-size: 10px;
    margin-right: 5px;
}

/* iconos de navegación en header-right */
.header-top-nav > li a {
    color: #fff;
    font-size: 18px !important;
    padding: 0 10px;
    border-left: none !important;
}

.header-top-nav > li a:hover {
    color: rgba(255, 255, 255, 0.7);
}

.header-top-nav i.fa.fa-shopping-cart {
    font-size: 18px !important;
}

/* minicart */
.minicart-items {
    bottom: auto !important;
    top: -8px !important;
    left: 24px !important;
    background-color: var(--brand-primary) !important;
    width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
}

.minicart-txt,
.minicart-total {
    color: #e5e5e5;
}

/* menú de navegación */
.nav > ul > li {
    margin: 0 4px 0 32px;
    font-size: 0.9em;
    list-style-type: square;
    color: #ccc;
}

.nav-list > li > a,
.nav-list > li > a:hover,
.nav-list > li > a:focus {
    color: var(--brand-primary);
    font-weight: bold;
}

.author-name,
.author-bio {
    color: #333333;
}

li.author a:hover .author-name {
    color: var(--brand-primary);
}

/* header-bottom */
.header-bottom {
    background-color: #FFF;
    border-top: 1px solid #E8E8E8;
}

.main-menu {
    margin: 0;
    width: 100%;
}

.main-menu .nav {
    margin-bottom: 0;
    display: flex !important;
    justify-content: space-between;
}

.nav-tabs > li,
.nav-pills > li {
    padding: 0 10px;
}

.nav-pills > li > a {
    color: #333;
    padding: 23px 0 20px;
    border-right: none !important;
    font-size: 16px;
    font-weight: 500;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
    border-bottom: 3px solid #FFF;
    -webkit-transition: border-bottom-color 500ms ease-out;
    -moz-transition: border-bottom-color 500ms ease-out;
    transition: border-bottom-color 500ms ease-out;
    margin: 0;
}

.main-menu .nav > li > a:hover,
.main-menu .nav > li > a:focus,
.main-menu .nav > li > a.selected {
    background-color: rgba(0, 0, 0, 0);
    color: inherit;
    border-bottom-style: solid;
    border-bottom-width: 3px;
    border-bottom-color: var(--brand-primary) !important;
}


/* =================================================================
   SLIDER
   ================================================================= */

.slider-wrapper,
.slider-wrapper.container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: hidden;
    margin-top: -46px !important;
    margin-bottom: 70px !important;
}

.slider-wrapper img,
.slider-wrapper .wrapper-img img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}


/* =================================================================
   CARRUSEL Y FICHAS DE LIBRO
   ================================================================= */

.content-slider .carrusel-book {
    height: 100%;
}

.content-slider .carrusel-book > a,
.showcase .books .book > a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* portadas */
.book-cover {
    padding: 0 !important;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a:hover .book-cover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

a:hover .book-title {
    color: var(--brand-primary);
}

.books .book .book-cover {
    width: 100%;
    max-width: 150px;
    min-height: 206px !important;
    max-height: 215px !important;
}

.showcase .book-cover {
    max-width: 156px;
}

.two-cols .three-cols .book-cover {
    width: 100% !important;
    min-height: 206px !important;
    max-height: 215px !important;
}

.content-slider .book-cover {
    float: none;
    max-width: 158px;
    min-height: 206px !important;
    max-height: 215px !important;
}

/* info del libro */
.content-slider .book-info,
.showcase .books .book .book-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.content-slider .book-info form,
.showcase .books .book .book-info form {
    margin-top: auto;
}

.content-slider .book-info-meta,
.showcase .books .book .book-info-meta {
    min-height: 95px;
}

.book-title {
    font-size: 16px;
    line-height: 1.3;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.content-slider .book-title,
.showcase .books .book .book-title {
    margin: 0 0 6px;
    line-height: 1.3;
    font-size: 15px;
}

.book-title a {
    color: #333 !important;
}

.book-title a:hover {
    color: var(--brand-primary) !important;
    text-decoration: none !important;
}

.content-slider .book-author,
.showcase .books .book .book-author {
    margin: 0;
    line-height: 1.4;
}

.book-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
}

.book-actions-row {
    display: flex;
    gap: 1em;
    margin-bottom: 30px;
    width: 100%;
}

.book-actions-row form {
    width: 100%;
}

/* flechas del carrusel */
.carrusel-wrapper {
    position: relative;
}

.lSPrev, .lSNext {
    display: none !important;
}

.content-slider {
    margin-left: 18px;
}

.goToPrevSlide,
.goToNextSlide {
    background-color: transparent;
    border: none;
    font-size: 60px;
    position: absolute;
    top: 32%;
    left: -40px;
    color: #999;
    width: auto;
    transition: color 0.3s ease, transform 0.3s ease;
}

.goToNextSlide {
    right: -40px !important;
    left: auto;
}

.goToPrevSlide:hover,
.goToNextSlide:hover {
    color: #49494b;
}

.goToNextSlide:hover {
    transform: translateX(5px);
}

.goToPrevSlide:hover {
    transform: translateX(-5px);
}

.lightSlider {
    height: auto !important;
}

.content-slider .lslide {
    padding-top: 12px;
}


/* =================================================================
   FOOTER
   ================================================================= */

.footer-top {
    background-color: #49494f;
    margin-bottom: 0;
    margin-top: 120px;
    padding: 35px 0;
}

.footer-top h5 {
    color: #fff;
}

.footer-blocks {
    color: #fff;
    font-size: 14px;
}

.footer-blocks a {
    color: #dbdbdb;
}

.footer-blocks a:hover {
    color: #fff !important;
    text-decoration: none;
}

.footer-blocks i {
    margin-left: 2px;
    margin-right: 10px;
    width: 12px;
    color: #fff;
}

.footer-blocks .separator {
    width: 100%;
    height: 1px;
    background-color: #cbcbd1;
    margin: 1.5em 0;
}

.footer-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 70%;
    margin: 1.2em auto;
    padding: 0;
    list-style: none;
}

.footer-menu li {
    margin: 0;
    padding: 0;
}

.footer-menu a {
    color: #dbdbdb;
    text-decoration: none;
}

.footer-menu a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 3em;
    padding: 0;
    list-style: none;
}

.footer-logos li {
    margin: 0;
    padding: 0;
}

.footer-logos li a {
    color: #fff !important;
}

.footer-logos li a {
    transition: opacity 0.3s ease;
}

.footer-logos li a:hover {
    opacity: 0.5;
}

.footer-logo {
    display: block;
    max-height: 50px;
}

.nav-footer {
    list-style: none;
}

.nav-footer li {
    float: left;
}

.nav-footer li a {
    color: #fff;
    font-size: 12px;
    padding: 0 7px;
}

.nav-footer li a:hover {
    opacity: 0.5;
    text-decoration: none;
}

.footer-info {
    font-size: 12px;
    float: left;
    margin-top: 3px;
}


/* =================================================================
   CATÁLOGO
   ================================================================= */

/* sidebar */
.secondary-nav {
    padding-top: 6px;
    position: sticky;
    top: 160px;
}

.secondary-nav h3,
.nav-list .filter-group .nav-list-title h3 {
    background-color: transparent;
    border-bottom: 1px solid #c1c1c6 !important;
    border-radius: 0;
    color: #333;
    font-size: 13px;
    margin-top: 0 !important;
    margin-bottom: 8px;
    margin-left: 0;
    padding: 0 0 6px 0;
    font-weight: 700;
    text-transform: none;
}

.secondary-nav h3::after {
    display: none !important;
}

.secondary-nav .nav-list li a {
    color: #49494b;
    font-weight: 500;
    font-size: 12px;
}

.secondary-nav .nav-list li a:hover {
    color: var(--brand-primary);
}

.nav-list .filter-group {
    border: 1px solid #c1c1c6;
    border-radius: 3px;
    padding: 8px;
    margin-bottom: 20px;
    list-style: none;
}

.nav-list .filter-group > ul {
    margin-left: 7px;
    padding: 0;
    list-style: none;
}

.nav-list .filter-group .nav-list-title h3 {
    border-bottom: none;
    margin-bottom: 6px;
}

/* listado de libros */
.catalog-list .books .book .book-info,
.showcase-content .book-section .books .book .book-info {
    display: flex;
    flex-direction: column;
}

/* Portada a la izquierda, info a la derecha (igual que catálogo), solo en showcase */
.showcase-content .book-section .books .book > a {
    display: block !important;
    flex-direction: unset !important;
}

.showcase-content .book-section .books .book > a::after,
.showcase-content .book-section .books .book::after {
    content: "";
    display: block;
    clear: both;
}

.catalog-list .books .book .book-cover,
.showcase-content .book-section .books .book .book-cover {
    float: left;
    margin-right: 14px;
    width: 150px !important;
    max-width: 150px !important;
}



/* =================================================================
   BÚSQUEDA AVANZADA
   ================================================================= */

.page-buscador-avanzado h1,
#advanced-search-form h1 {
    text-align: center;
    margin-bottom: 30px;
}

.form-box {
    position: relative;
    margin: 0 auto 28px;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    padding: 30px 38px 30px 36px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.form-control {
    height: 50px !important;
    padding: 6px 12px !important;
    border-radius: 0;
}

.form-box .row-fluid {
    margin-bottom: 16px;
}

.search-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.btn-advanced-search {
    font-size: 12px;
    padding: 10px 20px;
}

.btn-advanced-search i {
    margin-right: 5px;
    font-size: 13px;
}

/* =================================================================
   CATÁLOGO (listado)
   ================================================================= */

.catalog-list .book-actions-row {
    width: 80%;
}

.book-list-subtitle {
    font-size: 11px;
    color: #666;
    margin: 2px 0 4px;
    line-height: 1.3em;
}

/* =================================================================
   PÁGINA DE LIBRO
   ================================================================= */

.book-detail .wrapper-book-images {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-detail .wrapper-book-images::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 100%;
    aspect-ratio: 1;
    background: #efefef;
    border-radius: 50%;
    z-index: -1;
    transition: all 0.3s ease;
}

.book-detail .wrapper-book-images:hover::before {
    transform: scale(1.1);
}

.book-detail .wrapper-book-images > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.book-detail .book-detail-cover {
    display: block;
    width: 80%;
    max-width: 280px;
    margin: 0 auto 6px !important;
}



.book-detail > .span8 {
    padding-left: 40px;
}

.book-detail h1.book-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 0;
    line-height: 1.3em;
    color: inherit;
    overflow: visible;
    display: block !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: horizontal !important;
}

.book-detail h2.book-author {
    font-size: 12px;
    margin-bottom: 14px;
    margin-top: 0;
}

.book-detail h2.book-author a {
    color: #666;
    text-decoration: none;
}

.book-detail h2.book-author a:hover {
    color: var(--brand-primary);
}

.book-detail h3 {
    margin-bottom: 18px;
    text-transform: uppercase;
    clear: both;
    color: #343433;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: 25px;
}

.book-detail .book-synopsis {
    line-height: 1.45em;
    margin-top: 5px;
    font-size: 14px;
    margin-bottom: 20px;
    overflow: hidden;
}

.book-detail .separator {
    height: 1px;
    background-color: #ddd;
    margin: 20px 0;
}

.book-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
}

.box-price {
    margin-top: 10px;
}

.price {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 6px;
}

.book-detail .social-networks-share ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.book-detail .social-networks-share li {
    margin: 0;
}

.book-detail .social-networks-share a {
    color: #555;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.book-detail .social-networks-share a:hover {
    color: var(--brand-primary);
}

.read-more-inline {
    color: var(--brand-primary);
    cursor: pointer;
    font-weight: 600;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 14px;
}

.book-actions {
    border: none;
    margin-top: 20px;
    margin-bottom: 32px;
    background: none;
    padding: 0;
}

.book-actions-row {
    display: flex;
    gap: 1em;
    margin-bottom: 30px;
    width: 100%;
}

.book-buy .book-actions-row form,
.book-buy .book-actions-row .btn-secondary {
    width: 50%;
}

.book-definitions {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    font-size: 12px;
    padding-left: 3px;
}

.book-definitions .col-left,
.book-definitions .col-right {
    flex: 1 1 0;
}

.book-definitions dl {
    margin: 6px 0 0;
}

.book-definitions dt {
    font-weight: 600;
    color: #333;
    width: 48%;
    clear: both;
    float: left;
    line-height: 1em;
    padding: 1px 0 2px 1px;
}

.book-definitions dd {
    margin: 0 0 8px 0;
    color: #555;
    width: 51%;
    float: left;
    line-height: 1em;
    padding: 1px 0 2px 1px;
}

.book-definitions dd ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.book-detail .authors {
    font-size: 14px !important;
    margin-top: 0;
}

.book-detail .authors li {
    border-bottom: none;
    font-size: 14px !important;
}

.book-detail .author-face {
    border: none;
    border-radius: 50%;
}

.book-detail .author-bio {
    font-size: 14px;
}


/* =================================================================
   CESTA
   ================================================================= */

.badge, .label, .table th {
    font-weight: 600;
}

.table-cart-wrapper {
    padding: 16px 16px 0 12px;
    background-color: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.table-cart {
    border: none !important;
}

.table-cart thead th,
.table-cart thead td {
    border: none !important;
    padding: 20px 12px 16px 12px;
    font-size: 14px;
}

.table-cart tbody td {
    border-top: 1px solid #EAEAEA !important;
    border-left: none !important;
    border-right: none !important;
    padding: 20px 12px 16px 12px;
    font-size: 14px;
}

.table-cart .book-cover {
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.3);
    margin-left: 12px;
    margin-bottom: 0;
}

.table-cart .book-cover:hover {
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.3);
}

.cart-title {
    font-weight: bold;
    font-size: 14.5px;
}

.cart-isbn {
    color: #999;
    font-size: 13px;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.cart-actions .btn-secondary {
    border: none !important;
    font-weight: 400;
    transition: transform 0.3s ease, color 0.3s ease !important;
}

.cart-back-chevron {
    font-size: 20px;
    line-height: 1;
    margin-right: 4px;
}

.cart-actions .btn-secondary:hover {
    transform: translateX(-8px);
}

.cart-line-total td {
    font-size: 18px;
    font-weight: bold;
    border-top: none;
    padding-top: 10px;
}

.btn-cart-minus, .btn-cart-plus {
    color: inherit;
    background-color: #fff;
    border: none;
    float: left;
    padding: 1px 3px;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
}

.btn-cart-minus {
    margin-left: 6px;
}

.btn-cart-remove {
    font-size: 11px;
    text-align: center;
}

.cart-quantity {
    display: block;
    float: left;
    margin-bottom: 5px;
    padding: 0 4px;
    text-align: center;
    width: 24px;
    font-size: 13px;
    border: none;
    background-color: #fff;
}

.mobile-cart {
    display: none;
    border: none !important;
}

.btn-cart-tablet {
    display: none;
}

.btn-cart-mobile {
    display: none;
}

.order-book-detail {
    display: flex;
    min-width: 212px;
}

.order-book-box {
    margin-bottom: 15px;
}

.order-book-section {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 1100px) {
    body {
        padding-top: 0 !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

    /* Mostrar filtros del sidebar en tablet (collapse los oculta en móvil) */
    .secondary-nav .nav.nav-list.collapse {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Portada más pequeña en tablet */
    .showcase-content .book-section .books .book .book-cover,
    .catalog-list .books .book .book-cover {
        width: 115px !important;
        max-width: 115px !important;
        min-height: 0 !important;
    }

    /* Forzar layout de 2 columnas con float en showcase */
    .showcase-content .book-section .books .book {
        display: block !important;
        float: left !important;
        width: 48% !important;
        margin-left: 2% !important;
        box-sizing: border-box;
    }
    .showcase-content .book-section .books .book:nth-child(2n+1) {
        margin-left: 0 !important;
        clear: left;
    }

    /* Header: reducir padding y tamaño del logo */
    .header-middle {
        padding: 10px 0;
    }
    .image-logo {
        height: 46px;
    }

    /* Buscador: reducir margen */
    .enlace-busqueda-avanzada {
        display: none;
    }

    /* Menú principal: reducir tamaño de fuente */
    .nav-pills > li > a {
        font-size: 13px;
        padding: 18px 0 16px;
    }
    .nav-tabs > li,
    .nav-pills > li {
        padding: 0 6px;
    }

    /* Slider: menos margen negativo */
    .slider-wrapper,
    .slider-wrapper.container {
        margin-top: -20px !important;
        margin-bottom: 40px !important;
    }

    /* Footer menu: más ancho en tablet */
    .footer-menu {
        width: 90%;
    }

    /* Sección de libros: 3 columnas en tablet en lugar de 4 */
    .book-section .books .book,
    .dynamicbooks-section .books .book {
        width: 30% !important;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 0 !important;
    }

    /* Ficha de libro: forzar imagen arriba y texto debajo, en bloque simple */
    .book-detail {
        display: flex !important;
        flex-direction: column !important;
    }
    .book-detail > .span4,
    .book-detail > .span8 {
        float: none !important;
        width: 100% !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
        order: initial;
    }
    .book-detail > .span4 {
        display: flex !important;
        justify-content: center;
        order: 1;
    }
    .book-detail > .span8 {
        order: 2;
    }

    /* Botones de compra en móvil: apilados a ancho completo */
    .book-actions-row {
        flex-direction: column;
    }
    .book-buy .book-actions-row form,
    .book-buy .book-actions-row .btn-secondary {
        width: 100%;
    }

    /* Definiciones del libro en móvil: etiqueta y valor a ancho completo */
    .book-definitions dt,
    .book-definitions dd {
        width: 100%;
        float: none;
        clear: none;
    }

    header {
        position: relative !important;
    }
    .page-wrapper {
        padding: 0 10px !important;
    }
    footer, header, .header-top, .footer-logos, .header-bottom, .footer-top {
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        padding-left: 24px;
        padding-right: 24px;
        box-sizing: border-box;
    }

    /* Footer en móvil */
    .footer-menu {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }

    /* Sección de texto con banner en móvil */
    .text-section .video-responsive > * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Sección de libros en móvil (showcases, home) */
    .book-section .books,
    .dynamicbooks-section .books {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        margin-left: 0 !important;
    }
    .book-section .books .book,
    .dynamicbooks-section .books .book {
        width: 45% !important;
        float: none !important;
        text-align: center;
        margin-bottom: 20px;
    }
    .showcase-content .book-section .books .book > a,
    .dynamicbooks-section .books .book > a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
    }
    .showcase-content .book-section .books .book .book-cover,
    .dynamicbooks-section .books .book .book-cover {
        float: none !important;
        margin-right: 0 !important;
        width: auto !important;
    }
    .book-section .books .book-meta-row,
    .book-section .books .book-actions-row,
    .dynamicbooks-section .books .book-meta-row,
    .dynamicbooks-section .books .book-actions-row {
        justify-content: center;
    }
    .book-section h2,
    .dynamicbooks-section h2,
    h1.title-line {
        justify-content: center;
    }
    .book-section h2::after,
    .dynamicbooks-section h2::after,
    h1.title-line::after {
        display: none;
    }

    /* Catálogo: 1 columna en móvil */
    .catalog-list .books {
        display: flex !important;
        flex-direction: column !important;
        margin-left: 0 !important;
    }
    .catalog-list .books .book {
        width: 100% !important;
        float: none !important;
        margin-bottom: 20px;
    }
    .catalog-list h1 {
        display: none;
    }
    /* secondary-nav: quitar sticky en móvil para evitar solapamiento */
    .secondary-nav {
        position: static !important;
        width: calc(100% + 20px) !important;
        margin-left: -10px !important;
        margin-right: -10px !important;
        box-sizing: border-box !important;
    }
    .secondary-nav a#more-links-toggle,
    .secondary-nav ul {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .secondary-nav a#more-links-toggle {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        max-width: 100%;
    }

    /* Carrusel de libros en móvil */
    .home-featured-books .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .home-featured-books h2 {
        margin-left: 0 !important;
        justify-content: center;
    }
    .home-featured-books h2::after {
        display: none;
    }

    /* Carrusel de libros en móvil: mismo carrusel, flechas dentro del viewport */
    .content-slider {
        margin-left: 0;
    }
    .content-slider .carrusel-book {
        text-align: center;
    }
    .content-slider .carrusel-book > a {
        align-items: center;
    }
    .content-slider .book-actions-row,
    .content-slider .book-meta-row {
        justify-content: center;
    }
    .goToPrevSlide,
    .goToNextSlide {
        font-size: 44px;
        top: 38%;
    }
    .goToPrevSlide {
        left: 0;
    }
    .goToNextSlide {
        right: 0 !important;
    }

    /* Slider en móvil */
    .slider-wrapper,
    .slider-wrapper.container {
        margin-top: 0 !important;
        margin-bottom: 20px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .goToNextSlide.arrowHeader {
        right: 20px !important;
    }
    .goToPrevSlide.arrowHeader {
        left: 20px !important;
    }

    /* Fondo gris del header hasta los bordes en móvil */
    header {
        background-color: #47474a;
    }

    /* Hamburguesa blanca */
    .btn_header .menu-bar {
        background-color: #fff;
    }

    /* Header móvil: hamburguesa izquierda, logo centrado, carrito/usuario derecha */
    .header-middle .header-row {
        position: relative;
        justify-content: center;
    }
    .header-middle .header-left {
        position: relative;
        width: 100% !important;
        text-align: center;
        padding-left: 50px;
        padding-right: 60px;
        box-sizing: border-box;
    }
    .header-middle #simple-menu {
        position: absolute !important;
        left: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
    .header-middle .logo {
        display: inline-block;
    }
    /* Ocultar buscador y enlace búsqueda avanzada en cabecera (va en el sidr) */
    .header-middle .header-center {
        display: none !important;
    }

    /* Carrito y usuario a la derecha, igual que en escritorio */
    .header-middle .header-right {
        display: block !important;
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: auto !important;
    }
    .header-middle .header-right .header-top-nav {
        margin: 0 !important;
        display: flex;
        align-items: center;
    }
    .header-middle .header-right .header-top-nav > li {
        margin: 0 0 0 8px !important;
    }
    .header-middle .header-right .header-top-nav > li a {
        padding: 0 4px !important;
    }
    /* solo icono + contador en el minicart, sin el precio total */
    .header-middle .header-right .minicart-total {
        display: none !important;
    }
    .header-middle .header-right .minicart {
        width: auto !important;
    }
    .mobile-cart {
        display: block !important;
    }
    .cart-desktop.table-cart-wrapper {
        display: none;
    }
    .btn-cart-tablet {
        display: block;
    }
    .ob-image-container .book-cover-cart {
        width: 53px !important;
        margin-right: 20px;
    }

    /* Buscador debajo del header en móvil */
    .header-search-mobile {
        background-color: #fff;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        padding: 10px 24px;
        box-sizing: border-box;
        border-bottom: 1px solid #e5e5e5;
    }
    .header-search-mobile .search-input-container {
        border: 1px solid #e5e5e5;
        border-radius: 5px;
        display: flex;
        align-items: center;
        background-color: transparent;
    }
    .header-search-mobile input {
        flex: 1;
        height: 40px;
        padding: 0 12px;
        border: none;
        outline: none;
        background: transparent;
        color: #333;
        font-size: 14px;
        box-sizing: border-box;
    }
    .header-search-mobile input::placeholder {
        color: #999;
    }
    .header-search-mobile .btntwo {
        padding: 0 14px;
        height: 40px;
        border: 0;
        background: var(--brand-primary);
        color: #fff;
        border-radius: 0 4px 4px 0;
    }
    .header-search-mobile .btntwo.search::before {
        display: none;
    }
}

@media (max-width: 387px) {
    .order-book-detail {
        min-width: 168px !important;
    }
    .btn-cart-tablet {
        display: none;
    }
    .btn-cart-mobile {
        display: block;
    }
    .ob-image-container .book-cover-cart {
        width: 25px !important;
        margin-right: 5px;
    }
}

/* =================================================================
   PERFIL DE USUARIO
   ================================================================= */

.user-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user-profile-header h1 {
    margin-bottom: 0;
}

/* =================================================================
   AUTOR
   ================================================================= */

.authors-menu a:hover,
.authors-menu span:hover {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.author-single .back-to-list {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--brand-primary);
    font-size: 13px;
    font-weight: 600;
}

.author-single .back-to-list:hover {
    color: var(--brand-primary-dark);
    text-decoration: none;
}

.author-related-books {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 100px;
}

.author-related-books::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #c1c1c6;
}

/* =================================================================
   RRSS
   ================================================================= */

.social-networks {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3em;
    padding: 0;
}

/* Formularios: focus en color corporativo */
.uneditable-input:focus,
input[type=text]:focus,
input[type=password]:focus,
input[type=datetime]:focus,
input[type=datetime-local]:focus,
input[type=date]:focus,
input[type=month]:focus,
input[type=time]:focus,
input[type=week]:focus,
input[type=number]:focus,
input[type=email]:focus,
input[type=url]:focus,
input[type=tel]:focus,
input[type=color]:focus,
input[type=search]:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-primary) !important;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(120,49,50,.4) !important;
}

/* Fecha de eventos */
.event-date {
    background-color: var(--brand-primary) !important;
}

/* Proceso de compra: pasos en color corporativo */
.shopping-steps.nav-pills > .active b,
.shopping-steps.nav-pills > li > a:hover b {
    background-color: var(--brand-primary) !important;
}

/* Botón aceptar cookies */
#cookie-message a#cookielaw_btn,
#cookie-message a#cookielaw_all_btn,
#cookie-message .message-close {
    background-color: var(--brand-primary) !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    color: #fff !important;
}

#cookie-message a#cookielaw_btn:hover,
#cookie-message a#cookielaw_all_btn:hover,
#cookie-message .message-close:hover {
    background-color: var(--brand-primary-dark) !important;
    color: #fff !important;
}

/* Igualar botones buscar y limpiar en búsqueda avanzada */
.btn-advanced-search {
    padding: 8px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    vertical-align: middle;
}

/* =================================================================
   LOGIN / REGISTRO
   ================================================================= */

.login-tabs-wrapper {
    max-width: 520px;
    margin: 40px auto 80px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.login-tabs-wrapper .nav-tabs {
    display: flex;
    border-bottom: none;
    margin-bottom: 0;
}

.login-tabs-wrapper .nav-tabs > li {
    flex: 1;
    float: none;
}

.login-tabs-wrapper .nav-tabs > li > a {
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
    background: #e5e5e5;
    border-radius: 0;
    border: none;
    margin-right: 0;
    padding: 16px 28px;
}

.login-tabs-wrapper .nav-tabs > li.active > a,
.login-tabs-wrapper .nav-tabs > li.active > a:hover {
    color: #000;
    border: none;
    background: #fff;
}

.login-tabs-wrapper .nav-tabs > li:not(.active) > a:hover {
    background: #dcdcdc;
    color: #333;
    border: none;
}

.login-tabs-wrapper .tab-content {
    border: none;
    padding: 32px 36px;
    background: #fff;
}

.login-tabs-wrapper legend {
    display: none;
}

.login-tabs-wrapper .btn-forgot-password {
    display: block;
    text-align: left;
    margin-bottom: 10px;
    font-size: 13px;
    color: #783132;
}

.login-tabs-wrapper .fields {
    margin-bottom: 10px;
}

.login-tabs-wrapper .form-group {
    margin-bottom: 22px !important;
}

.login-tabs-wrapper .form-control,
.login-tabs-wrapper .input-block-level {
    height: 48px !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
}

.login-tabs-wrapper button[type="submit"],
.login-tabs-wrapper .tab-pane a.btn {
    display: block;
    width: 100%;
    padding: 14px 0 !important;
    margin-top: 10px !important;
    font-size: 16px !important;
}

.login-tabs-wrapper #forgot-password {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-tabs-wrapper .register-intro {
    font-size: 14px;
    color: #555;
    margin-bottom: 24px;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .login-tabs-wrapper .nav-tabs > li > a {
        font-size: 12px;
        padding: 14px 6px;
    }
}
