/**
 * Kool-a-Sun Interactive Catalogue Styles
 * Flipbook catalogue with category filtering
 */

/* =====================================================
   CSS Variables
   ===================================================== */
:root {
    --catalogue-primary: #f7931e;
    --catalogue-secondary: #0077be;
    --catalogue-dark: #1a1a2e;
    --catalogue-light: #f8f9fa;
    --catalogue-text: #333;
    --catalogue-text-light: #666;
    --catalogue-border: #e0e0e0;
    --catalogue-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --catalogue-page-bg: #fff;
    --catalogue-cover-gradient: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
    --page-width: 550px;
    --page-height: 778px;
}

/* =====================================================
   Catalogue Container
   ===================================================== */
.catalogue-wrapper {
    min-height: auto;
    background: linear-gradient(180deg, #f0f4f8 0%, #e8eef3 100%);
    padding: 1.5rem 1rem 1rem;
    /* Default padding for main site (sticky header) */
    padding-top: 2rem;
}

/* Shop catalogue needs extra padding for fixed header */
/* This ensures content clears the fixed header (~160px header + buffer) */
body .catalogue-wrapper[style*="padding-top"] {
    /* Allow inline style to take precedence */
}

.catalogue-container {
    max-width: 1200px;
    margin: 0 auto;
}

.catalogue-header {
    display: block !important;
    visibility: visible !important;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
}

.catalogue-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--catalogue-dark);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 10;
}

.catalogue-header p {
    color: var(--catalogue-text-light);
    font-size: 1.1rem;
    line-height: 1.4;
}

/* =====================================================
   Category Filter Buttons - CRITICAL: Must be visible
   ===================================================== */
.catalogue-wrapper .catalogue-filters,
.catalogue-filters {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
    position: relative;
    z-index: 100;
}

.catalogue-wrapper .filter-btn,
.filter-btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: white;
    border: 2px solid var(--catalogue-border);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--catalogue-text);
    cursor: pointer;
    transition: all 0.2s ease;
    will-change: transform;
}

.filter-btn:hover {
    border-color: var(--catalogue-primary);
    color: var(--catalogue-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 147, 30, 0.2);
}

.filter-btn.active {
    background: var(--catalogue-primary);
    border-color: var(--catalogue-primary);
    color: white;
}

.filter-btn i {
    font-size: 1rem;
}

/* =====================================================
   Flipbook Container
   ===================================================== */
.flipbook-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5rem auto;
    perspective: 3000px;
}

.flipbook {
    box-shadow: var(--catalogue-shadow);
    border-radius: 4px;
    background: var(--catalogue-page-bg);
}

/* StPageFlip overrides for smoother animation */
.stf__parent {
    margin: 0 auto;
}

.stf__wrapper {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.2);
}

/* Smoother page transitions */
.stf__block {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* =====================================================
   Page Styles - CRITICAL: Prevent content overflow
   ===================================================== */
.catalogue-page {
    background: var(--catalogue-page-bg);
    padding: 0;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

/* Page shadow effect */
.catalogue-page::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(0,0,0,0.08), transparent);
    pointer-events: none;
    z-index: 10;
}

.catalogue-page.--left::after {
    right: auto;
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.08), transparent);
}

/* =====================================================
   Cover Page
   ===================================================== */
.page-cover {
    background: var(--catalogue-cover-gradient);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden !important;
    height: 100%;
    box-sizing: border-box;
}

.page-cover::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: coverShine 15s linear infinite;
    will-change: transform;
}

@keyframes coverShine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.page-cover .cover-logo {
    max-width: 220px;
    height: auto;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    padding: 1.25rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.page-cover h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.page-cover .cover-year {
    font-size: 1.3rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.page-cover-back {
    background: var(--catalogue-dark);
}

.page-cover-back .cover-content {
    position: relative;
    z-index: 1;
    max-width: 100%;
    overflow: hidden;
}

.page-cover-back .cover-logo {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.page-cover-back h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: white;
}

.page-cover-back .contact-info {
    text-align: left;
    margin-bottom: 1.5rem;
}

.page-cover-back .contact-info p {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-cover-back .contact-info i {
    width: 22px;
    flex-shrink: 0;
    color: var(--catalogue-primary);
}

.page-cover-back .qr-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.page-cover-back .qr-section p {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

/* =====================================================
   Category Header Pages
   ===================================================== */
.page-category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.5rem 2.5rem;
    padding-top: 1.75rem;
    position: relative;
    overflow: hidden !important;
    height: 100%;
    box-sizing: border-box;
}

/* Border removed - replaced by wave backgrounds further down */

.page-category-header .category-icon {
    width: 70px;
    height: 70px;
    background: var(--catalogue-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.page-category-header .category-icon i {
    font-size: 1.8rem;
    color: white;
}

.page-category-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--catalogue-dark);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 5;
    line-height: 1.2;
}

.page-category-header p {
    color: var(--catalogue-text-light);
    font-size: 0.9rem;
    max-width: 360px;
    line-height: 1.5;
    position: relative;
    z-index: 5;
    margin-bottom: 0;
    /* Prevent text overflow */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-category-header .product-count {
    margin-top: 1.25rem;
    font-size: 1rem;
    color: var(--catalogue-primary);
    font-weight: 600;
    position: relative;
    z-index: 5;
}

/* Category Product List */
.category-product-list {
    margin-top: 1rem;
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 500px;
    /* Ensure list doesn't overlap page number */
    margin-bottom: 30px;
}

.category-product-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.category-product-list li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--catalogue-text);
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    border-left: 3px solid var(--catalogue-primary);
    line-height: 1.25;
}

.category-product-list li i {
    color: var(--catalogue-primary);
    font-size: 0.6rem;
    flex-shrink: 0;
}

/* Single column for small screens */
@media (max-width: 500px) {
    .category-product-list ul {
        grid-template-columns: 1fr;
    }

    .category-product-list li {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* =====================================================
   Product Grid Pages - CRITICAL: Strict containment
   ===================================================== */
.page-products {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    height: 100%;
    box-sizing: border-box;
    position: relative;
}

.page-products .page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--catalogue-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--catalogue-primary);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 5;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    flex: 1;
    overflow: hidden;
    /* Ensure grid doesn't exceed container */
    min-height: 0;
    align-content: start;
    position: relative;
    z-index: 5;
}

.products-grid.single-column {
    grid-template-columns: 1fr;
    max-width: 200px;
    margin: 0 auto;
}

/* =====================================================
   Product Cards - Fixed heights to prevent overflow
   ===================================================== */
.catalogue-product-card {
    background: white;
    border: 1px solid var(--catalogue-border);
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    /* Fixed max height to prevent bleeding */
    max-height: 320px;
    min-height: 0;
}

.catalogue-product-card:hover {
    border-color: var(--catalogue-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-card-image {
    width: 100%;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    background: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card-image .placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef3 100%);
    color: var(--catalogue-text-light);
}

.product-card-image .placeholder-image i {
    font-size: 2rem;
    margin-bottom: 0.3rem;
    opacity: 0.5;
}

.product-card-image .placeholder-image span {
    font-size: 0.75rem;
    opacity: 0.7;
}

.product-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.product-card-content h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--catalogue-dark);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    /* Remove min-height to prevent overlap */
    background: white;
    position: relative;
    z-index: 2;
}

.product-card-content .product-meta {
    font-size: 0.7rem;
    color: var(--catalogue-text-light);
    margin-bottom: 0.25rem;
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: white;
    position: relative;
    z-index: 1;
    clear: both;
}

.product-card-content .product-meta span {
    display: inline;
    margin-right: 0.4rem;
}

.product-card-badges {
    display: none;
}

.product-badge {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 2px;
    background: #e9ecef;
    color: #666;
    white-space: nowrap;
}

.product-badge.reef-safe {
    background: #d4edda;
    color: #155724;
}

.product-badge.mineral {
    display: none;
}

.product-badge.bestseller {
    background: #fff3cd;
    color: #856404;
}

.product-badge.travel-size,
.product-badge.travel {
    display: none;
}

.product-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--catalogue-primary);
    margin-bottom: 0.4rem;
    white-space: nowrap;
}

.product-card-price.quote-price {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--catalogue-secondary);
}

.product-card-actions {
    margin-top: auto;
    flex-shrink: 0;
}

.btn-catalogue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn-catalogue-primary {
    background: var(--catalogue-primary);
    color: white;
}

.btn-catalogue-primary:hover {
    background: #e8850a;
}

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

.btn-catalogue-secondary:hover {
    background: #006299;
}

.btn-catalogue-outline {
    background: transparent;
    border: 2px solid var(--catalogue-primary);
    color: var(--catalogue-primary);
}

.btn-catalogue-outline:hover {
    background: var(--catalogue-primary);
    color: white;
}

/* =====================================================
   Page Navigation
   ===================================================== */
.catalogue-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--catalogue-border);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--catalogue-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--catalogue-primary);
    color: var(--catalogue-primary);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 0.95rem;
    color: var(--catalogue-text-light);
    min-width: 100px;
    text-align: center;
}

/* =====================================================
   Introduction Page
   ===================================================== */
.page-intro {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden !important;
    height: 100%;
    box-sizing: border-box;
    position: relative;
}

.page-intro h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--catalogue-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
    position: relative;
    z-index: 5;
}

.page-intro p {
    font-size: 1rem;
    color: var(--catalogue-text);
    line-height: 1.6;
    margin-bottom: 1rem;
    position: relative;
    z-index: 5;
}

.page-intro .features-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    position: relative;
    z-index: 5;
}

.page-intro .features-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--catalogue-text);
}

.page-intro .features-list i {
    color: var(--catalogue-primary);
    font-size: 1rem;
    flex-shrink: 0;
}

/* =====================================================
   Page Number
   ===================================================== */
.page-number {
    position: absolute;
    bottom: 12px;
    font-size: 0.85rem;
    color: var(--catalogue-text-light);
    z-index: 5;
}

.page-number.left {
    left: 15px;
}

.page-number.right {
    right: 15px;
}

/* =====================================================
   Loading State & Initial Page Hiding
   ===================================================== */

/* Hide flipbook pages before StPageFlip initializes to prevent thumbnail flash */
/* StPageFlip adds .stf__parent class when initialized */
#flipbook:not(.stf__parent) .catalogue-page {
    opacity: 0;
    position: absolute;
}

/* Fallback: show pages after 3 seconds if JS fails */
#flipbook.js-fallback .catalogue-page {
    opacity: 1 !important;
    position: relative !important;
    display: block !important;
}

/* Show loading indicator while flipbook initializes */
.flipbook-container {
    position: relative;
    min-height: 500px;
}

.flipbook-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--catalogue-text-light);
    z-index: 5;
}

.flipbook-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--catalogue-border);
    border-top-color: var(--catalogue-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Hide loading when flipbook is initialized */
.flipbook-initialized .flipbook-loading {
    display: none !important;
}

.catalogue-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--catalogue-text-light);
}

.catalogue-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--catalogue-border);
    border-top-color: var(--catalogue-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* =====================================================
   Mobile Responsive
   ===================================================== */

/* Desktop: fixed header needs padding to clear it */
.catalogue-wrapper {
    padding-top: 180px !important;
}

/* Ensure body can scroll on catalogue page */
body.catalogue-page {
    overflow-y: auto !important;
    height: auto !important;
}

/* Mobile: Make header NOT fixed on catalogue page so content flows naturally */
@media (max-width: 768px) {
    body.catalogue-page .header {
        position: relative !important;
    }

    body.catalogue-page .catalogue-wrapper {
        padding-top: 1rem !important;
    }
}

@media (max-width: 1200px) {
    :root {
        --page-width: 480px;
        --page-height: 679px;
    }

    .catalogue-product-card {
        max-height: 280px;
    }

    .product-card-image {
        height: 85px;
        min-height: 85px;
        max-height: 85px;
    }
}

@media (max-width: 900px) {
    :root {
        --page-width: 400px;
        --page-height: 566px;
    }

    .catalogue-header h1 {
        font-size: 2rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .catalogue-product-card {
        max-height: 240px;
    }

    .product-card-image {
        height: 70px;
        min-height: 70px;
        max-height: 70px;
    }
}

@media (max-width: 768px) {
    :root {
        --page-width: 340px;
        --page-height: 481px;
    }

    /* Mobile: header is now position:relative, minimal padding needed */
    .catalogue-wrapper {
        padding: 1rem 0.5rem !important;
    }

    .catalogue-header h1 {
        font-size: 1.75rem;
    }

    .catalogue-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .filter-btn i {
        display: none;
    }

    .catalogue-navigation {
        gap: 1rem;
    }

    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .nav-btn span {
        display: none;
    }

    .page-products {
        padding: 1rem;
    }

    .products-grid {
        gap: 0.6rem;
    }

    .catalogue-product-card {
        padding: 0.5rem;
        max-height: 200px;
    }

    .product-card-image {
        height: 60px;
        min-height: 60px;
        max-height: 60px;
    }

    .product-card-content h4 {
        font-size: 0.7rem;
    }

    .product-card-price {
        font-size: 0.85rem;
    }

    .btn-catalogue {
        font-size: 0.65rem;
        padding: 0.35rem 0.5rem;
    }
}


/* Single page mode for very small screens */
@media (max-width: 500px) {
    :root {
        --page-width: 100%;
        --page-height: auto;
    }

    .flipbook-container {
        width: 100%;
        max-width: 350px;
    }

    .catalogue-page {
        min-height: 500px;
    }

    .page-cover .cover-logo {
        max-width: 160px;
        padding: 0.75rem 1rem;
    }

    .page-cover h1 {
        font-size: 1.5rem;
    }

    .page-category-header h2 {
        font-size: 1.4rem;
    }

    .page-category-header .category-icon {
        width: 65px;
        height: 65px;
    }

    .page-category-header .category-icon i {
        font-size: 1.6rem;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    .catalogue-filters,
    .catalogue-navigation {
        display: none;
    }

    .catalogue-wrapper {
        background: white;
        padding: 0;
    }

    .flipbook-container {
        box-shadow: none;
    }
}

/* =====================================================
   Smoother Animations - GPU Accelerated
   ===================================================== */
.catalogue-page {
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

.filter-btn {
    opacity: 1;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* =====================================================
   Wholesale Price Indicator
   ===================================================== */
.wholesale-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.55rem;
    color: #28a745;
    margin-left: 0.2rem;
}

.wholesale-indicator i {
    font-size: 0.5rem;
}

/* =====================================================
   Out of Stock
   ===================================================== */
.catalogue-product-card.out-of-stock {
    opacity: 0.6;
}

.catalogue-product-card.out-of-stock .product-card-image {
    position: relative;
}

.catalogue-product-card.out-of-stock .product-card-image::after {
    content: 'Out of Stock';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 0.2rem 0.5rem;
    font-size: 0.55rem;
    font-weight: 600;
    border-radius: 2px;
    white-space: nowrap;
}

.catalogue-product-card.out-of-stock .btn-catalogue-primary {
    background: #6c757d;
    cursor: not-allowed;
}

/* =====================================================
   Visual Enhancements - Layered Wave Backgrounds
   Using SVG wave paths for smooth, flowing ocean-like waves
   ===================================================== */

/* Product pages - layered bottom waves */
.page-products::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.6' d='M0,288L48,272C96,256,192,224,288,213.3C384,203,480,213,576,229.3C672,245,768,267,864,261.3C960,256,1056,224,1152,213.3C1248,203,1344,213,1392,218.7L1440,224L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.4' d='M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,218.7C672,235,768,245,864,234.7C960,224,1056,192,1152,181.3C1248,171,1344,181,1392,186.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 160px, 100% 220px;
    background-position: bottom, bottom;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* Product pages - top wave accent (layered for depth) */
.page-products::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.45' d='M0,0L1440,0L1440,64L1400,69.3C1360,75,1280,85,1200,96C1120,107,1040,117,960,106.7C880,96,800,64,720,53.3C640,43,560,53,480,69.3C400,85,320,107,240,101.3C160,96,80,64,40,48L0,32L0,0Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.3' d='M0,0L1440,0L1440,96L1400,101.3C1360,107,1280,117,1200,128C1120,139,1040,149,960,138.7C880,128,800,96,720,85.3C640,75,560,85,480,101.3C400,117,320,139,240,133.3C160,128,80,96,40,80L0,64L0,0Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 120px, 100% 180px;
    background-position: top, top;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* Intro page - bottom waves */
.page-intro::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.55' d='M0,256L48,261.3C96,267,192,277,288,272C384,267,480,245,576,234.7C672,224,768,224,864,234.7C960,245,1056,267,1152,261.3C1248,256,1344,224,1392,208L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.4' d='M0,160L60,170.7C120,181,240,203,360,202.7C480,203,600,181,720,186.7C840,192,960,224,1080,229.3C1200,235,1320,213,1380,202.7L1440,192L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 150px, 100% 200px;
    background-position: bottom, bottom;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* Intro page - top wave accent (layered for depth) */
.page-intro::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.4' d='M0,0L1440,0L1440,48L1380,58.7C1320,69,1200,91,1080,96C960,101,840,91,720,80C600,69,480,59,360,64C240,69,120,91,60,101.3L0,112L0,0Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.25' d='M0,0L1440,0L1440,64L1380,74.7C1320,85,1200,107,1080,112C960,117,840,107,720,101.3C600,96,480,96,360,106.7C240,117,120,139,60,149.3L0,160L0,0Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 100px, 100% 160px;
    background-position: top, top;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* Category header - bottom wave */
.page-category-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.5' d='M0,192L40,197.3C80,203,160,213,240,229.3C320,245,400,267,480,261.3C560,256,640,224,720,213.3C800,203,880,213,960,229.3C1040,245,1120,267,1200,266.7C1280,267,1360,245,1400,234.7L1440,224L1440,320L1400,320C1360,320,1280,320,1200,320C1120,320,1040,320,960,320C880,320,800,320,720,320C640,320,560,320,480,320C400,320,320,320,240,320C160,320,80,320,40,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-position: bottom;
    z-index: 0;
    pointer-events: none;
}

/* Category header - top wave accent (layered for depth) */
.page-category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 170px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.5' d='M0,0L1440,0L1440,48L1400,53.3C1360,59,1280,69,1200,80C1120,91,1040,101,960,90.7C880,80,800,48,720,42.7C640,37,560,59,480,74.7C400,91,320,101,240,90.7C160,80,80,48,40,32L0,16L0,0Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.3' d='M0,0L1440,0L1440,64L1400,69.3C1360,75,1280,85,1200,101.3C1120,117,1040,139,960,133.3C880,128,800,96,720,90.7C640,85,560,107,480,122.7C400,139,320,149,240,138.7C160,128,80,96,40,80L0,64L0,0Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 110px, 100% 170px;
    background-position: top, top;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* =====================================================
   Left/Right Page Wave Alignment for Book Spreads
   Left pages have waves rising toward center (right edge)
   Right pages have waves rising toward center (left edge)
   ===================================================== */

/* Left page (odd) - bottom waves flow right */
.catalogue-page.--left.page-products::before,
.page-products.--left::before {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.6' d='M0,288L80,277.3C160,267,320,245,480,240C640,235,800,245,960,256C1120,267,1280,277,1360,282.7L1440,288L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.4' d='M0,256L80,245.3C160,235,320,213,480,208C640,203,800,213,960,229.3C1120,245,1280,267,1360,277.3L1440,288L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 140px, 100% 200px;
    background-position: bottom, bottom;
    background-repeat: no-repeat;
}

/* Right page (even) - bottom waves flow left (mirrored) */
.catalogue-page:not(.--left).page-products::before {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.6' d='M0,288L80,282.7C160,277,320,267,480,256C640,245,800,235,960,240C1120,245,1280,267,1360,277.3L1440,288L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.4' d='M0,288L80,277.3C160,267,320,245,480,229.3C640,213,800,203,960,208C1120,213,1280,235,1360,245.3L1440,256L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 140px, 100% 200px;
    background-position: bottom, bottom;
    background-repeat: no-repeat;
}

/* Left page - category header bottom wave */
.catalogue-page.--left.page-category-header::after,
.page-category-header.--left::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.5' d='M0,256L80,250.7C160,245,320,235,480,234.7C640,235,800,245,960,256C1120,267,1280,277,1360,282.7L1440,288L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-position: bottom;
}

/* Right page - category header bottom wave (mirrored) */
.catalogue-page:not(.--left).page-category-header::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.5' d='M0,288L80,282.7C160,277,320,267,480,256C640,245,800,235,960,234.7C1120,235,1280,245,1360,250.7L1440,256L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-position: bottom;
}

/* Left page - intro bottom wave */
.catalogue-page.--left.page-intro::before,
.page-intro.--left::before {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.55' d='M0,288L80,277.3C160,267,320,245,480,240C640,235,800,245,960,261.3C1120,277,1280,299,1360,309.3L1440,320L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.4' d='M0,256L80,250.7C160,245,320,235,480,234.7C640,235,800,245,960,261.3C1120,277,1280,299,1360,309.3L1440,320L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 140px, 100% 190px;
    background-position: bottom, bottom;
    background-repeat: no-repeat;
}

/* Right page - intro bottom wave (mirrored) */
.catalogue-page:not(.--left).page-intro::before {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2364b5f6' fill-opacity='0.55' d='M0,320L80,309.3C160,299,320,277,480,261.3C640,245,800,235,960,240C1120,245,1280,267,1360,277.3L1440,288L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%2387ceeb' fill-opacity='0.4' d='M0,320L80,309.3C160,299,320,277,480,261.3C640,245,800,235,960,234.7C1120,235,1280,245,1360,250.7L1440,256L1440,320L1360,320C1280,320,1120,320,960,320C800,320,640,320,480,320C320,320,160,320,80,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 140px, 100% 190px;
    background-position: bottom, bottom;
    background-repeat: no-repeat;
}

/* Cover page wave decorations - bottom */
.page-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' fill-opacity='0.2' d='M0,288L48,272C96,256,192,224,288,213.3C384,203,480,213,576,229.3C672,245,768,267,864,261.3C960,256,1056,224,1152,213.3C1248,203,1344,213,1392,218.7L1440,224L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' fill-opacity='0.1' d='M0,256L48,240C96,224,192,192,288,181.3C384,171,480,181,576,197.3C672,213,768,235,864,229.3C960,224,1056,192,1152,181.3C1248,171,1344,181,1392,186.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 130px, 100% 180px;
    background-position: bottom, bottom;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* Cover page wave decorations - top */
.page-cover .cover-top-wave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' fill-opacity='0.15' d='M0,0L1440,0L1440,64L1400,69.3C1360,75,1280,85,1200,96C1120,107,1040,117,960,106.7C880,96,800,64,720,53.3C640,43,560,53,480,69.3C400,85,320,107,240,101.3C160,96,80,64,40,48L0,32L0,0Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-position: top;
    pointer-events: none;
}

/* =====================================================
   Page Header Branding Strip
   ===================================================== */
.page-products .page-title::before,
.page-category-header h2::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 3px;
    background: var(--catalogue-primary);
    margin-right: 0.75rem;
    vertical-align: middle;
}

/* =====================================================
   Enhanced Product Card Styling
   ===================================================== */
.product-card-image {
    position: relative;
}

/* Circular accent behind product images */
.product-card-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 50%;
    z-index: 0;
}

.product-card-image img,
.product-card-image .placeholder-image {
    position: relative;
    z-index: 1;
}

/* Better placeholder styling */
.product-card-image .placeholder-image {
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4ff 100%);
    border-radius: 8px;
}

.product-card-image .placeholder-image i {
    color: var(--catalogue-secondary);
    opacity: 0.7;
}

/* =====================================================
   Category Icon Enhancements
   ===================================================== */
.page-category-header .category-icon {
    box-shadow: 0 8px 25px rgba(247, 147, 30, 0.3);
    position: relative;
}

.page-category-header .category-icon::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px dashed rgba(247, 147, 30, 0.3);
    border-radius: 50%;
}

/* =====================================================
   Features List Enhancements (Intro Page)
   ===================================================== */
.page-intro .features-list li {
    background: linear-gradient(90deg, rgba(247, 147, 30, 0.05) 0%, transparent 100%);
    padding-left: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

/* =====================================================
   Back Cover Enhancements
   ===================================================== */
.page-cover-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(135, 206, 250, 0.15) 0%, transparent 100%);
    z-index: 0;
}

.page-cover-back .contact-info {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 280px;
}

/* Page Footer Branding - REMOVED (conflicted with wave backgrounds) */

/* =====================================================
   Enhanced Cover Styling
   ===================================================== */
.page-cover {
    position: relative;
}

/* Sun ray effect on cover */
.page-cover .cover-logo::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* =====================================================
   Certification Badges Styling
   ===================================================== */
.cert-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.cert-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: linear-gradient(135deg, var(--catalogue-primary) 0%, #ff8c00 100%);
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 3px 10px rgba(247, 147, 30, 0.3);
}

.cert-badge i {
    color: white;
    font-size: 0.85rem;
}

/* Back cover cert badges (dark background) */
.page-cover-back .cert-badge {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: none;
}

/* =====================================================
   Product Card Hover Effects
   ===================================================== */
.catalogue-product-card {
    transition: all 0.3s ease;
}

.catalogue-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 119, 190, 0.15);
}

.catalogue-product-card:hover .product-card-image::before {
    background: linear-gradient(135deg, #e6f3ff 0%, #cce5ff 100%);
}

/* =====================================================
   SPF Badge Styling
   ===================================================== */
.spf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--catalogue-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    box-shadow: 0 3px 10px rgba(247, 147, 30, 0.3);
}

/* =====================================================
   Better Typography
   ===================================================== */
.page-category-header h2,
.page-intro h2,
.page-cover h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-category-header p {
    position: relative;
    z-index: 1;
}

/* Product count styling */
.page-category-header .product-count {
    background: rgba(247, 147, 30, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    display: inline-block;
}
