/* ==========================================================================
   SISTEMA DE DISEÑO DE AUTOR - MANSIONS PROPERTY (EDICIÓN ALTA NITIDEZ)
   ========================================================================== */

:root {
    --font-titles: 'Cinzel', serif;
    --font-body: 'Montserrat', sans-serif;
    --gold-gradient: linear-gradient(135deg, #BF953F 0%, #FCF6BA 25%, #B38728 50%, #FBF5B7 75%, #AA771C 100%);
    --text-muted: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 1. CONFIGURACIÓN DEL FONDO GENERAL DE LA WEB */
html, body {
    min-height: 100vh;
    font-family: var(--font-body);
    color: #fff;
    overflow-x: hidden;
}

body.marble-background {
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.3)),
        url('/media/porcelanato.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* Acceso flotante para el Administrador */
.admin-access-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.admin-access-btn:hover {
    border-color: #FCF6BA;
    color: #FCF6BA;
    transform: rotate(45deg);
}

/* ==========================================================================
   2. TARJETA PRINCIPAL LUXURY
   ========================================================================== */
.luxury-card {
    position: relative;
    max-width: 680px;
    width: 100%;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #000;
}

.card-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.card-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.60);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
}

.card-content {
    position: relative;
    z-index: 3;
    padding: 50px 40px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-header {
    margin-bottom: 25px;
    width: 100%;
}

.logo-container {
    width: 95px;
    height: 95px;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.luxury-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title {
    font-family: var(--font-titles);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
    opacity: 0.95;
}

.social-links {
    display: flex;
    gap: 22px;
    margin-bottom: 35px;
}

.social-links a {
    color: #fff;
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.85;
}

.social-links a:hover {
    transform: translateY(-2px);
    opacity: 1;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.links-section {
    width: 100%;
    margin-bottom: 40px;
}

.links-section h2 {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    letter-spacing: 3px;
    margin-bottom: 22px;
    text-transform: uppercase;
    color: #fff;
    font-weight: 400;
}

.luxury-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    margin-bottom: 14px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.luxury-btn i.fa-luxury {
    font-size: 1.1rem;
    margin-right: 18px;
    color: #FCF6BA;
}

.luxury-btn span {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 400;
}

.luxury-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #B38728;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   3. GRILLA DE NOVEDADES
   ========================================================================== */
.novedades-section {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 35px;
}

.novedades-section h3 {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    letter-spacing: 3px;
    color: #fff;
    margin-bottom: 22px;
    text-transform: uppercase;
    font-weight: 400;
}

.recent-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    width: 100%;
}

.novelty-media-box {
    width: 100%;
    height: 130px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.novelty-media-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.novelty-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    text-align: left;
}

.novelty-tag {
    font-size: 0.58rem;
    background: var(--gold-gradient);
    color: #000;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    letter-spacing: 0.5px;
}

.novelty-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.novelty-price {
    font-size: 0.78rem;
    color: #FBF5B7;
    font-weight: 600;
}

.novelty-media-box:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   4. PANEL DE CONTROL DE ADMINISTRACIÓN
   ========================================================================== */
.admin-container {
    background: rgba(12, 12, 12, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-width: 820px;
    width: 100%;
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10;
}

.admin-header {
    text-align: center;
    margin-bottom: 35px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.82rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #B38728;
    background: rgba(255, 255, 255, 0.07);
}

/* Las opciones de un <select> no heredan el fondo oscuro en todos los navegadores */
.form-group select option,
select option {
    background-color: #161616;
    color: #ffffff;
    padding: 10px;
}

.file-input-wrapper {
    position: relative;
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-input-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-input-text i {
    color: #FCF6BA;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--gold-gradient);
    border: none;
    border-radius: 12px;
    color: #000;
    font-family: var(--font-titles);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(179, 135, 40, 0.25);
}

.submit-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.back-home {
    display: inline-block;
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: none;
}
.back-home:hover {
    color: #FBF5B7;
}

/* Archivos actuales al editar una publicación */
.media-actual {
    display: none;
    margin-bottom: 25px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: left;
}
.media-actual.visible { display: block; }
.media-actual p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
.media-actual-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.media-actual-grid img {
    width: 64px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mensajes flotantes del panel */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(92vw, 420px);
}
.toast {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    background: rgba(12, 12, 12, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.3s ease;
}
.toast-ok { border-color: #B38728; }
.toast-error { border-color: #dc3545; color: #ffb3b3; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: none; }
}

/* ==========================================================================
   5. CATÁLOGO: FILTROS Y CONTADOR DE GALERÍA
   ========================================================================== */
.catalog-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    position: relative;
    z-index: 5;
}
.catalog-filters input,
.catalog-filters select {
    flex: 1 1 180px;
    padding: 13px 18px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.82rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
}
.catalog-filters input { flex: 2 1 260px; }
.catalog-filters input::placeholder { color: rgba(255, 255, 255, 0.6); }
.catalog-filters input:focus,
.catalog-filters select:focus {
    outline: none;
    border-color: #FCF6BA;
}

.product-card:focus-visible {
    outline: 2px solid #FCF6BA;
    outline-offset: 3px;
}

.media-counter {
    position: absolute;
    bottom: 12px;
    right: 15px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 10;
    letter-spacing: 1px;
}

#modal-slider-track::-webkit-scrollbar { display: none; }

/* ==========================================================================
   6. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    body.marble-background {
        padding: 20px 10px;
    }
    .card-content {
        padding: 35px 24px;
    }
    .admin-container {
        padding: 28px 18px;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 1.5rem;
    }
    .recent-products-grid {
        grid-template-columns: 1fr;
    }
}