/* ====================================
   Maitess Catálogo 2026 - App Styles
   ==================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #0f172a;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --surface: #f8fafc;
    --surface-alt: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ====== HEADER ====== */
.app-header {
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    transition: var(--transition);
}

.header-brand:hover {
    color: var(--accent);
}

.header-brand i {
    font-size: 1.5rem;
    color: var(--accent);
}

.search-form .input-group {
    border-radius: var(--radius);
    overflow: hidden;
}

.search-form .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-form .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
    color: #fff;
}

.btn-search {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.625rem 1.25rem;
    transition: var(--transition);
}

.btn-search:hover {
    background: #0891b2;
    color: #fff;
}

.cart-link {
    display: inline-flex;
    align-items: center;
    position: relative;
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    transition: var(--transition);
    padding: 0.5rem;
}

.cart-link:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ====== MAIN CONTENT ====== */
.main-content {
    flex: 1;
    padding-bottom: 2rem;
}

/* ====== FOOTER ====== */
.app-footer {
    background: var(--secondary);
    color: var(--text-light);
    margin-top: auto;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-light);
}

.footer-user {
    font-size: 0.875rem;
    color: var(--text-light);
}

.footer-logout {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0;
    transition: var(--transition);
}

.footer-logout:hover {
    color: var(--accent);
}

/* ====== ALERTS ====== */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

/* ====== SECTION TITLES ====== */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
}

/* ====== BREADCRUMB ====== */
.page-breadcrumb {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.page-breadcrumb .breadcrumb {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.page-breadcrumb .breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

.page-breadcrumb .breadcrumb-item.active {
    color: var(--text-muted);
}

.page-breadcrumb h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* ====== PRODUCT CARDS ====== */
.product-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.product-card-img {
    position: relative;
    padding: 1rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.product-card-img img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    transition: var(--transition);
}

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

.product-card-body {
    padding: 1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.product-card-title:hover {
    color: var(--primary);
}

.product-card-sku {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.product-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
    margin-bottom: 0.75rem;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
}

.stock-badge.out-of-stock {
    background: #fef2f2;
    color: var(--danger);
}

.stock-badge.low-stock {
    background: #fffbeb;
    color: var(--warning);
}

.product-card-footer {
    padding: 0 1.25rem 1.25rem;
}

/* ====== BUTTONS ====== */
.btn-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-outline-custom {
    border: 2px solid var(--border);
    color: var(--text);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    background: transparent;
    transition: var(--transition);
}

.btn-outline-custom:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-danger-custom:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    color: #fff;
}

/* ====== PRODUCT LIST VIEW ====== */
.product-list-item {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    gap: 1.5rem;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.product-list-item:hover {
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.product-list-img {
    width: 120px;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-list-img img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.product-list-content {
    flex: 1;
}

.product-list-actions {
    display: flex;
    align-items: center;
}

/* ====== PRODUCT DETAILS ====== */
.product-detail-img {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-img img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.product-detail-info {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
}

.product-detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

.product-detail-stock {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quantity-input label {
    font-weight: 600;
    font-size: 0.95rem;
}

.quantity-input input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

.quantity-input input[type="number"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ====== CART TABLE ====== */
.cart-wrapper {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.cart-table {
    width: 100%;
    margin-bottom: 0;
}

.cart-table thead {
    background: var(--surface-alt);
}

.cart-table thead th {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.cart-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.cart-table tbody tr:last-child td {
    border-bottom: none;
}

.cart-table tbody tr {
    transition: var(--transition);
}

.cart-table tbody tr:hover {
    background: var(--surface);
}

.cart-product-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.cart-product-name {
    font-weight: 600;
    color: var(--text);
}

.cart-actions {
    padding: 1.25rem;
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
}

.btn-remove-item {
    color: var(--danger);
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.btn-remove-item:hover {
    color: #dc2626;
    transform: scale(1.2);
}

/* ====== CART SUMMARY ====== */
.cart-summary {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
}

.cart-summary h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.cart-total-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.cart-total-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* ====== VIEW TOGGLE ====== */
.view-toggle {
    display: inline-flex;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.view-toggle .btn {
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: calc(var(--radius-sm) - 2px);
    transition: var(--transition);
}

.view-toggle .btn.active {
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* ====== SORT BAR ====== */
.sort-bar {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ====== PAGINATION ====== */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ====== LOGIN PAGE ====== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 50%, #0f172a 100%);
    padding: 2rem;
}

.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-card .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.login-card .form-control {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
}

.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-card .btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-top: 0.5rem;
}

.login-card .btn-login:hover {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

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

.login-brand i {
    font-size: 2.5rem;
    color: var(--primary);
}

.login-brand span {
    display: block;
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ====== CONFIRM PAGE ====== */
.confirm-wrapper {
    text-align: center;
    padding: 4rem 2rem;
}

.confirm-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ecfdf5;
    color: var(--success);
    font-size: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-wrapper h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.confirm-wrapper p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ====== EMPTY STATE ====== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 767px) {
    .header-brand span {
        font-size: 1rem;
    }

    .product-card-img {
        min-height: 150px;
    }

    .product-detail-title {
        font-size: 1.35rem;
    }

    .product-detail-price {
        font-size: 1.5rem;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody td {
        display: block;
        text-align: right;
        padding: 0.5rem 1rem;
    }

    .cart-table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
        font-size: 0.8rem;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .cart-table tbody tr {
        border-bottom: 2px solid var(--border);
        padding: 0.5rem 0;
    }

    .product-list-item {
        flex-direction: column;
        gap: 1rem;
    }

    .product-list-img {
        width: 100%;
        min-width: auto;
    }
}
