/* ===== PORTFOLIO BRANDS CAROUSEL (Petronas-style) ===== */

/* Theme variables for products */
:root {
  --portfolio-title-color: #ffffff;
  --portfolio-description-color: rgba(255, 255, 255, 0.85);
  --portfolio-bg-color: #1a3747;
}

:root.light-theme {
  --portfolio-title-color: #ffffff;
  --portfolio-description-color: rgba(255, 255, 255, 0.9);
  --portfolio-bg-color: #e0f2fe;
}

/* --- Section Container --- */
.portfolio-brands {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

/* --- Background Layer --- */
.portfolio-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.portfolio-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url('../images/portfolio-bg.jpg');
    transform: scale(1.05);
    transition: transform 8s ease-out;
    background-color: #1a3747;
}

.portfolio-brands:hover .portfolio-bg-image {
    transform: scale(1.0);
}

.portfolio-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 80, 70, 0.75) 0%,
        rgba(0, 80, 70, 0.55) 35%,
        rgba(0, 80, 70, 0.20) 55%,
        rgba(0, 0, 0, 0.10) 100%
    );
    z-index: 1;
}

/* --- Inner Layout --- */
.portfolio-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: auto;
}

@media (min-width: 768px) {
    .portfolio-inner {
        grid-template-columns: 1fr 1fr;
        min-height: 100vh;
    }
}

/* --- Left Content --- */
.portfolio-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 20px 40px 20px;
    gap: 16px;
}

@media (min-width: 768px) {
    .portfolio-content {
        padding: 80px 60px 80px 80px;
        gap: 24px;
    }
}

.portfolio-title {
    font-family: var(--font-display, 'Inter', system-ui, sans-serif);
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--portfolio-title-color);
    letter-spacing: -0.02em;
    margin: 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.portfolio-description {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: var(--portfolio-description-color);
    line-height: 1.75;
    max-width: 520px;
    margin: 0;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.portfolio-scroll-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    margin-top: 16px;
    transition: all 0.3s ease;
    animation: bounceDown 2s ease-in-out infinite;
}

.portfolio-scroll-indicator:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(4px);
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* --- Right Sidebar --- */
.portfolio-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 20px;
    position: relative;
    overflow: hidden;
    height: auto;
}

@media (min-width: 768px) {
    .portfolio-sidebar {
        padding: 20px 40px;
        gap: 40px;
        height: 100%;
    }
}

/* --- Swiper Container --- */
.portfolio-swiper {
    flex: 1;
    height: 600px; 
    overflow: visible;
    width: 100%;
    max-width: 440px; 
    margin: auto; 
    position: relative;
    display: flex;
    align-items: center;
}

.portfolio-swiper .swiper-slide {
    height: 380px !important; /* Larger for images */
    width: 100%; 
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    opacity: 0.2;
    transform: scale(0.75);
    filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.portfolio-swiper .swiper-slide-active {
    opacity: 1;
    transform: scale(1.0);
    filter: blur(0);
    z-index: 10;
    pointer-events: auto;
}

.catalog-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.catalog-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.swiper-slide-active .catalog-item img {
    transform: scale(1.05);
}

.brand-cards-group {
    display: none; 
}

/* --- Brand Card --- */
.brand-card {
    display: block;
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    overflow: hidden;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    position: relative;
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    color: #1a1a2e;
}

.brand-card-teal {
    background: linear-gradient(135deg, #e8f4f0 0%, #f0f8f6 100%);
}

/* Card Header */
.brand-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 0 24px;
    gap: 16px;
}

.brand-card-title {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.35;
    margin: 0;
    flex: 1;
}

.brand-card-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a2e;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.brand-card:hover .brand-card-arrow {
    background: var(--color-primary, #e8500a);
    color: #ffffff;
    transform: translate(2px, -2px);
}

/* Card Body */
.brand-card-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 16px 24px 24px 24px;
    gap: 16px;
}

.brand-card-logo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-logo-text {
    font-size: 0.85rem;
    font-weight: 800;
    color: #006B5E;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-logo-name {
    font-size: clamp(1.8rem, 2.5vw, 2.2rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.01em;
}

.brand-logo-name.sprinta { color: #C8A951; font-style: italic; }
.brand-logo-name.tutela { color: #006B5E; }
.brand-logo-name.urania { color: #006B5E; }
.brand-logo-name.iona { color: #00A86B; }
.brand-logo-name.syntium { color: #006B5E; }
.brand-logo-name.paraflu { color: #0077B6; }

.brand-card-product-img {
    flex-shrink: 0;
    width: 100px;
    height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: transform 0.4s ease;
}

.brand-card:hover .brand-card-product-img {
    transform: translateY(-6px) scale(1.05);
}

.brand-card-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

/* --- Vertical Navigation Dots --- */
.portfolio-nav-dots {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 8px;
    z-index: 10;
    flex-shrink: 0;
}

.portfolio-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.portfolio-dot:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.3);
}

.portfolio-dot.active {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* --- Entry Animations --- */
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideUpCard {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.portfolio-content {
    animation: fadeInLeft 1s ease-out 0.3s both;
}

.portfolio-sidebar {
    animation: fadeInRight 1s ease-out 0.5s both;
}

.swiper-slide-active .brand-card:nth-child(1) {
    animation: slideUpCard 0.6s ease-out 0.1s both;
}

.swiper-slide-active .brand-card:nth-child(2) {
    animation: slideUpCard 0.6s ease-out 0.3s both;
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .portfolio-inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .portfolio-brands {
        min-height: auto;
    }

    .portfolio-content {
        padding: 100px 40px 40px 40px;
        text-align: center;
        align-items: center;
    }

    .portfolio-description {
        text-align: center;
    }

    .portfolio-sidebar {
        padding: 20px 40px 60px 40px;
        justify-content: center;
        min-height: 450px;
    }

    .portfolio-swiper {
        height: 450px;
        overflow: hidden; /* Focar apenas no ativo */
    }

    .portfolio-swiper .swiper-slide {
        height: 280px !important;
        display: none !important; /* Esconder todos por padrão no mobile */
        opacity: 0;
        transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    }

    .portfolio-swiper .swiper-slide-active {
        display: flex !important; /* Mostrar apenas o ativo */
        opacity: 1 !important;
        transform: scale(1.0);
    }

    .catalog-item {
        padding: 10px;
        border-radius: 15px;
    }

    .portfolio-nav-dots {
        flex-direction: row;
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

    .portfolio-bg-gradient {
        background: linear-gradient(
            180deg,
            rgba(0, 80, 70, 0.80) 0%,
            rgba(0, 80, 70, 0.60) 40%,
            rgba(0, 80, 70, 0.30) 70%,
            rgba(0, 0, 0, 0.15) 100%
        );
    }
}

/* Mobile */
@media (max-width: 768px) {
    .portfolio-content {
        padding: 100px 24px 32px 24px;
    }

    .portfolio-title {
        font-size: 2.2rem;
    }

    .portfolio-description {
        font-size: 0.95rem;
    }

    .portfolio-sidebar {
        padding: 16px 24px 60px 24px;
        flex-direction: column;
    }

    .brand-card-header {
        padding: 18px 18px 0 18px;
    }

    .brand-card-title {
        font-size: 1rem;
    }

    .brand-card-body {
        padding: 12px 18px 18px 18px;
    }

    .brand-card-product-img {
        width: 80px;
        height: 100px;
    }

    .brand-logo-name {
        font-size: 1.6rem;
    }

    .portfolio-scroll-indicator {
        width: 40px;
        height: 40px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .portfolio-content {
        padding: 90px 16px 24px 16px;
        gap: 16px;
    }

    .portfolio-title {
        font-size: 1.8rem;
    }

    .portfolio-description {
        font-size: 0.875rem;
        line-height: 1.6;
    }

    .portfolio-sidebar {
        padding: 12px 16px 56px 16px;
    }

    .brand-cards-group {
        gap: 12px;
    }

    .brand-card-header {
        padding: 14px 14px 0 14px;
    }

    .brand-card-title {
        font-size: 0.9rem;
    }

    .brand-card-body {
        padding: 10px 14px 14px 14px;
    }

    .brand-card-product-img {
        width: 65px;
        height: 85px;
    }

    .brand-logo-name {
        font-size: 1.4rem;
    }

    .brand-card-arrow {
        width: 30px;
        height: 30px;
    }

    .portfolio-dot {
        width: 10px;
        height: 10px;
    }
}

/* ============================================================
   LIGHT THEME — Portfolio Overrides
   ============================================================ */

/* Strengthen overlay so white text stays readable on photo bg */
:root.light-theme .portfolio-bg-gradient {
    background: linear-gradient(
        90deg,
        rgba(0, 60, 50, 0.82) 0%,
        rgba(0, 60, 50, 0.65) 35%,
        rgba(0, 60, 50, 0.30) 55%,
        rgba(0, 0, 0, 0.15) 100%
    );
}

/* Ensure text has shadow for readability */
:root.light-theme .portfolio-title {
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

:root.light-theme .portfolio-description {
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

/* Scroll indicator stays white */
:root.light-theme .portfolio-scroll-indicator {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* Nav dots stay white */
:root.light-theme .portfolio-dot {
    border-color: rgba(255, 255, 255, 0.5);
}

:root.light-theme .portfolio-dot.active {
    background: #ffffff;
    border-color: #ffffff;
}

