/* ==========================================================================
   PORTFOLIO PAGE LAYOUT
   ========================================================================== */

/* Main Container - Split Layout */
.portfolio-container {
    display: flex;
    min-height: 100vh;
    padding-top: 20px;
    /* Reduced padding (Header is likely handling spacing or user wants it flush) */
    /* Header height */
}

/* 1. LEFT COLUMN: CV & PROFILE */
.cv-sidebar {
    width: 380px;
    /* Slightly wider for better readability */
    background: var(--blanco);
    border-right: 1px solid var(--borde);
    padding: 40px 30px;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    flex-shrink: 0;
    transition: background-color 0.4s ease, border-color 0.4s ease;
    /* Hide scrollbar but allow scrolling */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide scrollbar for Chrome/Safari/Opera */
.cv-sidebar::-webkit-scrollbar {
    display: none;
}

.cv-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cv-header h2 {
    font-family: var(--fuente-titulos);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--negro);
    letter-spacing: -1px;
}

.cv-section-title {
    font-family: var(--fuente-titulos);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--negro);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--borde);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cv-item {
    margin-bottom: 25px;
}

.cv-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.cv-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--negro);
    margin: 0;
}

.cv-item .date {
    font-size: 0.8rem;
    color: var(--color-principal);
    font-weight: 600;
    white-space: nowrap;
}

.cv-item .company,
.cv-item .school {
    font-size: 0.9rem;
    color: var(--gris-oscuro);
    margin: 0;
}

.skill-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--gris-claro);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--negro);
    font-weight: 500;
    margin-bottom: 6px;
}


/* Skills Widget Layout */
.skills-widget-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* iOS-style Bento Cards */
.skill-group-card {
    background: rgba(245, 245, 247, 0.6);
    /* Apple-like off-white */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px;
    /* More breathing room */
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Dark mode card */
[data-theme="dark"] .skill-group-card {
    background: rgba(28, 28, 30, 0.6);
    /* iOS Dark Gray */
    border: 1px solid rgba(255, 255, 255, 0.1);
}



/* Icons Grid inside card */
.skills-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    /* Increased gap */
    align-items: center;
    justify-content: flex-start;
    /* Align left to read like text */
}

.skills-icon-grid img {
    height: 32px;
    /* Fixed height for consistency */
    width: auto;
    /* Width adapts naturally */
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

/* Hover effect: Pop & Color */
.skills-icon-grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.2);
    /* Slightly reduced scale to prevent huge jumps on wide logos */
    position: relative;
    z-index: 10;
}

/* Card Hover Effect (Subtle) */
.skill-group-card:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

/* Dark mode adjustments */
[data-theme="dark"] .skills-icon-grid img {
    filter: grayscale(100%) brightness(0.8);
}

[data-theme="dark"] .skills-icon-grid img:hover {
    filter: grayscale(0%) brightness(1);
}

/* 2. RIGHT COLUMN: PROJECT GRID */
.projects-grid-area {
    flex-grow: 1;
    padding: 40px;
    background: var(--f-fondo-claro, #fcfcfc);
    /* Fallback or variable */
    transition: background-color 0.4s ease;
}

[data-theme="dark"] .projects-grid-area {
    background: #111;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--blanco);
    border: none;
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Category Specific Backgrounds (Pastel) */
.card-identitat-visual,
.project-page-container.card-identitat-visual {
    background-color: #e3f8ff;
}

.card-identitat-visual .project-title {
    color: #1c66a4;
}

.card-identitat-visual .project-arrow {
    color: #1c66a4;
}

.card-disseny-editorial,
.project-page-container.card-disseny-editorial {
    background-color: #e8e0ff;
}

.card-disseny-editorial .project-title {
    color: #5c4eb1;
}

.card-disseny-editorial .project-arrow {
    color: #5c4eb1;
}

.card-disseny-digital,
.project-page-container.card-disseny-digital {
    background-color: #ffccbc;
}

.card-disseny-digital .project-title {
    color: #bf360c;
}

.card-disseny-digital .project-arrow {
    color: #bf360c;
}

.card-illustracio,
.project-page-container.card-illustracio {
    background-color: #daefff;
}

.card-illustracio .project-title {
    color: #1c66a4;
}

.card-illustracio .project-arrow {
    color: #1c66a4;
}

.card-motion-graphics,
.project-page-container.card-motion-graphics {
    background-color: #ffd6e8;
}

.card-motion-graphics .project-title {
    color: #b9336e;
}

.card-motion-graphics .project-arrow {
    color: #b9336e;
}

.card-web,
.project-page-container.card-web {
    background-color: #e0f2f1;
}

.card-web .project-title {
    color: #00796b;
}

.card-web .project-arrow {
    color: #00796b;
}

.card-packaging,
.project-page-container.card-packaging {
    background-color: #fff9c4;
}

.card-packaging .project-title {
    color: #827717;
}

.card-packaging .project-arrow {
    color: #827717;
}

/* Dark mode overrides for cards */
[data-theme="dark"] .project-card {
    opacity: 0.85;
}

[data-theme="dark"] .project-card:hover {
    opacity: 1;
}

/* Category Icons */
.skill-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.category-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    /* Optional: filter to match text color if using simple black SVGs */
    /* filter: brightness(0) saturate(100%); */
}

.project-title {
    font-family: var(--fuente-titulos);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--negro);
}

.project-desc {
    font-size: 0.9rem;
    color: var(--gris-oscuro);
    line-height: 1.5;
}

.project-arrow {
    align-self: flex-end;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-15px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .project-arrow {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* 3. iPHONE STYLE DETAIL MODAL */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Slide up from bottom */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.detail-modal.active {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="dark"] .detail-modal {
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    /* Takes up most of screen */
    background: var(--blanco);
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-modal.active .modal-content {
    transform: translateY(0);
}

/* Close Button */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: var(--negro);
}

.modal-close-btn:hover {
    background: var(--color-principal);
    color: #fff;
    transform: rotate(90deg);
}

/* Carousel / Content */
.modal-body {
    flex: 1;
    padding: 60px 40px;
    overflow-y: auto;
    text-align: center;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--blanco);
    border: 1px solid var(--borde);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--negro);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: var(--color-principal);
    color: #fff;
    border-color: var(--color-principal);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}


/* RESPONSIVE */
@media (max-width: 950px) {
    .portfolio-container {
        flex-direction: column;
    }

    .cv-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--borde);
    }

    .modal-content {
        height: 100vh;
        border-radius: 0;
    }
}

/* Social/Connect Buttons Widget */
.social-connect-widget {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 245, 247, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
}

.social-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--blanco);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: var(--color-principal);
}

.social-btn:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

[data-theme="dark"] .social-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   PROJECT PAGES (FOLDER TABS LAYOUT)
   ========================================================================== */

.project-page-container {
    padding-top: 60px;
    /* Reduced for more compactness */
    min-height: 100vh;
    background-color: var(--gris-claro);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.4s ease;
}

[data-theme="dark"] .project-page-container {
    background-color: #000;
}

/* Tabs Navigation */
.folder-tabs-nav {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    display: flex;
    gap: 5px;
    /* Slight gap between tabs */
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar */
    margin-bottom: -1px;
    /* Overlap with border of content to feel connected */
    z-index: 10;
    -webkit-overflow-scrolling: touch;
}

.folder-tabs-nav::-webkit-scrollbar {
    display: none;
}

.folder-tab {
    padding: 12px 24px;
    background: rgba(200, 200, 200, 0.2);
    border-radius: 12px 12px 0 0;
    color: var(--gris-oscuro);
    font-family: var(--fuente-titulos);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-bottom: none;
    position: relative;
    top: 1px;
    /* Push down to sit on line */
}

.folder-tab:hover {
    background: rgba(200, 200, 200, 0.4);
    color: var(--negro);
}

.folder-tab.active {
    background: var(--blanco);
    color: var(--negro);
    font-weight: 800;
    z-index: 11;
}

/* Content Area ("The Folder") */
.folder-content-area {
    width: 100%;
    max-width: 1200px;
    background: var(--blanco);
    min-height: 60vh;
    /* Rounded bottom corners, top are square to meet tabs (or slightly rounded if full width) */
    border-radius: 0 0 24px 24px;
    padding: 40px;
    /* In mobile we might want top corners rounded if tabs stack */
}

[data-theme="dark"] .folder-tab {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gris-oscuro);
}

[data-theme="dark"] .folder-tab.active {
    background: #111;
    /* Match dark content bg */
    color: var(--blanco);
}

[data-theme="dark"] .folder-content-area {
    background: #111;
}

/* Visibility for Dynamic Content Items */
.folder-content-item {
    display: none;
}

.folder-content-item.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid inside the folder */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Header inside folder */
.folder-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--borde);
}

.folder-header h1 {
    font-family: var(--fuente-titulos);
    font-size: 2.5rem;
    color: var(--negro);
    margin-bottom: 10px;
}

.folder-header p {
    color: var(--gris-oscuro);
    max-width: 600px;
}

/* Go Back Button */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: var(--negro);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 12px 24px;
    background: var(--blanco);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Slightly more visible border since shadow is gone */
}

.back-link:hover {
    color: var(--color-principal);
}

/* ==========================================================================
   FULL-WIDTH PROJECT VIEW + CONTACT SIDEBAR + COMPANY PROFILE
   ========================================================================== */

/* When project/company view is active, expand full width */
.project-page-container.project-view-active {
    padding: 0 !important;
    align-items: stretch !important;
    background-color: var(--blanco) !important;
}

.project-page-container.project-view-active #dynamic-portfolio-root {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: block !important;
    align-items: stretch !important;
}

/* ---------- PUBLIC PROJECTS GRID ---------- */

.public-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    padding: 10px 0;
}

.project-card-public {
    position: relative;
    background: var(--blanco);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--borde);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.project-card-public:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(var(--color-principal-rgb), 0.12);
}

.proj-img-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.proj-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card-public:hover .proj-img-container img {
    transform: scale(1.05);
}

.proj-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card-public:hover .proj-overlay {
    opacity: 1;
}

.view-btn {
    padding: 10px 24px;
    background: var(--blanco);
    color: var(--negro);
    border-radius: 24px;
    font-family: var(--fuente-titulos);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.proj-info {
    padding: 18px 20px 22px;
}

.proj-category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--blanco);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--fuente-titulos);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.proj-info h3 {
    font-family: var(--fuente-titulos);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--negro);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.proj-tools {
    font-size: 0.8rem;
    color: var(--gris-oscuro);
    margin-bottom: 6px;
}

.proj-tools i {
    color: var(--color-principal);
    margin-right: 4px;
}

.proj-desc-preview {
    font-size: 0.82rem;
    color: var(--gris-oscuro);
    line-height: 1.45;
}

.proj-full-link {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ---------- PV LAYOUT (Project View + Company Profile shared) ---------- */

.pv-layout {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 70px);
}

/* Left: main content */
.pv-main {
    flex: 1;
    min-width: 0;
    background: var(--blanco);
    overflow-x: hidden;
}

/* Top bar */
.pv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--borde);
}

.pv-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 12px;
    color: var(--negro);
    font-family: var(--fuente-texto);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pv-back:hover {
    color: var(--color-principal);
    border-color: var(--color-principal);
    background: var(--gris-claro);
}

.pv-company-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gris-claro);
    border-radius: 12px;
    color: var(--color-principal);
    font-family: var(--fuente-titulos);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.25s ease;
}

.pv-company-link:hover {
    background: var(--color-principal);
    color: #fff;
}

/* Cover image */
.pv-cover {
    width: 100%;
    height: 340px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.pv-cover-gradient {
    display: flex;
    align-items: flex-end;
}

/* Content body */
.pv-body {
    padding: 36px 40px 60px;
    max-width: 820px;
}

.pv-title {
    font-family: var(--fuente-titulos);
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--negro);
    margin: 0 0 20px 0;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

/* Pills / badges */
.pv-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.pv-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--gris-claro);
    border-radius: 20px;
    font-size: 0.84rem;
    color: var(--gris-oscuro);
    font-family: var(--fuente-texto);
    font-weight: 500;
}

.pv-pill i {
    font-size: 0.78rem;
    opacity: 0.6;
}

.pv-pill-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Divider */
.pv-hr {
    border: none;
    border-top: 1px solid var(--borde);
    margin: 0 0 32px 0;
}

/* Rich text content (from Quill editor) */
.pv-content {
    font-family: var(--fuente-texto);
    line-height: 1.85;
    color: var(--gris-oscuro);
    font-size: 1.05rem;
}

.pv-content h1 {
    font-family: var(--fuente-titulos);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--negro);
    margin: 32px 0 14px;
}

.pv-content h2 {
    font-family: var(--fuente-titulos);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--negro);
    margin: 28px 0 12px;
}

.pv-content h3 {
    font-family: var(--fuente-titulos);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gris-oscuro);
    margin: 24px 0 10px;
}

.pv-content p {
    margin-bottom: 16px;
}

.pv-content img {
    max-width: 100%;
    border-radius: 14px;
    margin: 24px 0;
    display: block;
}

.pv-content blockquote {
    border-left: 4px solid var(--color-principal);
    padding: 14px 24px;
    color: var(--gris-oscuro);
    font-style: italic;
    margin: 24px 0;
    background: var(--gris-claro);
    border-radius: 0 10px 10px 0;
}

.pv-content iframe,
.pv-content .ql-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    margin: 24px 0;
    border: none;
}

.pv-content ul,
.pv-content ol {
    margin: 14px 0;
    padding-left: 24px;
}

.pv-content li {
    margin-bottom: 8px;
}

.pv-content a {
    color: var(--color-principal);
    text-decoration: underline;
}

/* ---------- RIGHT SIDEBAR (Contact Form — 380px like CV) ---------- */

.pv-sidebar {
    width: 380px;
    flex-shrink: 0;
    background: var(--blanco);
    border-left: 1px solid var(--borde);
}

.pv-sidebar-inner {
    position: sticky;
    top: 70px;
    padding: 30px 28px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    scrollbar-width: none;
}

.pv-sidebar-inner::-webkit-scrollbar {
    display: none;
}

.pv-contact-card {
    background: var(--gris-claro);
    border-radius: 20px;
    padding: 28px 24px;
    border: 1px solid var(--borde);
}

.pv-contact-title {
    font-family: var(--fuente-titulos);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--negro);
    margin: 0 0 8px 0;
}

.pv-contact-sub {
    font-family: var(--fuente-texto);
    font-size: 0.9rem;
    color: var(--gris-oscuro);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.pv-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pv-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pv-field label {
    font-family: var(--fuente-texto);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--negro);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pv-field input,
.pv-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--borde);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--negro);
    background: var(--blanco);
    font-family: var(--fuente-texto);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    resize: vertical;
}

.pv-field input:focus,
.pv-field textarea:focus {
    outline: none;
    border-color: var(--color-principal);
    box-shadow: 0 0 0 3px rgba(var(--color-principal-rgb), 0.12);
}

.pv-field input::placeholder,
.pv-field textarea::placeholder {
    color: #aaa;
}

.pv-btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--color-principal);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--fuente-titulos);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-top: 4px;
}

.pv-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--color-principal-rgb), 0.3);
}

.pv-contact-email {
    text-align: center;
    font-family: var(--fuente-texto);
    font-size: 0.82rem;
    color: var(--gris-oscuro);
    margin-top: 16px;
    line-height: 1.5;
}

.pv-contact-email a {
    color: var(--color-principal);
    font-weight: 600;
    text-decoration: none;
}

.pv-contact-email a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   COMPANY PROFILE VIEW (PUBLIC)
   ========================================================================== */

.cp-cover {
    width: 100%;
    height: 260px;
    position: relative;
    overflow: hidden;
}

.cp-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 0 40px;
    margin-top: -50px;
    position: relative;
    z-index: 2;
}

.cp-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    border: 4px solid var(--blanco);
    background: var(--blanco);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.cp-header-text {
    padding-bottom: 6px;
}

.cp-name {
    font-family: var(--fuente-titulos);
    font-size: 2rem;
    font-weight: 800;
    color: var(--negro);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.cp-desc {
    font-family: var(--fuente-texto);
    font-size: 0.95rem;
    color: var(--gris-oscuro);
    margin: 0;
    line-height: 1.5;
    max-width: 600px;
}

/* Company info row */
.cp-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 40px 0;
}

.cp-info-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gris-claro);
    border-radius: 12px;
    font-family: var(--fuente-texto);
    font-size: 0.85rem;
    color: var(--gris-oscuro);
    font-weight: 500;
}

.cp-info-item i {
    color: var(--color-principal);
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

a.cp-link {
    text-decoration: none;
    transition: all 0.2s ease;
}

a.cp-link:hover {
    background: var(--color-principal);
    color: #fff;
}

a.cp-link:hover i {
    color: #fff;
}

/* Company projects section */
.cp-projects-section {
    padding: 36px 40px 50px;
}

.cp-section-title {
    font-family: var(--fuente-titulos);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--negro);
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-section-title i {
    color: var(--color-principal);
}

.cp-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.cp-project-card {
    display: block;
    text-decoration: none;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cp-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(var(--color-principal-rgb), 0.1);
}

.cp-proj-img {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--gris-claro);
}

.cp-proj-info {
    padding: 14px 16px 18px;
}

.cp-proj-info h4 {
    font-family: var(--fuente-titulos);
    font-size: 1rem;
    font-weight: 700;
    color: var(--negro);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.cp-proj-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ==========================================================================
   DARK MODE OVERRIDES (Project View + Company Profile)
   ========================================================================== */

[data-theme="dark"] .pv-main {
    background: var(--blanco);
}

[data-theme="dark"] .pv-topbar {
    border-bottom-color: var(--borde);
}

[data-theme="dark"] .pv-back {
    background: var(--gris-claro);
    border-color: var(--borde);
    color: var(--negro);
}

[data-theme="dark"] .pv-sidebar {
    background: var(--blanco);
    border-left-color: var(--borde);
}

[data-theme="dark"] .pv-contact-card {
    background: var(--gris-claro);
    border-color: var(--borde);
}

[data-theme="dark"] .pv-field input,
[data-theme="dark"] .pv-field textarea {
    background: var(--blanco);
    border-color: var(--borde);
    color: var(--negro);
}

[data-theme="dark"] .project-card-public {
    background: var(--blanco);
    border-color: var(--borde);
}

[data-theme="dark"] .cp-logo {
    border-color: var(--blanco);
    background: var(--blanco);
}

[data-theme="dark"] .cp-project-card {
    background: var(--blanco);
    border-color: var(--borde);
}

[data-theme="dark"] .cp-info-item {
    background: var(--gris-claro);
}

[data-theme="dark"] .pv-field input::placeholder,
[data-theme="dark"] .pv-field textarea::placeholder {
    color: #666;
}

/* ==========================================================================
   RESPONSIVE (Project View + Company Profile)
   ========================================================================== */

@media (max-width: 950px) {
    .pv-layout {
        flex-direction: column;
    }

    .pv-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--borde);
    }

    .pv-sidebar-inner {
        position: relative;
        top: 0;
        height: auto;
        padding: 24px 20px;
    }

    .pv-cover {
        height: 220px;
    }

    .pv-body {
        padding: 24px 20px 40px;
    }

    .pv-title {
        font-size: 1.8rem;
    }

    .pv-content {
        font-size: 1rem;
    }

    .pv-topbar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .cp-cover {
        height: 180px;
    }

    .cp-header {
        padding: 0 20px;
        gap: 16px;
    }

    .cp-logo {
        width: 80px;
        height: 80px;
        margin-top: -40px;
    }

    .cp-name {
        font-size: 1.5rem;
    }

    .cp-info-row {
        padding: 20px 20px 0;
    }

    .cp-projects-section {
        padding: 28px 20px 40px;
    }

    .cp-projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }

    .public-projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .pv-cover {
        height: 160px;
    }

    .pv-title {
        font-size: 1.5rem;
    }

    .pv-back {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .pv-company-link {
        font-size: 0.82rem;
        padding: 8px 14px;
    }

    .cp-cover {
        height: 140px;
    }

    .cp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: -40px;
    }

    .cp-logo {
        width: 70px;
        height: 70px;
    }

    .cp-name {
        font-size: 1.3rem;
    }

    .cp-info-row {
        flex-direction: column;
        gap: 8px;
    }

    .cp-projects-grid {
        grid-template-columns: 1fr;
    }

    .public-projects-grid {
        grid-template-columns: 1fr;
    }

    .proj-img-container {
        height: 180px;
    }
}

/* Category page title */
.category-page-title {
    font-family: var(--fuente-titulos);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--negro);
    margin: 0 0 10px 0;
}