/* Reset and Typography Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.18);
    --accent: #3b82f6;
    --success: #10b981;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}

/* Glassmorphism Navigation */
.modern-navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.modern-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.05rem;
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main);
    margin: 0 0.5rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    transition: transform 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    padding: 6rem 0;
    background: radial-gradient(circle at top right, #e0e7ff, #f8fafc);
    border-radius: 0 0 3rem 3rem;
    margin-bottom: 4rem;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.1rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #0f172a;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

.btn-modern {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: none;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
}

.btn-modern:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px rgba(37, 99, 235, 0.5);
    color: white;
}

/* Product Cards */
.section-title {
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.product-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    /* arriba | izquierda y derecha | abajo */
    padding:1rem 0.5rem 0.5rem 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.product-image-wrapper {
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

.tag-new {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--success);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.product-info {
    padding: 1.5rem 0.5rem 0.5rem 0.5rem;
}

.product-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05rem;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-main);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.product-card:hover .cart-btn {
    background: var(--primary-color);
    color: white;
}

/* Footer Section */
.modern-footer {
    background: #0f172a;
    color: white;
    padding: 4rem 0 2rem 0;
    border-radius: 3rem 3rem 0 0;
    margin-top: 4rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.footer-text {
    color: #94a3b8;
    line-height: 1.6;
}

.footer-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-link:hover {
    color: white;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-section {
        padding: 4rem 1rem;
    }
}

/* Offcanvas Sidebar Styles */
.offcanvas-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
}

.offcanvas-title {
    font-weight: 800;
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
}

/* Category Tree Accordion */
.category-accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-border-color: transparent;
    --bs-accordion-btn-focus-box-shadow: none;
    --bs-accordion-active-bg: rgba(37, 99, 235, 0.05);
    --bs-accordion-active-color: var(--primary-color);
}

.category-accordion .accordion-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 0.25rem;
}

.category-accordion .accordion-button {
    font-weight: 600;
    padding: 1rem 0;
    color: var(--text-main);
    background: transparent;
    transition: all 0.2s ease;
}

.category-accordion .accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background: transparent;
    box-shadow: none;
}

.category-accordion .accordion-button::after {
    background-size: 1rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-tree-link {
    display: block;
    padding: 0.5rem 0 0.5rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    margin-bottom: 0.25rem;
}

.category-tree-link:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.03);
    padding-left: 1.5rem;
}



/* Unified Quick View Overlay */
.vista-rapida-overlay {
    transition: all 0.2s ease !important;
    opacity: 0 !important;
    transform: scale(0.8) !important;
    pointer-events: none !important;
}

.product-card:hover .vista-rapida-overlay {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
    animation: none !important;
}

.product-card:hover .product-image-wrapper::after {
    display: none !important;
}

/* Cart Page Specific Styles */
.cart-table th {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1rem;
    color: #64748b;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
}

/* Column widths - th has colspan=2 for product, so index shifts */
.cart-table th:nth-child(1) {
    width: 100px;
}

/* Producto (colspan=2: thumb) */
.cart-table th:nth-child(2) {
    width: auto;
}

/* Precio */
.cart-table th:nth-child(3) {
    width: 140px;
    text-align: center;
}

/* Cantidad */
.cart-table th:nth-child(4) {
    width: 120px;
    text-align: right;
}

/* Subtotal */
.cart-table th:nth-child(5) {
    width: 60px;
}

/* Eliminar */

.cart-table td {
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 0.5rem;
}

/* Force thumbnail column width */
.cart-table td:first-child {
    width: 100px;
    padding-left: 0;
}

/* Force subtotal col */
.cart-table td.text-end:last-child {
    width: 50px;
}

.product-thumbnail-cart {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    display: block;
}

.qty-input-group {
    width: 120px;
    max-width: 120px;
    background: #f8fafc;
    border-radius: 2rem;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
}

.qty-input-group input {
    background: transparent;
    border: none;
    width: 38px !important;
    min-width: 0;
    text-align: center;
    font-weight: bold;
    padding: 0;
    flex: 0 0 38px;
}

.qty-input-group input:focus {
    outline: none;
    box-shadow: none;
}

.qty-input-group button {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.qty-input-group button:hover {
    color: var(--primary-color);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.summary-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 100px;
}

.btn-modern-outline {
    background: white;
    border: 2px solid #e2e8f0;
    color: #475569;
}

.btn-modern-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f8fafc;
}

.btn-remove-item {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff1f2;
    color: #e11d48;
    border: none;
    transition: all 0.2s;
}

.btn-remove-item:hover {
    background: #e11d48;
    color: white;
    transform: scale(1.1);
}