:root {
    --catalog-primary: #0d6efd;
    --catalog-primary-dark: #0b5ed7;
    --catalog-bg: #f6f8fc;
    --catalog-surface: rgba(255, 255, 255, 0.92);
    --catalog-text: #0f172a;
    --catalog-muted: #64748b;
    --catalog-border: rgba(148, 163, 184, 0.22);
    --catalog-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--catalog-text);
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, var(--catalog-bg) 36%, #eef2ff 100%);
    min-height: 100vh;
}

.catalog-shell { min-height: 100vh; }

.catalog-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--catalog-border);
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.28), transparent 22%),
        linear-gradient(135deg, var(--catalog-primary-dark) 0%, var(--catalog-primary) 100%);
    color: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

.catalog-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.14), transparent 18%),
        radial-gradient(circle at 82% 18%, rgba(255,255,255,0.16), transparent 16%),
        linear-gradient(120deg, rgba(255,255,255,0.10), transparent 30%, rgba(255,255,255,0.04) 60%, transparent 75%);
    pointer-events: none;
}

.catalog-hero-inner { position: relative; z-index: 1; padding: 16px 0 14px; }

.catalog-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    text-decoration: none;
}

.catalog-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255,255,255,0.22);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
    overflow: hidden;
    flex-shrink: 0;
}

.catalog-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.catalog-brand-fallback { font-size: 1.1rem; font-weight: 800; }

.catalog-brand-name {
    font-size: clamp(1.05rem, 1.7vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.catalog-brand-subtitle {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.82;
    margin-top: 0.2rem;
}

.catalog-hero-copy { max-width: 680px; }
.catalog-hero-copy h1 {
    font-size: clamp(1.55rem, 3vw, 2.5rem);
    line-height: 1.04;
    letter-spacing: -0.05em;
    font-weight: 900;
    margin-bottom: 0.35rem;
}
.catalog-hero-copy p { font-size: 0.93rem; line-height: 1.45; opacity: 0.92; margin-bottom: 0; }

.catalog-search .form-control,
.catalog-search .form-select {
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.16);
    color: #fff;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.catalog-search .form-control::placeholder { color: rgba(255,255,255,0.75); }
.catalog-search .form-control:focus,
.catalog-search .form-select:focus {
    border-color: rgba(255,255,255,0.42);
    box-shadow: 0 0 0 0.25rem rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.catalog-search .form-select option { color: var(--catalog-text); }
.catalog-search-button { height: 44px; border-radius: 14px; }

.catalog-section { padding: 24px 0 50px; }
.catalog-card {
    background: var(--catalog-surface);
    border: 1px solid var(--catalog-border);
    border-radius: 22px;
    box-shadow: var(--catalog-shadow);
    backdrop-filter: blur(10px);
}

.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.catalog-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.catalog-grid { display: grid; gap: 18px; }

.catalog-control { width: auto; min-width: 132px; }
.catalog-products-tarjetas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.catalog-products-lista { display: grid; gap: 14px; }
.catalog-products-lista .product-card-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 188px;
}
.catalog-products-lista .product-media img,
.catalog-products-lista .product-media-fallback { height: 164px; min-height: 164px; }
.catalog-products-lista .product-media { align-self: center; border-radius: 16px; overflow: hidden; margin: 12px; background: #f8fafc; }
.catalog-products-lista .product-media img { object-fit: contain; padding: 8px; }
.catalog-products-lista .product-content { display: grid; grid-template-columns: minmax(0, 1fr) 148px; gap: 1.25rem; align-items: center; }
.catalog-products-lista .product-actions { margin: 0; }
.catalog-products-lista .product-summary { max-width: 60ch; }
.product-stock-status { display: inline-flex; align-items: center; padding: .35rem .55rem; border-radius: 999px; background: rgba(16,185,129,.09); font-weight: 700; }
.product-stock-status.text-danger { background: rgba(220,53,69,.09); }
.product-album {
    display: inline-block;
    border-radius: 999px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
}
.product-price { color: var(--catalog-primary); font-size: 1.2rem; font-weight: 900; }
.product-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
}
.product-actions .btn {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.5rem 0.72rem;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
    width: 100%;
}
.catalog-products-tarjetas .product-media {
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}
.catalog-products-tarjetas .product-media img {
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.catalog-products-tarjetas .product-content { display: flex; flex-direction: column; }
.catalog-products-tarjetas .product-actions { margin-top: auto; }
.product-card-shell[data-catalog-reveal] {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    transition: opacity 420ms ease var(--reveal-delay, 0ms), transform 420ms cubic-bezier(.2,.8,.2,1) var(--reveal-delay, 0ms), box-shadow 180ms ease;
}
.product-card-shell[data-catalog-reveal].is-revealed { opacity: 1; transform: translateY(0) scale(1); }
.product-card-shell[data-catalog-reveal].is-revealed:hover { transform: translateY(-5px); box-shadow: 0 25px 45px rgba(15, 23, 42, 0.13); }
.catalog-products-tarjetas .product-content h3 {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.11), rgba(124, 58, 237, 0.10));
    border: 1px solid rgba(13, 110, 253, 0.15);
    border-radius: 12px;
    padding: 0.56rem 0.65rem;
}
.section-title-frame {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    color: var(--catalog-primary);
    background: rgba(13, 110, 253, 0.10);
    border: 1px solid rgba(13, 110, 253, 0.16);
}
.media-upload-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--catalog-border);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(124, 58, 237, 0.05));
}
.media-upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.media-upload-form .form-control { max-width: 280px; }

.panel-dashboard { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; align-items: start; }
.panel-scroll { overflow: visible; }
.panel-section { display: flex; flex-direction: column; }
.admin-list { display: grid; gap: 10px; }
.admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--catalog-border);
    border-radius: 14px;
    background: #fff;
}
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.product-admin-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-admin-image { width: 54px; height: 54px; overflow: hidden; border-radius: 14px; flex: 0 0 auto; }
.product-admin-image img { width: 100%; height: 100%; object-fit: cover; }
.admin-search { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--catalog-border); border-radius: 999px; background: #f8fafc; }
.admin-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; }
.panel-settings { grid-column: 1; grid-row: 1 / span 2; }
.panel-section:not(.panel-products) { grid-column: 2; grid-row: 1; overflow: visible; }
.panel-section:not(.panel-products) .admin-list { max-height: 205px; overflow-y: auto; padding-right: 4px; }
.panel-products { grid-column: 2; grid-row: 2; min-height: 420px; }
.panel-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.panel-quick-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .45rem; }
.product-gallery-thumbnails { display: flex; flex-wrap: wrap; gap: 10px; }
.product-gallery-thumb { width: 82px; height: 82px; padding: 3px; border: 2px solid transparent; border-radius: 14px; background: #fff; cursor: pointer; overflow: hidden; }
.product-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.product-gallery-thumb:hover, .product-gallery-thumb.is-active { border-color: var(--catalog-primary); box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.13); }

@media (max-width: 1199.98px) {
    .panel-dashboard { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
    .panel-dashboard { display: flex; flex-direction: column; gap: 14px; }
    .panel-settings, .panel-section, .panel-products { width: 100%; position: static; grid-column: auto; grid-row: auto; min-height: 0; }
    .panel-settings { order: 1; }
    .panel-dashboard > .panel-section:not(.panel-products) { order: 2; }
    .panel-products { order: 3; }
    .panel-section:not(.panel-products) .admin-list { max-height: none; overflow: visible; }
    .panel-section-heading { align-items: stretch; }
    .panel-section-heading > .section-title-frame { align-self: flex-start; }
    .panel-quick-actions { width: 100%; justify-content: flex-start; }
    .panel-quick-actions .btn { flex: 1 1 auto; }
    .admin-row { align-items: stretch; flex-direction: column; padding: 13px; }
    .product-admin-info { align-items: flex-start; }
    .product-admin-image { width: 64px; height: 64px; }
    .admin-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; }
    .admin-actions form, .admin-actions a, .admin-actions button { width: 100%; }
    .admin-actions .btn { white-space: nowrap; padding-left: .35rem; padding-right: .35rem; }
    .admin-search { border-radius: 14px; }
}

@media (max-width: 1199.98px) {
    .catalog-products-tarjetas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .catalog-products-tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.catalog-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.12);
    color: #fff;
    padding: 0.36rem 0.68rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}
.catalog-chip:hover { color: #fff; background: rgba(255,255,255,0.18); }

.catalog-footer { margin-top: 42px; padding: 24px 0 38px; color: var(--catalog-muted); }
.catalog-footer-brand { text-align: center; }
.catalog-footer-brand a { color: #a855f7; font-weight: 900; letter-spacing: 0.08em; text-decoration: none; text-shadow: 0 0 14px rgba(168, 85, 247, 0.42); }
.catalog-footer-brand a:hover { color: #c084fc; text-decoration: underline; }
.product-quick-modal { border: 0; border-radius: 24px; overflow: hidden; }
.product-quick-image { display: flex; align-items: center; justify-content: center; min-height: 340px; border-radius: 18px; background: #f8fafc; overflow: hidden; }
.product-quick-image img { width: 100%; height: 340px; object-fit: contain; padding: 12px; }
.product-quick-price { font-size: 1.5rem; font-weight: 900; color: var(--catalog-primary); }

.catalog-chip-album {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.2);
    text-decoration: none;
    color: var(--catalog-text);
    box-shadow: 0 8px 18px rgba(15,23,42,0.06);
}

.floating-whatsapp {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1050;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 16px 30px rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}
.floating-whatsapp:hover { color: #fff; transform: translateY(-1px); }

.product-card-shell, .product-list-row, .panel-card, .admin-card, .surface-card {
    border: 1px solid var(--catalog-border);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--catalog-shadow);
    overflow: hidden;
}

.product-media { position: relative; background: linear-gradient(135deg, rgba(13,110,253,0.10), rgba(124,58,237,0.10)); }
.product-media img { width: 100%; height: 240px; object-fit: cover; display: block; }
.product-media-fallback {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--catalog-primary), #7c3aed);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    padding: 1rem;
}

.price-box {
    border-radius: 18px;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, rgba(248,250,252,0.95), rgba(241,245,249,0.98));
    border: 1px solid rgba(148,163,184,0.18);
}
.price-box .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--catalog-muted);
    font-weight: 700;
}
.price-box .value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--catalog-primary);
    line-height: 1.1;
}

.product-summary { font-size: 0.95rem; line-height: 1.55; color: var(--catalog-muted); white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.product-card-summary { min-height: 1.55rem; max-height: 1.55rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-more-button { border-radius: 999px; box-shadow: 0 5px 12px rgba(13,110,253,.2); }
.product-sku { color: var(--catalog-muted); font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.product-specs { border-top: 1px solid var(--catalog-border); padding-top: 1rem; }
.product-specs dt { color: var(--catalog-muted); font-size: .88rem; }
.product-specs dd { font-size: .9rem; margin-bottom: .5rem; }
.specs-text { white-space: pre-line; }
.album-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-weight: 800;
    color: #fff;
}

.panel-sidebar {
    position: sticky;
    top: 16px;
}

.toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.42rem 0.85rem;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; }
    .product-media img, .product-media-fallback { height: 160px; }
    .product-card-shell h3, .product-list-row h3 { font-size: 0.95rem; }
    .product-summary { font-size: 0.8rem; line-height: 1.35; }
    .price-box { padding: 0.65rem 0.75rem; border-radius: 14px; }
    .price-box .value { font-size: 1rem; }
    .catalog-products-lista .product-card-shell { grid-template-columns: 112px minmax(0, 1fr); min-height: 164px; }
    .catalog-products-lista .product-media { margin: 9px; border-radius: 12px; }
    .catalog-products-lista .product-media img, .catalog-products-lista .product-media-fallback { min-height: 144px; height: 144px; padding: 5px; }
    .catalog-products-lista .product-content { display: flex; flex-direction: column; align-items: stretch; gap: .45rem; padding: .85rem !important; }
    .catalog-products-lista .product-content h3 { font-size: .95rem; }
    .catalog-products-lista .product-summary { display: none; }
    .catalog-products-lista .product-price { margin-bottom: .25rem !important; font-size: 1.05rem; }
    .catalog-products-lista .product-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: .35rem; }
    .catalog-products-lista .product-actions .btn { width: auto; flex: 1 1 46%; font-size: .72rem; padding: .4rem .35rem; }
    .catalog-products-lista .product-actions a { flex-basis: 100%; }
    .catalog-products-tarjetas .product-actions .btn { padding: 0.36rem 0.55rem; font-size: 0.75rem; }
    .panel-settings { padding: 1rem !important; }
    .panel-settings .form-control, .panel-settings .form-select { min-height: 42px; }
    .admin-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
