/* --- 1. CORE THEME & VARIABLES --- */
:root {
    --primary: #1a1a1a;
    --accent: #EC4899;      /* Professional Pink */
    --soft-bg: #FAF9F6;    /* Luxury Off-White */
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --transition-smooth: cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- 2. BASE RESET --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--soft-bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.serif { font-family: 'Playfair Display', serif; }

/* --- 3. SPA PAGE SYSTEM --- */
.page-content {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s var(--transition-smooth), transform 0.6s var(--transition-smooth);
}

.page-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.nav-item-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-item-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-item-link:hover::after,
.nav-item-link.active::after { width: 100%; }
.nav-item-link.active { color: var(--accent) !important; }

/* --- 4. MULTI-PHOTO CARD GRID --- */
.card-gallery-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    height: 100%;
}

.card-gallery-item {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
}

.puppy-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--transition-smooth);
}

.group:hover .puppy-card-img {
    transform: scale(1.06);
}

/* --- 5. MODAL & GALLERY ENGINE (THE FIX) --- */
#puppy-modal {
    z-index: 100;
}

#modal-backdrop {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.5s ease;
}

#modal-panel {
    will-change: transform;
    background: var(--card-bg);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.1);
    transition: transform 0.7s var(--transition-smooth);
}

/* Modal Gallery logic */
.modal-image-side {
    background: #f3f4f6;
    position: relative;
}

#modal-gallery {
    display: flex;
    flex-direction: column; /* Desktop: Scroll images vertically */
    gap: 4px;
}

#modal-gallery img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* --- 6. UTILITIES & ANIMATIONS --- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.shimmer {
    background: linear-gradient(90deg, #f3f4f6 25%, #f9fafb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer-load 1.8s infinite linear;
}

@keyframes shimmer-load {
    to { background-position: -200% 0; }
}

/* --- 7. MOBILE RESPONSIVE (CRITICAL FIX) --- */
@media (max-width: 768px) {
    #modal-body {
        flex-direction: column !important;
        overflow-y: auto !important;
        height: 100%;
    }
    
    .modal-image-side {
        width: 100% !important;
        height: 55vh !important; /* Ensures gallery is visible at top */
        min-height: 350px;
        order: -1; /* Forces images above text */
        overflow: hidden;
    }

    #modal-gallery {
        flex-direction: row !important; /* Swipe horizontally on mobile */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        height: 100%;
    }

    #modal-gallery img {
        flex: 0 0 100%;
        height: 100%;
        scroll-snap-align: start;
    }

    .modal-info-side {
        width: 100% !important;
        padding: 2.5rem 1.5rem !important;
        background: white;
    }

    #modal-panel {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
    }

    .serif-mobile { font-size: 2.5rem !important; }
}

/* Button Premium Hover Effect */
.btn-premium {
    position: relative;
    overflow: hidden;
    background: var(--primary);
    color: white;
    transition: all 0.4s var(--transition-smooth);
}

.btn-premium:hover {
    background: var(--accent);
    transform: translateY(-2px);
}
