/**
 * Boekenwinkel Shop Styles
 * Modern Bootstrap 5 overrides with gradient accents
 * STANDALONE - Isolates shop from theme styling
 */

:root {
    --bw-green: #006600;
    --bw-green-dark: #004d00;
    --bw-green-light: #008800;
    --bw-green-lighter: #00aa00;
    --bw-gray-light: #f8f9fa;
    --bw-gray-border: #dee2e6;
    --bw-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --bw-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --bw-shell-admin-offset: 0px;
}

header {
    height: auto !important;
}

/* ============================================================================
   THEME ISOLATION - Reset theme styles on shop pages
   ============================================================================ */

.bw-shop-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%) !important;
    color: #212529 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    --bw-shell-header-height: 0px;
    --bw-shell-header-offset: 0px;
    --bw-shell-footer-height: 0px;
    --bw-shell-main-padding: 3rem;
}

.bw-shop-page * {
    box-sizing: border-box;
}

/* Hide theme elements and print badge */
.bw-shop-page .site-header,
.bw-shop-page .site-footer,
.bw-shop-page #sidebar,
.bw-shop-page .widget,
.bw-shop-page .printfriendly,
.printfriendly {
    display: none !important;
}

/* ============================================================================
   LAYOUT - APPLICATION SHELL
   ============================================================================ */

.bw-app-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--bw-shell-main-padding) 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.bw-app-main>.container {
    flex: 1 0 auto;
}

@media (max-width: 768px) {
    .bw-shop-page {
        --bw-shell-main-padding: 2.5rem;
    }
}

@media (max-width: 576px) {
    .bw-shop-page {
        --bw-shell-main-padding: 2rem;
    }
}

/* ============================================================================
   CONTENT AREA
   ============================================================================ */

.bw-shop-content {
    min-height: 60vh;
}

/* Page content from WordPress */
.bw-page-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--bw-shadow);
    margin-bottom: 2rem;
    border-left: 4px solid var(--bw-green);
}

.bw-page-content p {
    line-height: 1.8;
    color: #495057;
}

/* ============================================================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================================================ */

.btn-success {
    background: linear-gradient(135deg, var(--bw-green) 0%, var(--bw-green-light) 100%);
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 102, 0, 0.2);
    transition: all 0.2s ease;
}

.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(135deg, var(--bw-green-dark) 0%, var(--bw-green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.3);
}

.btn-success:active {
    transform: translateY(0);
}

.btn-outline-success {
    color: var(--bw-green);
    border-color: var(--bw-green);
    border-width: 2px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-success:hover {
    background: linear-gradient(135deg, var(--bw-green) 0%, var(--bw-green-light) 100%);
    border-color: var(--bw-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--bw-shadow-hover);
}

/* ============================================================================
   HEADER & FOOTER REFINEMENTS
   ============================================================================ */

.bw-app-header {
    position: sticky;
    top: var(--bw-shell-admin-offset, 0px);
    z-index: 20;
    flex: 0 0 auto;
    margin-bottom: 0;
}

.bw-app-header__bar {
    background: linear-gradient(135deg, var(--bw-green-dark) 0%, var(--bw-green) 45%, var(--bw-green-light) 100%);
    color: #fff;
    box-shadow: var(--bw-shadow);
    border-radius: 0;
}

.bw-app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
}

.bw-app-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: inherit;
    text-decoration: none;
}

.bw-app-header__logo {
    font-size: 2rem;
    line-height: 1;
}

.bw-app-header__brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
}

.bw-app-header__brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.bw-app-header__brand-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}

.bw-app-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bw-app-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.bw-app-nav-link:hover,
.bw-app-nav-link:focus {
    /* background: rgba(255, 255, 255, 0.22); */
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.bw-app-nav-link--cart {
    padding-right: 1rem;
}

.bw-app-nav-link__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #fff;
    color: var(--bw-green);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    margin-left: 0.25rem;
}

.bw-app-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    flex: 0 0 auto;
    margin-top: 0;
}

.bw-app-footer__bar {
    background: linear-gradient(135deg, var(--bw-green-dark) 0%, var(--bw-green) 100%);
    color: #fff;
    padding: 1.1rem 0;
    border-radius: 0;
}

.bw-app-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.bw-app-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bw-app-footer__title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.bw-app-footer__subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

.bw-app-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

.bw-app-footer__link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    position: relative;
}

.bw-app-footer__link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.2rem;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.bw-app-footer__link:hover::after,
.bw-app-footer__link:focus::after {
    transform: scaleX(1);
}

@media (max-width: 768px) {
    .bw-app-header__bar {
        padding: 0.85rem 0;
    }

    .bw-app-header__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .bw-app-header__brand {
        justify-content: center;
    }

    .bw-app-header__brand-text {
        align-items: center;
    }

    .bw-app-header__actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .bw-app-header__actions .bw-app-nav-link:first-child {
        display: none;
    }

    .bw-app-nav-link--cart {
        position: fixed;
        right: 1.25rem;
        bottom: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
        padding: 0;
        border: 2px solid rgba(255, 255, 255, 0.85);
        border-radius: 50%;
        background: linear-gradient(135deg, var(--bw-green-dark) 0%, var(--bw-green) 60%, var(--bw-green-light) 100%);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
        z-index: 1200;
        transform: translate3d(0, 0, 0);
        will-change: transform, box-shadow;
        transition: box-shadow 0.25s ease, border-color 0.25s ease;
    }

    .bw-app-nav-link--cart::before {
        content: "";
        display: block;
        width: 1.6rem;
        height: 1.6rem;
        background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M7 18c-.83 0-1.54.5-1.84 1.22-.3.73-.11 1.57.46 2.12.57.55 1.4.68 2.11.35.71-.32 1.17-1.03 1.17-1.83 0-1.1-.9-2-2-2zm10 0c-.83 0-1.54.5-1.84 1.22-.3.73-.11 1.57.46 2.12.57.55 1.4.68 2.11.35.71-.32 1.17-1.03 1.17-1.83 0-1.1-.9-2-2-2zM7.16 14h9.68c.75 0 1.41-.51 1.58-1.24l1.44-6.22C19.96 5.6 19.29 5 18.5 5h-12l-.27-1.2C6.08 3.31 5.56 3 5 3H3v2h1.6l2.4 10.4c.17.74.83 1.26 1.57 1.26z'/%3E%3C/svg%3E");
    }

    .bw-app-nav-link--cart span:first-child {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .bw-app-nav-link--cart .bw-app-nav-link__badge {
        position: absolute;
        top: -0.2rem;
        right: -0.2rem;
        min-width: 1.3rem;
        height: 1.3rem;
        padding: 0 0.35rem;
        font-size: 0.7rem;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
        border: 2px solid var(--bw-green-dark);
    }

    .bw-app-nav-link--cart:hover,
    .bw-app-nav-link--cart:focus {
        box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
        border-color: rgba(255, 255, 255, 0.95);
        animation: bw-cart-fab-hover 0.45s ease forwards;
    }

    .bw-app-nav-link--cart:active {
        animation: none;
        transform: translate3d(0, 0, 0);
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
    }

    .bw-app-nav-link--cart:focus-visible {
        outline: 3px solid rgba(255, 255, 255, 0.85);
        outline-offset: 4px;
    }

    @keyframes bw-cart-fab-hover {
        0% {
            transform: translate3d(0, 0, 0) scale(1);
        }

        50% {
            transform: translate3d(0, -4px, 0) scale(1.05);
        }

        100% {
            transform: translate3d(0, 0, 0) scale(1);
        }
    }

    .bw-app-nav-link {
        flex: 1 1 45%;
        justify-content: center;
    }

    .bw-cart-page .bw-app-nav-link--cart,
    .bw-confirm-page .bw-app-nav-link--cart {
        display: none !important;
    }

    .bw-app-footer {
        position: static;
    }

    .bw-app-footer__bar {
        padding: 0.9rem 0;
    }

    .bw-app-footer__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .bw-app-header__inner {
        gap: 0.6rem;
    }

    .bw-app-nav-link {
        flex-basis: 100%;
    }

    .bw-app-footer__links {
        justify-content: center;
    }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .bw-app-nav-link--cart {
        transition: box-shadow 0.25s ease;
    }

    .bw-app-nav-link--cart:hover,
    .bw-app-nav-link--cart:focus {
        animation: none;
    }
}

/* ============================================================================
   CARDS & BOOK ITEMS (for Phase 2)
   ============================================================================ */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--bw-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    /* transform: translateY(-4px); */
    box-shadow: var(--bw-shadow-hover);
}

.card-img-top {
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table {
    border-radius: 0;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 102, 0, 0.05);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* ============================================================================
   PRICING TIERS TABLE
   ============================================================================ */

.pricing-tiers .card {
    overflow: hidden;
}

.pricing-tiers .card-header {
    background: linear-gradient(135deg, var(--bw-green) 0%, var(--bw-green-light) 100%) !important;
}

/* ============================================================================
   BOOK GRID
   ============================================================================ */

.bw-card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.bw-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--bw-shadow-hover);
}

.bw-card-hover .card-img-top {
    transition: transform 0.3s ease;
}

.bw-card-hover:hover .card-img-top {
    transform: scale(1.05);
}

.bw-card-hover .card-title a {
    transition: color 0.2s ease;
}

.bw-card-hover:hover .card-title a {
    color: var(--bw-green) !important;
}

.bw-card-hover .btn {
    transition: all 0.2s ease;
}

.bw-card-hover:hover .btn {
    background: linear-gradient(135deg, var(--bw-green-dark) 0%, var(--bw-green) 100%);
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */

.alert {
    border-radius: 12px;
    border: none;
    box-shadow: var(--bw-shadow);
}

.alert-info {
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e9ff 100%);
    color: #004085;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--bw-green);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 576px) {
    .bw-page-content {
        padding: 1rem;
        border-radius: 8px;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.bw-gradient-text {
    background: linear-gradient(135deg, var(--bw-green) 0%, var(--bw-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bw-card-hover {
    transition: all 0.3s ease;
}

.bw-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--bw-shadow-hover);
}