/* ===== ROOT VARIABLES ===== */
:root {
    --bg-dark: #0f0f23;
    --bg-dark2: #1a1a2e;
    --rose: #e91e63;
    --rose-light: #ff6f91;
    --purple: #7c3aed;
    --gold: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Prompt', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark2) 50%, #0d1b2a 100%);
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-dark2));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s, visibility 0.6s;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo-container {
    margin-bottom: 16px;
    animation: floatBounce 1.5s ease-in-out infinite;
}

.loading-logo-frame {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
    border: 2px solid rgba(233, 30, 99, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(233, 30, 99, 0.2), inset 0 0 20px rgba(233, 30, 99, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
}

.loading-logo-frame::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e91e63, #7c3aed);
    opacity: 0.3;
    z-index: -1;
    filter: blur(8px);
}

.loading-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(233, 30, 99, 0.3));
}

.loading-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    margin: 16px 0 8px;
}

.loading-content p {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 24px;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--rose), var(--rose-light));
    border-radius: 4px;
    animation: loadBar 2s ease-in-out forwards;
}

@keyframes loadBar {
    0% {
        width: 0
    }

    60% {
        width: 70%
    }

    100% {
        width: 100%
    }
}

@keyframes floatBounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-12px)
    }
}

/* ===== APP CONTAINER ===== */
#app {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ===== CATALOG WRAPPER ===== */
#catalog-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100% - 70px);
    padding: 20px;
    position: relative;
}

/* ===== PAGE STYLES ===== */
.page {
    background: white;
    overflow: hidden;
}

.page-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ===== COVER FRONT ===== */
.cover-front {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 30%, #4a1942 60%, #1a1a2e 100%);
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
}

.cover-front::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(233, 30, 99, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%);
}

.cover-inner {
    position: relative;
    z-index: 1;
    padding: 40px 30px;
}

.cover-badge {
    display: inline-block;
    padding: 4px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 11px;
    letter-spacing: 3px;
    opacity: 0.7;
    font-family: 'Inter', sans-serif;
    margin-bottom: 24px;
}

.cover-icon {
    font-size: 56px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(233, 30, 99, 0.4));
}

/* ===== COVER LOGO FRAME ===== */
.cover-logo-container {
    margin-bottom: 24px;
}

.cover-logo-frame {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2) 0%, rgba(124, 58, 237, 0.15) 100%);
    border: 2.5px solid rgba(233, 30, 99, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(233, 30, 99, 0.25), inset 0 0 25px rgba(233, 30, 99, 0.08);
    backdrop-filter: blur(12px);
    position: relative;
}

.cover-logo-frame::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e91e63, #7c3aed);
    opacity: 0.25;
    z-index: -1;
    filter: blur(12px);
}

.cover-logo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(233, 30, 99, 0.35));
}

.cover-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.cover-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--rose), var(--rose-light));
    margin: 0 auto 16px;
}

.cover-subtitle {
    font-size: 18px;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 6px;
}

.cover-edition {
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 2px;
    opacity: 0.5;
}

.cover-bottom-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rose), var(--purple), var(--rose-light));
}

/* ===== COVER BACK ===== */
.cover-back {
    background: linear-gradient(135deg, #1a1a2e, #2d1b4e, #1a1a2e);
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.cover-back .cover-inner {
    width: 100%;
}

.back-tagline {
    font-size: 14px;
    opacity: 0.6;
    font-family: 'Inter', sans-serif;
    margin-top: 12px;
}

.back-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    align-items: center;
}

.back-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    opacity: 0.85;
    letter-spacing: 0.5px;
}

.back-contact-icon {
    font-size: 18px;
    color: var(--rose-light);
}

/* ===== SOCIAL MEDIA SECTION ===== */
.social-section {
    margin-top: 28px;
}

.social-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(233, 30, 99, 0.15);
    color: var(--rose-light);
    transition: all 0.3s ease;
    font-size: 18px;
    text-decoration: none;
    border: 1.5px solid rgba(233, 30, 99, 0.3);
}

.social-link:hover {
    background: var(--rose);
    color: white;
    transform: translateY(-3px);
    border-color: var(--rose);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

.back-copyright {
    font-size: 11px;
    opacity: 0.4;
    margin-top: 32px;
    font-family: 'Inter', sans-serif;
}

/* ===== TABLE OF CONTENTS ===== */
.toc-page {
    padding: 32px 28px;
    background: #fafafa;
}

.toc-header {
    text-align: center;
    margin-bottom: 28px;
}

.toc-header .toc-icon {
    font-size: 32px;
}

.toc-header h2 {
    font-size: 28px;
    color: #1f2937;
    margin: 8px 0 4px;
}

.toc-header .toc-sub {
    font-size: 12px;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    justify-content: space-evenly;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s;
}

.toc-item:hover {
    padding-left: 8px;
}

.toc-item:last-child {
    border-bottom: none;
}

.toc-num {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--rose);
    min-width: 36px;
}

.toc-info {
    display: flex;
    flex-direction: column;
}

.toc-th {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

.toc-en {
    font-size: 11px;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
}

.toc-dots {
    flex: 1;
    border-bottom: 2px dotted #d1d5db;
    margin: 0 8px;
    align-self: flex-end;
    margin-bottom: 4px;
}

.toc-page-num {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

/* ===== CATEGORY PAGES ===== */
.cat-page {
    padding: 16px 18px 10px;
    background: white;
}

.cat-header {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 2px solid;
    position: relative;
}

.cat-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.cat-header .cat-en {
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    opacity: 0.6;
}

.cat-label {
    text-align: center;
    padding: 6px 0;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    opacity: 0.5;
}

/* Category Colors */
.cat-Set .cat-header {
    border-color: #e91e63;
    color: #e91e63;
}

.cat-Dresses .cat-header {
    border-color: #7c3aed;
    color: #7c3aed;
}

.cat-Pants .cat-header {
    border-color: #f59e0b;
    color: #b45309;
}

.cat-Jeans .cat-header {
    border-color: #059669;
    color: #059669;
}

.cat-Sweaters .cat-header {
    border-color: #2563eb;
    color: #2563eb;
}

.cat-Tops .cat-header {
    border-color: #db2777;
    color: #db2777;
}

.cat-Set .cat-label {
    color: #e91e63;
}

.cat-Dresses .cat-label {
    color: #7c3aed;
}

.cat-Pants .cat-label {
    color: #f59e0b;
}

.cat-Jeans .cat-label {
    color: #059669;
}

.cat-Sweaters .cat-label {
    color: #2563eb;
}

.cat-Tops .cat-label {
    color: #db2777;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.product-card {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    background: #f9fafb;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* 3-image grid variant */
.product-grid.three-items .product-card {
    flex: 0 0 30%;
}

/* ===== PRODUCT PRICE AND CART ===== */
.product-price {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(233, 30, 99, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    z-index: 2;
}

.cart-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(124, 58, 237, 0.9);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
    z-index: 3;
    text-decoration: none;
    padding: 0;
}

.cart-btn:hover {
    background: rgba(124, 58, 237, 1);
    transform: scale(1.1);
}

a.cart-btn {
    display: inline-flex;
}

.cart-btn .material-icons-round {
    font-size: 18px;
}

/* ===== PAGE NUMBER ===== */
.page-number {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    padding: 6px 0 2px;
    letter-spacing: 1px;
}

/* ===== NAVIGATION ARROWS ===== */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 48px;
    height: 80px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
    border-radius: 12px;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-arrow .material-icons-round {
    font-size: 32px;
}

.nav-arrow-left {
    left: 16px;
}

.nav-arrow-right {
    right: 16px;
}

/* ===== BOTTOM TOOLBAR ===== */
#toolbar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
}

.toolbar-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.toolbar-btn .material-icons-round {
    font-size: 22px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 4px;
}

.page-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    padding: 0 8px;
}

.page-indicator input {
    width: 28px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    padding: 2px 0;
    font-family: 'Inter', sans-serif;
}

.page-indicator input:focus {
    outline: none;
    border-color: var(--rose);
}

/* ===== THUMBNAIL SIDEBAR ===== */
#thumbnail-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 300;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#thumbnail-sidebar.sidebar-hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h3 {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-header button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-header button:hover {
    color: white;
}

#thumbnail-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#thumbnail-list::-webkit-scrollbar {
    width: 4px;
}

#thumbnail-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.thumb-item {
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.04);
}

.thumb-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.thumb-item.active {
    border-color: var(--rose);
    background: rgba(233, 30, 99, 0.1);
}

.thumb-item .thumb-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-align: center;
    margin-top: 4px;
}

.thumb-item .thumb-preview {
    width: 100%;
    aspect-ratio: 3/4;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

/* ===== SIDEBAR OVERLAY ===== */
#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 250;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

#sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-arrow {
        width: 40px;
        height: 64px;
    }

    .nav-arrow-left {
        left: 8px;
    }

    .nav-arrow-right {
        right: 8px;
    }

    #catalog-wrapper {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .nav-arrow {
        width: 36px;
        height: 60px;
    }

    .nav-arrow-left {
        left: 4px;
    }

    .nav-arrow-right {
        right: 4px;
    }

    .nav-arrow .material-icons-round {
        font-size: 24px;
    }

    .toolbar-inner {
        padding: 6px 10px;
        gap: 2px;
    }

    .toolbar-btn {
        width: 32px;
        height: 32px;
    }

    .cover-title {
        font-size: 32px;
    }

    .cover-icon {
        font-size: 42px;
    }

    .cover-inner {
        padding: 20px 15px;
    }

    .cat-page {
        padding: 10px 12px 8px;
    }

    .cat-header h3 {
        font-size: 14px;
    }

    .product-grid {
        gap: 6px;
    }

    .product-card {
        border-radius: 8px;
    }

    .toc-page {
        padding: 15px 12px;
    }

    .toc-header {
        margin-bottom: 15px;
    }

    .toc-header h2 {
        font-size: 20px;
    }

    .toc-item {
        padding: 8px 0;
        gap: 6px;
    }

    .toc-num {
        font-size: 18px;
        min-width: 28px;
    }

    .toc-th {
        font-size: 12px;
    }

    .toc-en {
        font-size: 10px;
    }

    .toc-page-num {
        font-size: 14px;
    }

    .social-links {
        gap: 12px;
    }

    .social-link {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .back-contact {
        gap: 10px;
        margin-top: 20px;
    }

    .back-contact-item {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .nav-arrow {
        display: none;
    }

    #catalog-wrapper {
        padding: 5px;
        height: calc(100% - 60px);
    }

    .cover-title {
        font-size: 24px;
    }

    .cover-logo-frame {
        width: 120px;
        height: 120px;
    }

    .cover-logo {
        width: 100px;
        height: 100px;
    }

    .toolbar-inner {
        border-radius: 12px;
        padding: 4px 8px;
    }

    #thumbnail-sidebar {
        width: 100%;
        max-width: none;
    }

    .toc-page {
        padding: 10px;
    }

    .toc-header h2 {
        font-size: 18px;
        margin: 4px 0 2px;
    }

    .toc-item {
        padding: 6px 0;
    }

    .toc-num {
        font-size: 16px;
        min-width: 24px;
    }

    .toc-th {
        font-size: 11px;
    }

    .cart-btn {
        width: 36px;
        height: 36px;
    }

    .cart-btn .material-icons-round {
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .toc-page {
        padding: 8px;
    }

    .cover-badge {
        margin-bottom: 12px;
    }

    .cover-logo-frame {
        width: 100px;
        height: 100px;
    }

    .cover-logo {
        width: 80px;
        height: 80px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #catalog-wrapper {
        height: calc(100% - 40px);
    }

    #toolbar {
        bottom: 8px;
    }

    .toolbar-inner {
        padding: 4px 10px;
    }

    .toolbar-btn {
        width: 28px;
        height: 28px;
    }

    .nav-arrow {
        height: 50px;
    }
}