:root {
    --bg-color: #FFFFFF;
    --text-color: #000000;
    --accent-color: #000000;
    --hover-color: #333333;
    --light-border: #E0E0E0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--light-border);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    position: relative;
    transition: color 0.3s ease;
}

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

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

.cta-nav {
    padding: 0.6rem 1.2rem;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-nav:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    min-height: 100vh;
    padding-top: 80px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.25rem;
    color: #555;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.cta-primary {
    padding: 1rem 2rem;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: 2px solid var(--text-color);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-primary:hover {
    background-color: transparent;
    color: var(--text-color);
}

.cta-secondary {
    padding: 1rem 2rem;
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--light-border);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-secondary:hover {
    border-color: var(--text-color);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1.5s ease forwards 0.5s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.abstract-shape {
    width: 400px;
    height: 400px;
    background-color: var(--bg-color);
    border: 2px solid var(--text-color);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 8s ease-in-out infinite;
    box-shadow: 20px 20px 0px var(--light-border);
    position: relative;
    overflow: hidden;
}

.abstract-shape::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 1px dashed var(--text-color);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Features */
.features {
    padding: 120px 5%;
    background-color: var(--bg-color);
    border-top: 1px solid var(--light-border);
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.section-title p {
    font-size: 1.2rem;
    color: #555;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 3rem 2rem;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--text-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-color: #CCCCCC;
}

.feature-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.feature-card p {
    color: #555;
    font-size: 1.05rem;
}

/* Location (Map) */
.location {
    padding: 120px 5%;
    background-color: var(--bg-color);
    border-top: 1px solid var(--light-border);
}

.map-container {
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 450px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

/* Footer */
.footer {
    padding: 120px 5% 40px;
    text-align: center;
    background-color: #FAFAFA;
    border-top: 1px solid var(--light-border);
}

.footer h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -1.5px;
}

.footer p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 3rem;
}

.footer-bottom {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--light-border);
    font-size: 0.9rem;
    color: #888;
}

/* Responsive */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 150px;
        padding-bottom: 80px;
    }
    .hero h1 {
        font-size: 3.5rem;
    }
    .hero-content {
        margin-bottom: 4rem;
    }
    .hero-buttons {
        justify-content: center;
    }
    .abstract-shape {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 600px) {
    .nav-links, .cta-nav {
        display: none;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .hero-buttons {
        flex-direction: column;
    }
    .footer h2 {
        font-size: 2.5rem;
    }
}

/* --- Login Icon in Navbar --- */
.login-icon {
    font-size: 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
    padding: 0.5rem;
}

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

/* --- Login Page --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.login-container {
    background-color: var(--bg-color);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    width: 90%;
    max-width: 450px;
    border: 1px solid var(--light-border);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    height: 50px;
    margin-bottom: 1rem;
    object-fit: contain;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

.login-form .input-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.login-form label i {
    margin-right: 0.5rem;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: var(--text-color);
}

.login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.remember-me {
    font-weight: 400 !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0 !important;
}

.forgot-password {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.back-to-home {
    text-align: center;
    margin-top: 1.5rem;
}

.back-to-home a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-to-home a:hover {
    color: var(--text-color);
}

/* --- Dashboard --- */
.dashboard-body {
    background-color: #f9f9f9;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-color);
    border-right: 1px solid var(--light-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--light-border);
    text-align: center;
}

.sidebar-logo {
    height: 40px;
    object-fit: contain;
}

.sidebar-nav {
    list-style: none;
    padding: 1.5rem 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background-color: #f5f5f5;
    color: var(--text-color);
    border-left-color: var(--text-color);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--light-border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.logout-btn:hover {
    color: #d32f2f;
}

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-topbar {
    background-color: var(--bg-color);
    padding: 1.5rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--light-border);
}

.dashboard-topbar h2 {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.dashboard-content {
    padding: 2.5rem;
    flex: 1;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.metric-card {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--light-border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.metric-icon {
    width: 60px;
    height: 60px;
    background-color: #f5f5f5;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--text-color);
}

.metric-info h3 {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.recent-activity {
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--light-border);
    padding: 2rem;
}

.recent-activity h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-border);
}

.dashboard-table th {
    font-weight: 600;
    color: #555;
    background-color: #fafafa;
}

.status {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status.completed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status.pending {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* Sidebar Toggle for Mobile */
.sidebar-toggle-checkbox {
    display: none;
}

.sidebar-toggle-label {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: var(--text-color);
    color: var(--bg-color);
    width: 45px;
    height: 45px;
    border-radius: 8px;
    text-align: center;
    line-height: 45px;
    font-size: 1.2rem;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Responsive updates for Dashboard */
@media (max-width: 900px) {
    .dashboard-main {
        margin-left: 0;
    }
    
    .dashboard-topbar {
        padding-left: 70px; /* Para que no se sobreponga con el botón */
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px !important;
        min-width: 260px;
        max-width: 260px;
        z-index: 1001; /* Asegurar que sobreponga la tabla */
    }

    .sidebar-toggle-label {
        display: block;
    }

    .sidebar-toggle-checkbox:checked ~ .sidebar {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        height: 100%; /* Forzar altura */
    }
}

/* --- Inventory Section --- */
.inventory-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-color);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevents awkward cropping */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.product-img-wrapper:hover img {
    transform: scale(1.05);
}

.zoom-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.zoom-btn:hover {
    background-color: #000;
    transform: scale(1.1);
}

.product-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.status-active {
    background-color: #000;
    color: #fff;
}

.status-inactive {
    background-color: #ccc;
    color: #333;
}

/* Modal de Imagen (SweetAlert2 Custom) */
.swal2-title-white {
    color: #fff !important;
}

/* Force SweetAlert on top of everything */
.swal2-container {
    z-index: 10000 !important;
}

/* Filter Side Panel */
.filter-side-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    height: 100vh;
    background: var(--bg-color);
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.filter-side-panel.open {
    right: 0;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-border);
}

.filter-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.filter-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.filter-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--text-color);
    cursor: pointer;
}

.filter-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--light-border);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.product-code {
    font-weight: 600;
    color: #555;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.product-finances {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-border);
}

.price-box small {
    display: block;
    color: #888;
    font-size: 0.8rem;
}

.price-box p {
    font-weight: 600;
    font-size: 1rem;
}

.sale-price {
    font-size: 1.2rem !important;
    font-weight: 800 !important;
}

.product-stock {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.product-dates {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 1.5rem;
    flex: 1;
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.product-actions button {
    flex: 1;
    padding: 0.8rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn {
    border: 1px solid var(--text-color);
    background: transparent;
    color: var(--text-color);
}

.edit-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.delete-btn {
    border: 1px solid transparent;
    background: #f5f5f5;
    color: #d32f2f;
}

.delete-btn:hover {
    background: #ffebee;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-color);
}

.product-form .form-row {
    display: flex;
    gap: 1rem;
}

.product-form .input-group {
    flex: 1;
    margin-bottom: 1.5rem;
}

.product-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.product-form input,
.product-form select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.product-form input:focus,
.product-form select:focus {
    outline: none;
    border-color: var(--text-color);
}

.helper-text {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.3rem;
}

.image-preview {
    margin-top: 1rem;
    width: 100px;
    height: 100px;
    border: 1px dashed var(--light-border);
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions button {
    padding: 0.8rem 2rem;
}

@media (max-width: 600px) {
    .product-form .form-row {
        flex-direction: column;
        gap: 0;
    }
}
