/**
 * Photo Huber - Webalben Guest Portal Stylesheet
 */

:root {
    --primary: #D10031;
    --primary-hover: #b5002a;
    --primary-light: rgba(209, 0, 49, 0.08);
    --secondary: #2563eb;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
.album-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.album-header-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-area {
    display: flex;
    align-items: center;
}

.brand-header-logo {
    height: 36px;
    width: auto;
    max-height: 40px;
    object-fit: contain;
    display: block;
    background: #ffffff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Hero / Welcome section */
.album-hero {
    max-width: 1300px;
    margin: 25px auto 10px;
    padding: 0 20px;
    width: 100%;
}

.album-hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.album-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
}

.album-title-main {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.6px;
    color: #0f172a;
    margin-bottom: 6px;
}

.album-meta-line {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.album-meta-badge {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
}

.album-welcome-text {
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
    margin-top: 10px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 18px;
    border: 1px solid #f1f5f9;
}

/* Filter & Action Toolbar */
.album-toolbar {
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.view-filter-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tab.active {
    background: white;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.filter-tab .badge {
    background: rgba(0,0,0,0.08);
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11.5px;
}

.filter-tab.active .badge {
    background: var(--primary-light);
    color: var(--primary);
}

.action-buttons-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Standard Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(209, 0, 49, 0.25);
}

.btn-secondary {
    background: white;
    color: #334155;
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-success {
    background: #15803d;
    color: white;
}

.btn-success:hover {
    background: #166534;
}

/* Gallery Grid */
.gallery-container {
    max-width: 1300px;
    margin: 0 auto 50px;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.photo-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.photo-card-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}

.photo-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.photo-card:hover .photo-card-img-wrap img {
    transform: scale(1.03);
}

/* Heart Button on Card */
.btn-fav-card {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-fav-card:hover {
    transform: scale(1.15);
    background: white;
}

.btn-fav-card.active {
    color: #e11d48;
    background: white;
}

.card-overlay-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 12px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-card:hover .card-overlay-actions {
    opacity: 1;
}

.btn-card-action {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.45);
}

/* PIN Screen */
.pin-screen-container {
    max-width: 440px;
    margin: 80px auto;
    padding: 0 20px;
    width: 100%;
}

.pin-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 36px 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.pin-icon-wrap {
    width: 68px;
    height: 68px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 20px;
}

.pin-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 4px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin: 20px 0;
    font-family: monospace;
    transition: border-color 0.2s ease;
}

.pin-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Fullscreen Lightbox */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 29, 0.96);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.lightbox-topbar {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    z-index: 10;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
}

.lightbox-counter {
    font-size: 14px;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
    flex-shrink: 0;
}

.lightbox-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    user-select: none;
    box-sizing: border-box;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.lightbox-btn-close {
    font-size: 24px;
    line-height: 1;
    padding: 6px 14px;
    min-width: 40px;
    height: 38px;
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ffffff;
}

.lightbox-btn-close:hover {
    background: rgba(239, 68, 68, 0.6);
}

.lightbox-viewport {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px 60px;
    user-select: none;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Modals (Print Order Checkout) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    position: relative;
    padding: 24px 28px;
    animation: modalPop 0.25s ease forwards;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.modal-close-btn {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #334155;
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group select,
.form-group textarea,
#shipping-address-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #ffffff;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:not([type="radio"]):not([type="checkbox"]):focus,
.form-group select:focus,
.form-group textarea:focus,
#shipping-address-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(209, 0, 49, 0.1);
}

/* Radio Cards (Delivery & Scope) */
.radio-card-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.radio-card {
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    transition: all 0.2s ease;
    user-select: none;
}

.radio-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.radio-card input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    margin: 0;
    flex-shrink: 0;
}

.radio-card.active,
.radio-card:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: rgba(209, 0, 49, 0.03);
}

.scope-box {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.scope-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.scope-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
}

.scope-option input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    margin: 0;
}

/* Individual Order Items List */
.order-items-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    padding: 4px;
    margin-bottom: 16px;
}

.order-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease, opacity 0.2s ease;
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-item-row.is-zero {
    opacity: 0.45;
    background: #f8fafc;
}

.order-item-thumb {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    object-fit: cover;
    background: #0f172a;
    flex-shrink: 0;
}

.order-item-info {
    flex: 1;
    min-width: 0;
}

.order-item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.order-item-price {
    font-size: 12px;
    color: var(--text-muted);
}

.order-item-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.order-stepper-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    background: #f8fafc;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.order-stepper-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--primary);
}

.order-stepper-btn:active {
    transform: scale(0.95);
}

.order-stepper-input {
    width: 40px !important;
    height: 30px !important;
    padding: 0 !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    background: #ffffff !important;
    color: var(--text-main) !important;
    -moz-appearance: textfield;
}

.order-stepper-input::-webkit-outer-spin-button,
.order-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #111827;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastIn 0.3s ease forwards;
}

.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }
.toast.warning { background: #b45309; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.album-footer {
    border-top: 1px solid var(--border-color);
    background: white;
    padding: 24px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .album-hero-card {
        padding: 20px;
    }
    .album-title-main {
        font-size: 22px;
    }
    .lightbox-viewport {
        padding: 0 10px;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }

    /* Lightbox Mobile Topbar */
    .lightbox-topbar {
        padding: 10px 14px;
        gap: 8px;
    }
    .lightbox-counter {
        font-size: 13px;
        white-space: nowrap !important;
        flex-shrink: 0;
    }
    .lightbox-actions {
        gap: 6px;
        flex-shrink: 0;
    }
    .lightbox-btn {
        padding: 7px 10px;
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    /* Compact icon-only buttons on phones so nothing wraps or cuts off */
    .lightbox-topbar {
        padding: 8px 10px;
        gap: 6px;
    }
    .lightbox-counter {
        font-size: 12px;
        white-space: nowrap !important;
        flex-shrink: 0;
    }
    .lightbox-actions {
        gap: 5px;
    }
    .lightbox-btn {
        padding: 6px 8px;
        min-width: 38px;
        height: 38px;
        border-radius: 8px;
        font-size: 14px;
    }
    .lightbox-btn .lightbox-btn-label {
        display: none !important;
    }
    .lightbox-btn-close {
        font-size: 22px;
        min-width: 38px;
        height: 38px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .brand-header-logo {
        height: 28px;
        max-height: 32px;
    }
    .album-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .view-filter-tabs {
        width: 100%;
    }
    .filter-tab {
        flex: 1;
        justify-content: center;
    }
    .action-buttons-group {
        width: 100%;
    }
    .action-buttons-group .btn {
        flex: 1;
    }
}

/* Embedded Mode (Divi / WordPress / iFrames) */
html.is-embedded,
body.is-embedded {
    background: transparent !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
}

body.is-embedded .album-header {
    display: none !important;
}

body.is-embedded #album-main-screen {
    flex: none !important;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
    padding-bottom: 20px !important;
}

body.is-embedded .gallery-container {
    margin-bottom: 0 !important;
    padding-bottom: 35px !important;
}

body.is-embedded .album-hero {
    padding: 15px 15px 0;
}

body.is-embedded .album-footer {
    display: none !important;
}

body.is-embedded .modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    height: auto !important;
    align-items: flex-start !important;
    padding-top: 20px !important;
    padding-bottom: 50px !important;
}

body.is-embedded .modal-box {
    max-height: none !important;
    overflow-y: visible !important;
}
