/* ========== DESIGN SYSTEM - HappyPet ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Blue palette */
    --hp-primary: #2c6fb7;
    --hp-primary-dark: #1e4f87;
    --hp-primary-light: #3b86d5;
    --hp-bg-subtle: #f0f6ff;
    --hp-bg-card: #ffffff;
    --hp-text: #1b2b3b;
    --hp-text-muted: #5f6c7b;
    --hp-border: #d0d9e6;
    --hp-border-light: rgba(44, 111, 183, 0.12);
    /* Spacing scale (8px base) */
    --space-8: 8px;
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
    /* Typography */
    --font-page-title: 2rem;
    --font-section-title: 1.5rem;
    --font-product-name: 1rem;
    --font-description: 0.9375rem;
    --font-label: 0.8125rem;
    --line-height-body: 1.6;
    --radius: 12px;
    --radius-pill: 9999px;
    --shadow-sm: 0 2px 8px rgba(15, 35, 52, 0.08);
    --shadow-md: 0 10px 24px rgba(18, 80, 149, 0.12);
}

/* Global container - same on all pages */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at top left, #f0f6ff 0, #e8f4ff 35%, #fdfdff 100%);
    margin: 0;
    padding: 0;
    color: var(--hp-text);
    line-height: var(--line-height-body);
}

/* LAYOUT GENERAL */

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-catalog {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.page-content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.page-content-catalog {
    max-width: none;
    width: 100%;
    padding: 28px 32px 48px;
    flex: 1;
}

/* CONTENEDORES */

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 18px 50px rgba(15, 35, 52, 0.08);
}

.card-narrow {
    max-width: 420px;
    margin: 72px auto;
}

/* Form card - centered form container (login, register, profile, etc.) */
.form-card {
    max-width: 420px;
    width: 100%;
    margin: var(--space-32) auto;
    padding: var(--space-32);
    background: var(--hp-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--hp-border-light);
}

/* Typography - design system */
.page-title { font-size: var(--font-page-title); font-weight: 700; margin-bottom: var(--space-16); color: #1b3f73; }
.section-title { font-size: var(--font-section-title); font-weight: 600; margin-bottom: var(--space-16); color: #1b3f73; }
.text-label { font-size: var(--font-label); font-weight: 600; color: var(--hp-text-muted); margin-bottom: var(--space-8); }
.text-description { font-size: var(--font-description); color: #555; line-height: var(--line-height-body); }

/* compatibilidad con plantillas existentes */
.container {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 28px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 35, 52, 0.08);
}

/* Login card: inputs proporcionales, espaciado y enlaces centrados */
.login-card .login-card-subtitle {
    text-align: center;
    margin: 0 0 20px;
    color: #5f6c7b;
    font-size: 14px;
}

.form-card .login-form,
.login-card .login-form {
    max-width: 100%;
    margin: 0 auto;
}

.login-card .login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3b4a5a;
    margin-bottom: 6px;
}

.login-card .login-form input {
    width: 100%;
    margin-bottom: 14px;
}

.login-card .login-form button {
    width: 100%;
    margin-top: 20px;
}

.login-card .login-error {
    text-align: center;
    margin-top: 16px;
}

.login-card .login-error p {
    margin: 0;
    color: #b1223c;
    font-size: 14px;
}

.login-card .login-links {
    text-align: center;
    margin-top: 24px;
}

.login-card .login-links a {
    display: block;
    margin-top: 10px;
}

.login-card .login-links a:first-child {
    margin-top: 0;
}

.card-header {
    margin-bottom: 24px;
    text-align: center;
}

.card-header p {
    margin: 6px 0 0;
    color: #5f6c7b;
    font-size: 14px;
}

/* TITULOS */

h1, h2, h3 {
    margin: 0;
    color: #1b3f73;
    letter-spacing: 0.01em;
}

h1 {
    font-size: 32px;
    font-weight: 700;
}

h2 {
    font-size: 24px;
    font-weight: 600;
}

/* FORMULARIOS */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3b4a5a;
    margin-bottom: 6px;
}

input {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--hp-border);
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    background-color: #f9fbff;
}

input:focus {
    outline: none;
    border-color: var(--hp-primary);
    box-shadow: 0 0 0 3px rgba(44, 111, 183, 0.18);
    background-color: #ffffff;
}

select {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--hp-border);
    font-size: 14px;
    background-color: #f9fbff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:focus {
    outline: none;
    border-color: var(--hp-primary);
    box-shadow: 0 0 0 3px rgba(44, 111, 183, 0.18);
}

/* BOTONES */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    background: linear-gradient(135deg, #2c6fb7, #3b86d5);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(18, 80, 149, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    text-decoration: none;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(18, 80, 149, 0.4);
    background: linear-gradient(135deg, #245c96, #326fb5);
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(18, 80, 149, 0.35);
}

.btn-secondary {
    background: #f1f5fb;
    color: #1b3f73;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #e4ecfa;
    box-shadow: 0 8px 18px rgba(38, 68, 116, 0.12);
}

.btn-danger {
    background: linear-gradient(135deg, #e33a4a, #ff606f);
    box-shadow: 0 10px 24px rgba(204, 46, 76, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c5293b, #f34c5d);
}

/* Bootstrap override: primary = blue palette */
.btn-primary {
    background: linear-gradient(135deg, #2c6fb7, #3b86d5) !important;
    border-color: #2c6fb7 !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #245c96, #326fb5) !important;
    border-color: #245c96 !important;
}
.btn-outline-primary {
    color: #2c6fb7;
    border-color: #2c6fb7;
}
.btn-outline-primary:hover {
    background: rgba(44, 111, 183, 0.1);
    color: #1e4f87;
    border-color: #1e4f87;
}

/* LINKS */

a {
    text-decoration: none;
    color: #2c6fb7;
    font-weight: 500;
}

a:hover {
    color: #1e4f87;
}

.link-muted {
    color: #6b7686;
    font-weight: 400;
}

.link-muted:hover {
    color: #2c6fb7;
}

/* GLOBAL NAVBAR - same on all pages, blue palette */
.global-nav {
    background: #ffffff !important;
    border-bottom: 1px solid var(--hp-border-light);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}
.global-nav .navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: #1b3f73 !important;
    transition: color 0.2s ease;
}
.global-nav .navbar-brand:hover { color: var(--hp-primary) !important; }
.global-nav .nav-link {
    font-weight: 500;
    color: #26476a !important;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}
.global-nav .nav-link:hover {
    background: rgba(44, 111, 183, 0.08);
    color: var(--hp-primary) !important;
}
.global-nav .nav-link.active {
    background: rgba(44, 111, 183, 0.12);
    color: var(--hp-primary) !important;
}
.global-nav .nav-link.text-danger:hover { background: rgba(220, 53, 69, 0.08); }
.global-nav .navbar-collapse { justify-content: flex-end; }
.hp-nav-container { max-width: 1300px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* NAVBAR (legacy) */

.navbar {
    background: #ffffff;
    border-bottom: 1px solid rgba(33, 111, 183, 0.12);
    padding: 14px 32px;
    display: flex;
    justify-content: center;
}

.navbar-inner {
    width: 100%;
    max-width: 1120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    color: #1b3f73;
}

.navbar-left span {
    font-size: 26px;
}

.navbar-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.navbar-link {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    color: #26476a;
    background: transparent;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.navbar-link:hover {
    background-color: rgba(44, 111, 183, 0.08);
    color: #1b3f73;
}

.navbar-cta {
    padding: 8px 18px;
}

/* NAVBAR CATALOG: brand left, menu buttons aligned to the far right */
.navbar-catalog {
    flex-shrink: 0;
}

.navbar-inner-catalog {
    max-width: none;
    justify-content: space-between;
    gap: 32px;
}

.navbar-inner-catalog .navbar-nav {
    margin-left: auto;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    color: #1b3f73;
}

.navbar-brand-icon {
    font-size: 26px;
}

.navbar-brand-name {
    letter-spacing: 0.02em;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-nav .navbar-link {
    padding: 8px 16px;
    font-size: 14px;
    color: #26476a;
}

.navbar-nav .navbar-link:hover {
    background-color: rgba(44, 111, 183, 0.1);
    color: #1b3f73;
}

.navbar-link-active {
    background-color: rgba(44, 111, 183, 0.12);
    color: #1b3f73;
}

/* CATALOG: centered search bar below nav */
.catalog-search-bar {
    width: 100%;
    padding: 20px 32px;
    background: #f8fafd;
    border-bottom: 1px solid rgba(44, 111, 183, 0.08);
    flex-shrink: 0;
}

.catalog-search-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
}

.catalog-search-input {
    flex: 1;
    min-width: 0;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(44, 111, 183, 0.25);
    font-size: 14px;
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.catalog-search-input:focus {
    outline: none;
    border-color: #2c6fb7;
    box-shadow: 0 0 0 3px rgba(44, 111, 183, 0.15);
}

.catalog-search-btn {
    padding: 12px 24px;
    flex-shrink: 0;
}

/* CATALOG: section and filters */
.catalog-section {
    max-width: 1600px;
    margin: 0 auto;
}

.catalog-header {
    margin-bottom: 20px;
}

.catalog-header h2 {
    margin: 0 0 4px;
}

.catalog-results {
    margin: 0;
    font-size: 14px;
    color: #6b7686;
}

.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 6px;
    margin-bottom: 24px;
}

.catalog-filters-label {
    font-size: 14px;
    font-weight: 600;
    color: #3b4a5a;
    margin-right: 4px;
}

.catalog-filter-group {
    font-size: 12px;
    font-weight: 700;
    color: #2c6fb7;
    margin-left: 12px;
    margin-right: 4px;
}

.catalog-filter-group:first-of-type {
    margin-left: 0;
}

.catalog-filter-link {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: #26476a;
    background: transparent;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.catalog-filter-link:hover {
    background-color: rgba(44, 111, 183, 0.1);
    color: #1b3f73;
}

.catalog-filter-link-active {
    background-color: rgba(44, 111, 183, 0.15);
    color: #1b3f73;
    font-weight: 600;
}

/* CATALOG: desktop grid 4–5 columns, full width */
.product-grid-catalog {
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.product-card-catalog {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(24, 60, 104, 0.1);
}

.product-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 12px;
    background: #f0f4f9;
    border-radius: 12px;
    overflow: hidden;
}

.product-card-catalog .product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-name {
    font-weight: 600;
    color: #1b3f73;
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-weight: 700;
    color: #1a7f37;
    font-size: 16px;
    margin-bottom: 4px;
}

.product-card-category {
    font-size: 12px;
    color: #6b7686;
    margin-bottom: 12px;
}

.product-card-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card-catalog .btn-add-cart {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
}

.product-card-admin {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* NAVBAR SEARCH */

.navbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-search-input {
    width: 220px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(44, 111, 183, 0.35);
    font-size: 13px;
    background-color: #f4f7fc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.navbar-search-input:focus {
    outline: none;
    border-color: #2c6fb7;
    box-shadow: 0 0 0 3px rgba(44, 111, 183, 0.18);
    background-color: #ffffff;
}

.navbar-search-button {
    padding: 8px 14px;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(18, 80, 149, 0.3);
}

/* HOME / HERO */

.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    margin-bottom: 12px;
}

.hero-text p {
    margin: 0;
    margin-bottom: 20px;
    color: #5f6c7b;
    font-size: 15px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.badge {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 999px;
    background: rgba(44, 111, 183, 0.08);
    color: #2c6fb7;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hero-side {
    display: flex;
    justify-content: center;
}

.hero-card {
    width: 280px;
    background: radial-gradient(circle at top, #ffffff 0, #f2f6ff 55%, #e7f2ff 100%);
    border-radius: 26px;
    padding: 24px 20px;
    box-shadow: 0 18px 45px rgba(27, 63, 115, 0.20);
    text-align: center;
}

.hero-card-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.hero-card-subtitle {
    font-size: 13px;
    color: #5f6c7b;
    margin-bottom: 16px;
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.hero-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    color: #2c6fb7;
    font-size: 12px;
    box-shadow: 0 5px 14px rgba(32, 80, 130, 0.12);
}

/* PRODUCTOS */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.section-header p {
    margin: 0;
    color: #6b7686;
    font-size: 13px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}

.product-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(24, 60, 104, 0.14);
    padding: 18px 18px 16px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.product-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.product-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.12));
}

.product-name {
    font-weight: 600;
    color: #1b3f73;
    margin-bottom: 4px;
    font-size: 15px;
}

.product-description {
    font-size: 13px;
    color: #6b7686;
    margin-bottom: 10px;
    min-height: 32px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.price {
    font-weight: 700;
    color: #1a7f37;
    font-size: 16px;
}

.stock {
    font-size: 12px;
    color: #6b7686;
}

.product-actions {
    display: flex;
    gap: 8px;
}

/* MENSAJES */

.alert {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-top: 8px;
}

.alert-error {
    background: #ffe5e9;
    color: #b1223c;
}

.alert-success {
    background: #e5f6ea;
    color: #1b7a3e;
}

/* UTILIDADES */

.text-center {
    text-align: center;
}

.mt-24 {
    margin-top: 24px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-8 {
    margin-top: 8px;
}

.inline-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 13px;
}

/* RESPONSIVE */

/* Catalog: responsive grid columns */
@media (max-width: 1200px) {
    .product-grid-catalog {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid-catalog {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 12px 18px;
    }

    .navbar-right {
        gap: 10px;
    }

    .navbar-inner-catalog {
        flex-wrap: wrap;
        gap: 12px;
    }

    .catalog-search-bar {
        padding: 14px 16px;
    }

    .catalog-search-form {
        max-width: none;
    }

    .page-content {
        padding: 24px 16px 32px;
    }

    .page-content-catalog {
        padding: 20px 16px 32px;
    }

    .product-grid-catalog {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .card-narrow {
        margin: 40px 12px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .hero-side {
        order: -1;
    }

    .hero-card {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-grid-catalog {
        grid-template-columns: 1fr;
    }
}
