:root {
    --primary: #cba85a;
    /* Minimalist Gold/Yellow for accents */
    --primary-hover: #b09045;
    --dark: #121212;
    /* Deep Black/Gray */
    --darker: #0a0a0a;
    --light: #fafafa;
    /* Off white background */
    --white: #ffffff;
    --border: #eaeaea;
    --text: #333333;
    --text-muted: #777777;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* ================================= */
/*             TOP BAR               */
/* ================================= */
.top-bar {
    background-color: var(--darker);
    color: var(--white);
    padding: 8px 20px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.top-bar-content i {
    color: var(--primary);
    margin-right: 6px;
}

.top-bar-content a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.top-bar-content a:hover {
    color: var(--primary);
}

.top-bar-separator {
    color: #444;
}

/* ================================= */
/*             HEADER                */
/* ================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.logo-container {
    flex: 0 0 250px;
}

.logo-container .logo {
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Align right for a refined look */
    flex: 1;
}

h1 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--dark);
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.search-container {
    width: 100%;
    max-width: 500px;
    position: relative;
    margin-bottom: 15px;
}

#buscador {
    width: 100%;
    padding: 12px 40px 12px 45px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background-color: var(--white);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.btn-clear-search:hover {
    color: var(--dark);
}

#buscador:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(203, 168, 90, 0.1);
}

.search-container::before {
    content: '\f002';
    /* FontAwesome search icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ================================= */
/*          CATEGORIES NAV           */
/* ================================= */
.categorias-nav {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.btn-categoria {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-categoria:hover {
    color: var(--dark);
    border-color: var(--dark);
}

.btn-categoria.active {
    background-color: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

/* ================================= */
/*           PRODUCT GRID            */
/* ================================= */
.grid-catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto 80px auto;
    padding: 0 20px;
}

/* ================================= */
/*           PRODUCT CARD            */
/* ================================= */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

.card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background-color: var(--white);
    padding: 20px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border);
}

.info {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.txt-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.txt-codigo {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    font-family: monospace;
}

.info h3 {
    margin: 10px 0 5px 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark);
    line-height: 1.3;
}

.txt-detalles {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 5px 0 15px 0;
    line-height: 1.5;
    flex: 1;
}

.contenedor-precio {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.price {
    font-weight: 600;
    color: var(--dark);
    font-size: 1.4rem;
    margin: 0;
}

.txt-cant {
    font-size: 0.8rem;
    color: var(--primary);
    background-color: rgba(203, 168, 90, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.txt-ref {
    font-size: 0.75rem;
    color: var(--dark);
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.05);
    /* very subtle grey badge */
    border: 1px solid var(--border);
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}

.acciones-producto {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-cantidad {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 44px;
    flex: 0 0 100px;
    /* Fixed width for controls */
}

.btn-cant {
    background: transparent;
    border: none;
    width: 30px;
    height: 100%;
    font-size: 1.1rem;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cant:hover {
    background: var(--light);
}

.input-cant {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark);
    outline: none;
    -moz-appearance: textfield;
}

.input-cant::-webkit-outer-spin-button,
.input-cant::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add-cart {
    flex: 1;
    background-color: var(--dark);
    color: var(--white);
    border: none;
    height: 44px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.btn-add-cart:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(203, 168, 90, 0.3);
}

/* ================================= */
/*          FLOATING CART            */
/* ================================= */
.btn-carrito-flotante {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: var(--dark);
    color: var(--white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-carrito-flotante:hover {
    transform: scale(1.1) rotate(5deg);
    background-color: var(--primary);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--white);
}

/* ================================= */
/*             CART MODAL            */
/* ================================= */
.cart-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.cart-modal.show {
    display: flex;
    justify-content: flex-end;
}

.cart-modal-content {
    background-color: var(--white);
    height: 100%;
    width: 100%;
    max-width: 450px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-sizing: border-box;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.close-cart {
    color: var(--text-muted);
    align-self: flex-end;
    font-size: 24px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.close-cart:hover {
    color: var(--dark);
}

.cart-modal-content h2 {
    margin: 0 0 20px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1.4rem;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 10px;
    /* Space for scrollbar */
}

/* Custom scrollbar for modal */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: var(--light);
}

.cart-items::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px dashed var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dark);
    line-height: 1.2;
}

.cart-item-price {
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
    font-size: 0.9rem;
}

.btn-eliminar-item {
    background: none;
    border: none;
    color: #ff5252;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.3s;
    opacity: 0.6;
}

.btn-eliminar-item:hover {
    opacity: 1;
}

.cart-footer {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.cart-total h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#cart-total-price {
    font-weight: 600;
    font-size: 1.6rem;
    color: var(--dark);
}

.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-nombre {
    padding: 14px 15px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    outline: none;
    background-color: var(--light);
    transition: border-color 0.3s;
    box-sizing: border-box;
    width: 100%;
}

.input-nombre:focus {
    border-color: var(--primary);
    background-color: var(--white);
}

.btn-enviar-pedido {
    background-color: var(--dark);
    color: var(--white);
    border: none;
    padding: 16px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-enviar-pedido:hover {
    background-color: var(--primary);
}

.btn-enviar-pedido i {
    font-size: 1.2rem;
}

/* ================================= */
/*               FOOTER              */
/* ================================= */
.site-footer {
    background-color: var(--darker);
    color: #a0a0a0;
    padding: 60px 20px 25px;
    margin-top: 80px;
    border-top: 3px solid var(--primary);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 50px;
    margin-bottom: 60px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 400;
}

.footer-col h4 i {
    color: var(--primary);
}

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 0;
}

.footer-col p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-col p a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* ================================= */
/*         MEDIA QUERIES             */
/* ================================= */
@media (max-width: 992px) {
    header {
        flex-direction: column;
        padding: 20px;
    }

    .logo-container {
        flex: none;
        margin-bottom: 20px;
        text-align: center;
    }

    .logo-container .logo {
        max-width: 250px;
    }

    .header-right {
        width: 100%;
        align-items: center;
    }

    .search-container {
        max-width: 100%;
    }

    .categorias-nav {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .top-bar-content {
        flex-direction: column;
        gap: 8px;
    }

    .top-bar-separator {
        display: none;
    }

    h1 {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    .grid-catalogo {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
        margin-top: 25px;
    }

    .btn-carrito-flotante {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .cart-modal-content {
        padding: 20px;
        max-width: 100%;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-col h4 {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }
}