/* ESTILOS DEL HEADER */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 0; /* Más compacto */
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px; /* Más espacio entre logo y buscador */
}

.header-logo {
    display: flex;
    align-items: center;
    min-width: 220px;
}

.header-logo .main-logo {
    max-height: 70px; /* Tamaño equilibrado */
    width: auto;
    object-fit: contain;
}

.header-search {
    flex: 1;
    max-width: 700px; /* Buscador más largo */
    display: flex;
    position: relative;
    background-color: var(--white);
    border-radius: 4px;
    border: none;
}

.header-search input {
    flex-grow: 1;
    border: none;
    padding: 10px 20px;
    outline: none;
    font-size: 1.1rem;
    border-radius: 4px 0 0 4px;
    color: #333;
}

.header-search button {
    background-color: #222; /* Negro como en la imagen */
    color: var(--white);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

/* Búsqueda en tiempo real */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: none;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.search-item:hover {
    background: #f9f9f9;
}

.search-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 15px;
}

.search-item-info {
    display: flex;
    flex-direction: column;
}

.search-item-info .name {
    font-weight: bold;
    font-size: 14px;
}

.search-item-info .cat {
    font-size: 12px;
    color: #777;
}

.search-results-dropdown .price .old-price-search {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85em;
    margin-right: 5px;
}

.search-results-dropdown .price .new-price-search {
    color: #DC1F27;
    font-weight: bold;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-quote-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #111;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: 0.2px;
    transition: transform 0.05s ease, opacity 0.2s ease;
}

.header-quote-btn:hover {
    opacity: 0.95;
}

.header-quote-btn:active {
    transform: translateY(1px);
}

.header-quote-btn i {
    font-size: 1.15rem;
    color: var(--primary-color);
}

.header-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
}

.header-action-item i {
    font-size: 1.2rem;
}

.cart-item {
    gap: 15px;
}

.cart-price {
    font-weight: bold;
}

.cart-icon-container {
    position: relative;
}

.cart-icon-container i {
    font-size: 1.5rem;
}

.cart-icon-container .count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #333;
    color: white;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ── Carrito lateral (drawer) ── */
.cart-drawer {
    position: fixed;
    inset: 0;
    z-index: 2500;
    visibility: hidden;
    pointer-events: none;
}

.cart-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.cart-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cart-drawer.is-open .cart-drawer__backdrop {
    opacity: 1;
}

.cart-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 100%);
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
}

.cart-drawer.is-open .cart-drawer__panel {
    transform: translateX(0);
}

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.cart-drawer__header h2 {
    font-size: 1.15rem;
    font-weight: 900;
    margin: 0;
    color: #222;
}

.cart-drawer__close {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #111;
}

.cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.cart-drawer__loading {
    text-align: center;
    color: #888;
    padding: 40px 0;
}

.cart-drawer__empty {
    text-align: center;
    padding: 60px 10px;
    color: #777;
}

.cart-drawer__empty i {
    font-size: 3rem;
    color: #eee;
    margin-bottom: 16px;
    display: block;
}

.cart-drawer__empty-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

.cart-drawer__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-drawer__row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid #f2f2f2;
    padding-bottom: 14px;
}

.cart-drawer__row-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.cart-drawer__row-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-drawer__row-body {
    flex: 1;
    min-width: 0;
}

.cart-drawer__row-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-drawer__row-price {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.cart-drawer__row-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cart-drawer__row-controls .qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.cart-drawer__row-controls .qty-controls button {
    background: #f9f9f9;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
}

.cart-drawer__row-controls .qty-controls input {
    width: 32px;
    border: none;
    text-align: center;
    font-size: 0.85rem;
    background: #fff;
}

.cart-drawer__row-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
}

.cart-drawer__row-remove:hover {
    color: var(--primary-color);
}

.cart-drawer__row-subtotal {
    font-weight: 900;
    color: #222;
    font-size: 0.88rem;
    white-space: nowrap;
}

.cart-drawer__footer {
    border-top: 1px solid #eee;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.cart-drawer__subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: 900;
    color: #222;
    margin-bottom: 4px;
}

.cart-drawer__btn {
    display: block;
    text-align: center;
    padding: 13px;
    border-radius: 10px;
    font-weight: 800;
    text-decoration: none;
    font-size: 0.92rem;
}

.cart-drawer__btn--primary {
    background: var(--primary-color);
    color: #fff;
}

.cart-drawer__btn--primary:hover {
    background: #b31920;
}

.cart-drawer__btn--outline {
    border: 1.5px solid #ddd;
    color: #333;
}

.cart-drawer__btn--outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
