/* ==========================================================================
   1. Root Variables & Global Styles
   ========================================================================== */
:root {
    --background: #F9FAFB;
    --shadow-dark: #B0B7C1;
    --shadow-light: #F5F7FA;
    --hover-bg: #E5E7EB;
    --primary: #7A9A85;
    --primary-hover: #5A7A68;
    --accent: #8DA398;
    --shadow-neumorphic: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    --shadow-inset: inset 2px 2px 4px #C8CCD1, inset -2px -2px 4px #F0F5FA;
    --header-height: 60px;
}

html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background: var(--background);
    color: #374151;
    box-sizing: border-box;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    padding-top: calc(var(--header-height) + 20px); 
    margin-top: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.container {
    background: #FFFFFF;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #D1D5DB;
    width: 100%;
    box-sizing: border-box;
    margin: 20px auto;
}

.btn {
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: var(--shadow-neumorphic);
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    color: #FFFFFF;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.entry {
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #FFFFFF;
    box-shadow: var(--shadow-inset);
    width: calc(100% - 24px);
    max-width: 200px;
    display: block;
    box-sizing: border-box;
}

/* ==========================================================================
   2. Top Bar & Navigation
   ========================================================================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* ... (resto del css hasta la sección 7) ... */
.top-bar #menuToggle {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    font-size: 28px;
    cursor: pointer;
    background: transparent;
    box-shadow: none;
    padding: 0;
    color: #FFFFFF;
    transition: color 0.3s;
}

.top-bar-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.top-bar.hidden {
    transform: translateY(-100%);
}

.top-bar #menuToggle:hover {
    transform: none;
    box-shadow: none;
    color: var(--accent);
}

.top-bar #authButtons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.top-bar #authButtons .btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: #FFFFFF;
    padding: 8px 15px;
    margin: 0;
    box-shadow: none;
}

.top-bar .cart-icon {
    background: transparent;
    box-shadow: none;
    color: #FFFFFF;
    font-size: 28px;
    padding: 0;
    transition: color 0.3s;
    text-decoration: none;
}

#welcomeMessage {
    color: #FFFFFF;
    margin-right: 15px;
    font-weight: 500;
    display: none;
}

#sideMenu {
    transform: translateX(-100%);
    display: block;
    width: 250px;
    background: #FFFFFF;
    box-shadow: var(--shadow-neumorphic);
    border-radius: 0 12px 12px 0;
    padding: 80px 20px 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1001;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    box-sizing: border-box;
}

#sideMenu.active {
    transform: translateX(0);
}

#sideMenu h3 {
    text-align: center;
    margin: 0 0 20px;
    color: #1F2937;
}

#sideMenu .tabs .category-btn {
    width: 100%;
    padding: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    background: var(--primary);
    box-shadow: var(--shadow-neumorphic);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 10px;
    text-align: left;
    color: #FFFFFF;
}

#sideMenu .tabs .category-btn:hover {
    background: var(--primary-hover);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

#mobileNavContainer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#mobileNavContainer .btn,
#mobileNavContainer .cart-icon {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 12px;
    font-size: 1em;
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-neumorphic);
}

#mobileNavContainer .cart-icon {
    font-size: 1.2em;
    text-decoration: none;
}

.header-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    background: #E5E7EB;
    border-radius: 12px;
    border: 1px solid #D1D5DB;
}

.header-background-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.search-section {
    display: flex;
    flex-direction: column; 
    align-items: center;   
    gap: 15px;             
    margin-bottom: 20px;
}

#searchInput {
    max-width: 400px;
    width: 100%; 
    margin: 0;
}

.catalog-section h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
    color: #1F2937;
}

#catalog {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    width: 100%;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #D1D5DB;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.product-card img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.product-card .product-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.product-card h2 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: #1F2937;
}

.product-card p.description {
    font-size: 0.9em;
    color: #374151;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .product-color-selector {
    flex-shrink: 0;
    width: 160px;
}

.product-card .product-color {
    width: 100%;
    padding: 10px;
    margin: 0;
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-inset);
    background: #FFFFFF;
}

.product-card .product-actions {
    flex-shrink: 0;
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.product-card .price {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--accent);
}

.product-card .btn {
    width: 100%;
    padding: 10px;
}

.product-detail-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #D1D5DB;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-layout {
    display: flex;
    gap: 40px;
    flex: 1;
    min-height: 0;
}

.product-gallery, .product-info {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.product-info h1#product-title {
    text-align: left;
    font-size: 2.2em;
    color: #1F2937;
    margin: 0 0 20px 0;
    line-height: 1.2;
    padding: 0;
    flex-shrink: 0;
}

.product-info h2 {
    color: var(--primary);
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 5px;
    margin: 0 0 15px 0;
}

.product-info p#product-description {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.product-info .price-section {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--accent);
    margin: 20px 0;
}

.product-info .custom-options {
    margin: 15px 0;
}

.product-info label {
    font-weight: bold;
    margin-right: 10px;
}

.product-info select {
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #FFFFFF;
    box-shadow: var(--shadow-inset);
    width: 100%;
    max-width: 250px;
}

.product-info .btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    margin-top: auto;
}

footer.container {
    margin: 40px auto 20px;
    text-align: center;
    background: #E5E7EB;
    border: 1px solid #D1D5DB;
    flex-shrink: 0;
}

.social-media-title {
    text-align: center;
    margin: 15px 0 10px;
    font-size: 0.85em;
    color: #374151;
}

.social {
    display: flex;
    justify-content: space-around;
    padding: 0 20px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: var(--shadow-neumorphic);
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    color: #FFFFFF;
    text-decoration: none;
}

.social-link:hover {
    transform: scale(1.1);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

/* ==========================================================================
   7. Estilos de Mensajes Dinámicos
   ========================================================================== */
@keyframes ticker-scroll {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

.ticker-wrapper {
    flex: 3;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.ticker-text-container {
    white-space: nowrap;
    animation: ticker-scroll 20s linear infinite;
    animation-play-state: running;
    padding-right: 50px; 
}

.ticker-text-container span {
    display: inline-block;
    padding: 0 2.5rem;
    font-weight: 500;
}

/* --- ESTA ES LA REGLA MODIFICADA --- */
.notification-bar {
    background: #e9eef2;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    color: #374151;
    border-left: 4px solid var(--accent);
    border-right: 4px solid var(--accent);
    width: 100%;
    /* Eliminamos max-width para que ocupe todo el ancho del contenedor */
    /* max-width: 600px; */ 
    box-sizing: border-box;
    text-align: center;
}

/* ==========================================================================
   8. Media Queries (Responsive Design)
   ========================================================================== */
@media (max-width: 768px) {
    .main-content {
        padding: 10px;
        padding-top: calc(var(--header-height) + 10px);
    }
    .top-bar {
        padding: 0 15px;
        justify-content: space-between;
    }
    .top-bar #menuToggle {
        flex: 0 1 auto;
    }
    .top-bar-right {
        flex: 0 1 auto;
    }
    
    .header-background-image {
        height: 120px;
    }

    .product-card {
        flex-direction: column;
        align-items: stretch;
    }

    .product-card img {
        width: 100%;
        height: 180px;
        margin-bottom: 15px;
    }
    
    .product-card .product-info,
    .product-card .product-actions {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    .product-card p.description {
        text-align: left;
    }
    
    .product-layout {
        flex-direction: column;
    }

    .product-info h1#product-title {
        font-size: 1.8em;
        text-align: center;
    }

    .product-info .price-section {
        font-size: 1.5em;
        text-align: center;
    }

    .product-gallery {
        margin-bottom: 20px;
    }

    .search-section { 
        flex-direction: column; 
        align-items: center;
    }
    #searchInput { 
        max-width: 90%; 
    }

    .product-card .product-color-selector {
        width: 100%;
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
    }

    .product-card .product-color {
        max-width: 250px;
    }
    
    .product-card .product-actions .btn {
        max-width: 250px;
    }
}

/* ==========================================================================
   9. Product Gallery (con Video)
   ========================================================================== */
.product-gallery {
    gap: 1rem;
}

.main-viewer {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: var(--shadow-inset);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.main-viewer img,
.main-viewer iframe {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 10px;
}

.thumbnail-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.thumbnail-container .thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    background-color: #FFFFFF;
    border: 2px solid transparent;
    box-shadow: var(--shadow-neumorphic);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.thumbnail-container .thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.thumbnail-container .thumbnail.active {
    border-color: var(--primary);
    box-shadow: 2px 2px 5px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
}

.thumbnail-container .video-thumbnail {
    position: relative;
    background-color: #374151;
}

.thumbnail-container .video-thumbnail::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: white;
    text-shadow: 0 0 8px rgba(0,0,0,0.6);
    transition: transform 0.2s ease;
}

.thumbnail-container .video-thumbnail:hover::after {
    transform: translate(-50%, -50%) scale(1.15);
}