/**
 * Cristal Glass Brochure - Styles
 * Estilos principales del brochure digital
 */

/* ==========================================================================
   Variables CSS
   ========================================================================== */
:root {
    --primary: #00afd8;
    --primary-dark: #33bdea;
    --dark: #32373c;
    --gray: #7A8A9E;
    --light-gray: #9AABB8;
    --bg: #F5F7FA;
    --white: #FFFFFF;
    --page-width: 816px;
    --page-height: 1056px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Work Sans', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

/* ==========================================================================
   Controls Panel
   ========================================================================== */
.controls {
    max-width: 900px;
    margin: 0 auto 40px;
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.controls h2 {
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls h2 .logo-mini {
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
}

/* Page Checkboxes */
.page-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.page-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.page-checkboxes label:hover {
    background: #e0f4f8;
}

.page-checkboxes input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0096c7);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 175, 216, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 175, 216, 0.5);
}

.btn-secondary {
    background: var(--dark);
    color: white;
}

.btn-secondary:hover {
    background: #454d55;
}

/* ==========================================================================
   Brochure Container
   ========================================================================== */
.brochure-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* ==========================================================================
   Page Base
   ========================================================================== */
.page {
    width: var(--page-width);
    height: var(--page-height);
    background: var(--white);
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

/* ==========================================================================
   Logo Sizes
   ========================================================================== */
.logo-svg {
    height: 25px;
    width: auto;
}

.logo-svg-small {
    height: 19px;
    width: auto;
}

.logo-svg-large {
    height: 38px;
    width: auto;
}

/* ==========================================================================
   Page 1 - Portada
   ========================================================================== */
.page-1 {
    background: var(--white);
}

.page-1 .hero-image {
    width: 100%;
    height: 580px;
    background: url('https://images.unsplash.com/photo-1770210979516-15d39ae2ca77?w=1080') center/cover;
    position: relative;
}

.page-1 .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 650px;
    background: linear-gradient(to bottom, transparent 50%, var(--bg) 85%);
}

.page-1 .logo {
    position: absolute;
    top: 40px;
    left: 50px;
}

.page-1 .logo img {
    height: 25px;
    width: auto;
}

.page-1 .cover-content {
    position: absolute;
    left: 50px;
    top: 600px;
}

.page-1 .accent-line {
    width: 50px;
    height: 3px;
    background: var(--primary);
    margin-bottom: 12px;
}

.page-1 .brand-name {
    font-size: 52px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.page-1 .brand-sub {
    font-size: 15px;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 5px;
    margin-bottom: 8px;
}

.page-1 .brand-tag {
    font-size: 15px;
    color: var(--gray);
}

.page-1 .preview-photos {
    position: absolute;
    left: 50px;
    top: 810px;
    display: flex;
    gap: 12px;
    width: 716px;
    height: 170px;
}

.page-1 .preview-photos .photo {
    flex: 1;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.page-1 .preview-photos .photo:nth-child(1) {
    background-image: url('https://images.unsplash.com/photo-1752992993774-1fb75cd6b569?w=600');
}

.page-1 .preview-photos .photo:nth-child(2) {
    background-image: url('https://images.unsplash.com/photo-1665952455858-f97612bf7e02?w=600');
}

.page-1 .preview-photos .photo:nth-child(3) {
    background-image: url('https://images.unsplash.com/photo-1753628044045-3d2c7428a026?w=600');
}

.page-1 .bottom-bar {
    position: absolute;
    left: 50px;
    top: 1000px;
    width: 716px;
    display: flex;
    justify-content: space-between;
}

.page-1 .bottom-bar .web {
    font-size: 10px;
    color: var(--primary);
    letter-spacing: 1px;
}

.page-1 .bottom-bar .phone {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 1px;
}

/* ==========================================================================
   Inner Pages (2-7)
   ========================================================================== */
.inner-page {
    background: var(--bg);
}

.inner-page .top-bar {
    width: 100%;
    height: 60px;
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
}

.inner-page .top-bar .logo-small {
    display: flex;
    align-items: center;
}

.inner-page .top-bar .logo-small img {
    height: 19px;
    width: auto;
}

.inner-page .top-bar .page-num {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
}

.inner-page .title-block {
    position: absolute;
    left: 50px;
    top: 75px;
}

.inner-page .title-block .accent {
    width: 40px;
    height: 3px;
    background: var(--primary);
    margin-bottom: 6px;
}

.inner-page .title-block h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.inner-page .title-block .subtitle {
    font-size: 12px;
    color: var(--primary);
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.inner-page .title-block .description {
    font-size: 11px;
    color: var(--gray);
    line-height: 1.7;
    max-width: 500px;
}

.inner-page .page-number {
    position: absolute;
    right: 56px;
    bottom: 31px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
}

/* Photo Grid Base */
.photo-grid {
    position: absolute;
    display: flex;
    gap: 12px;
}

.photo-grid .photo {
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

/* ==========================================================================
   Page 2 - Vidrio Arquitectonico
   ========================================================================== */
.page-2 .photo-layout {
    position: absolute;
    left: 50px;
    top: 210px;
    width: 716px;
    height: 520px;
    display: flex;
    gap: 12px;
}

.page-2 .photo-layout .main {
    width: 460px;
    height: 100%;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1758800601654-d8b262d585b9?w=800') center/cover;
}

.page-2 .photo-layout .right-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-2 .photo-layout .right-stack .photo {
    flex: 1;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.page-2 .photo-layout .right-stack .photo:nth-child(1) {
    background-image: url('https://images.unsplash.com/photo-1602625325557-2840dc784668?w=600');
}

.page-2 .photo-layout .right-stack .photo:nth-child(2) {
    background-image: url('https://images.unsplash.com/photo-1637738159531-c9f02171ebfc?w=600');
}

.page-2 .bottom-wide {
    position: absolute;
    left: 50px;
    top: 745px;
    width: 716px;
    height: 200px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1636019226603-9b7eb83e056d?w=1000') center/cover;
}

/* ==========================================================================
   Page 3 - Divisiones de Bano
   ========================================================================== */
.page-3 .photo-layout {
    position: absolute;
    left: 50px;
    top: 210px;
    width: 716px;
    height: 380px;
    display: flex;
    gap: 12px;
}

.page-3 .photo-layout .main {
    width: 350px;
    height: 100%;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1771929662486-f793e08f0f16?w=800') center/cover;
}

.page-3 .photo-layout .right-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-3 .photo-layout .right-stack .photo {
    flex: 1;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.page-3 .photo-layout .right-stack .photo:nth-child(1) {
    background-image: url('https://images.unsplash.com/photo-1766730635220-da8a72b1022d?w=600');
}

.page-3 .photo-layout .right-stack .photo:nth-child(2) {
    background-image: url('https://images.unsplash.com/photo-1757524817165-e5ecf6d88c8e?w=600');
}

.page-3 .bottom-wide {
    position: absolute;
    left: 50px;
    top: 605px;
    width: 716px;
    height: 340px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1684819007715-eed73e696c7c?w=1000') center/cover;
}

/* ==========================================================================
   Page 4 - Divisiones de Oficina
   ========================================================================== */
.page-4 .top-photo {
    position: absolute;
    left: 50px;
    top: 210px;
    width: 716px;
    height: 400px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1614620303897-54955ff9ff5a?w=1000') center/cover;
}

.page-4 .bottom-row {
    position: absolute;
    left: 50px;
    top: 625px;
    width: 716px;
    height: 320px;
    display: flex;
    gap: 12px;
}

.page-4 .bottom-row .photo {
    height: 100%;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.page-4 .bottom-row .photo:nth-child(1) {
    width: 180px;
    background-image: url('https://images.unsplash.com/photo-1627401318951-badc4bf90cd1?w=400');
}

.page-4 .bottom-row .photo:nth-child(2) {
    flex: 1;
    background-image: url('https://images.unsplash.com/photo-1718980197759-45e821532237?w=600');
}

.page-4 .bottom-row .photo:nth-child(3) {
    width: 220px;
    background-image: url('https://images.unsplash.com/photo-1745970649957-b4b1f7fde4ea?w=400');
}

/* ==========================================================================
   Page 5 - Fachadas Comerciales
   ========================================================================== */
.page-5 .hero-photo {
    position: absolute;
    left: 50px;
    top: 210px;
    width: 716px;
    height: 440px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1621943411620-62d227e40247?w=1000') center/cover;
}

.page-5 .bottom-duo {
    position: absolute;
    left: 50px;
    top: 665px;
    width: 716px;
    height: 280px;
    display: flex;
    gap: 12px;
}

.page-5 .bottom-duo .photo {
    height: 100%;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.page-5 .bottom-duo .photo:nth-child(1) {
    width: 440px;
    background-image: url('https://images.unsplash.com/photo-1667188721282-972b6e9829e7?w=800');
}

.page-5 .bottom-duo .photo:nth-child(2) {
    flex: 1;
    background-image: url('https://images.unsplash.com/photo-1742068961395-fe2f88e68c10?w=600');
}

/* ==========================================================================
   Page 6 - Disenos Exclusivos
   ========================================================================== */
.page-6 .photo-tl {
    position: absolute;
    left: 50px;
    top: 210px;
    width: 350px;
    height: 440px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1760067537255-64d36262cb0a?w=800') center/cover;
}

.page-6 .photo-bl {
    position: absolute;
    left: 50px;
    top: 662px;
    width: 350px;
    height: 288px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1723896816059-406463dc43d3?w=800') center/cover;
}

.page-6 .photo-tr {
    position: absolute;
    left: 412px;
    top: 210px;
    width: 354px;
    height: 280px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1758565811178-6341e9999f48?w=800') center/cover;
}

.page-6 .photo-br {
    position: absolute;
    left: 412px;
    top: 502px;
    width: 354px;
    height: 448px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1616045152600-3f6c50d26d55?w=800') center/cover;
}

/* ==========================================================================
   Page 7 - Barandas & Cortavientos
   ========================================================================== */
.page-7 .panoramic {
    position: absolute;
    left: 50px;
    top: 210px;
    width: 716px;
    height: 340px;
    border-radius: 4px;
    background: url('https://images.unsplash.com/photo-1767531334004-01722fbb03e2?w=1000') center/cover;
}

.page-7 .strips {
    position: absolute;
    left: 50px;
    top: 565px;
    width: 716px;
    height: 390px;
    display: flex;
    gap: 13px;
}

.page-7 .strips .strip {
    width: 230px;
    height: 100%;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.page-7 .strips .strip:nth-child(1) {
    background-image: url('https://images.unsplash.com/photo-1657537473620-bdb167e8706c?w=500');
}

.page-7 .strips .strip:nth-child(2) {
    background-image: url('https://images.unsplash.com/photo-1602792571101-57cdefb9c183?w=500');
}

.page-7 .strips .strip:nth-child(3) {
    background-image: url('https://images.unsplash.com/photo-1696208734442-6c300a765310?w=500');
}

/* ==========================================================================
   Page 8 - Contraportada
   ========================================================================== */
.page-8 {
    background: var(--white);
}

.page-8 .top-accent {
    width: 100%;
    height: 6px;
    background: var(--primary);
}

.page-8 .center-content {
    position: absolute;
    left: 50%;
    top: 320px;
    transform: translateX(-50%);
    text-align: center;
}

.page-8 .logo-large {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.page-8 .logo-large img {
    height: 38px;
    width: auto;
}

.page-8 .divider {
    width: 80px;
    height: 2px;
    background: #E0E6ED;
    margin: 0 auto 24px;
}

.page-8 .tagline {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 24px;
}

.page-8 .contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.page-8 .contact .phone {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    letter-spacing: 1px;
}

.page-8 .contact .web {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 1px;
}

.page-8 .contact .email {
    font-size: 12px;
    color: var(--gray);
}

.page-8 .contact .social {
    font-size: 11px;
    color: var(--light-gray);
}

.page-8 .bottom-line {
    position: absolute;
    bottom: 31px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #B0BEC5;
    letter-spacing: 2px;
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .controls {
        display: none !important;
    }

    .brochure-container {
        gap: 0;
    }

    .page {
        box-shadow: none;
        page-break-after: always;
        margin: 0;
    }

    .page:last-child {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 850px) {
    .page {
        transform: scale(0.5);
        transform-origin: top center;
        margin-bottom: -528px;
    }

    .brochure-container {
        gap: 20px;
    }
}
