/**
 * Fiji Kava E-shop - Shared CSS Styles
 * Based on brand manual colors
 */

/* Custom animations */
@keyframes slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

.animate-fade-out {
    animation: fade-out 0.3s ease-out forwards;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4ba9c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #EAA81F;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Typography */
body {
    font-family: 'Montserrat', sans-serif;
}

/* Product card hover effects */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

/* Cart drawer transition */
#cart-drawer {
    transition: transform 0.3s ease-in-out;
}

/* Button hover effects */
.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 168, 31, 0.4);
}

/* Navigation active state */
.nav-link.active {
    color: #EAA81F;
    border-bottom: 2px solid #EAA81F;
}

/* Form inputs */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #EAA81F;
    box-shadow: 0 0 0 3px rgba(234, 168, 31, 0.2);
}

/* Quantity input - hide arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Radio button custom styling */
.radio-card input:checked + .radio-content {
    border-color: #EAA81F;
    background-color: rgba(234, 168, 31, 0.05);
}

.radio-card input:checked + .radio-content .radio-dot {
    background-color: #EAA81F;
}

/* Checkbox custom styling */
.checkbox-custom:checked {
    background-color: #EAA81F;
    border-color: #EAA81F;
}

/* Star rating */
.star-rating .star {
    color: #d4ba9c;
}

.star-rating .star.filled {
    color: #EAA81F;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #EAA81F;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Toast notification */
.toast {
    animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile menu */
.mobile-menu {
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Image gallery */
.gallery-thumb {
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.gallery-thumb:hover {
    opacity: 1 !important;
}

.gallery-thumb.active {
    border-color: #EAA81F;
    opacity: 1;
}

/* Dark mode transitions */
.dark-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Badge pulse animation */
.badge-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Footer newsletter input */
.newsletter-input:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Product tag badges */
.tag-bestseller {
    background-color: #2A4D3E;
    color: white;
}

.tag-new {
    background-color: #EAA81F;
    color: #2A4D3E;
}

.tag-sale {
    background-color: #dc2626;
    color: white;
}

.tag-sold-out {
    background-color: #6b7280;
    color: white;
}

/* Cookie consent */
#cookie-consent-root {
    font-family: 'Montserrat', sans-serif;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    padding: 14px;
}

.cookie-banner.hidden,
.cookie-modal.hidden {
    display: none;
}

.cookie-banner__box {
    max-width: 980px;
    margin: 0 auto;
    background: #12161c;
    color: #ead8bc;
    border: 1px solid rgba(212, 186, 156, 0.35);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    padding: 18px;
}

.cookie-banner__title {
    margin: 0 0 6px;
    color: #ffffff;
    font-weight: 700;
}

.cookie-banner__text {
    margin: 0;
    color: rgba(212, 186, 156, 0.9);
    line-height: 1.5;
    font-size: 14px;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.cookie-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.cookie-btn--primary {
    background: #EAA81F;
    color: #1f1a12;
}

.cookie-btn--primary:hover {
    background: #f2b73f;
}

.cookie-btn--secondary {
    background: #2A4D3E;
    color: #fdfbf7;
}

.cookie-btn--secondary:hover {
    background: #356450;
}

.cookie-btn--ghost {
    background: transparent;
    color: #d4ba9c;
    border-color: rgba(212, 186, 156, 0.45);
}

.cookie-btn--ghost:hover {
    background: rgba(212, 186, 156, 0.12);
}

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.cookie-modal__card {
    position: relative;
    width: min(720px, calc(100% - 20px));
    margin: 7vh auto 0;
    background: #fcf8ef;
    color: #1f2937;
    border-radius: 16px;
    border: 1px solid rgba(42, 77, 62, 0.2);
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.cookie-modal__card h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.cookie-modal__intro {
    margin: 0 0 16px;
    color: #475569;
    line-height: 1.5;
    font-size: 14px;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border: 1px solid rgba(42, 77, 62, 0.18);
    border-radius: 12px;
    background: #fffdf8;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.cookie-option--locked {
    background: #f2ede1;
}

.cookie-option strong {
    display: block;
    margin-bottom: 2px;
}

.cookie-option small {
    color: #64748b;
    line-height: 1.45;
}

.cookie-option input[type="checkbox"] {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    accent-color: #2A4D3E;
}

.cookie-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .cookie-banner {
        padding: 10px;
    }

    .cookie-banner__box {
        padding: 14px;
    }

    .cookie-banner__actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    .cookie-modal__card {
        margin-top: 14px;
        padding: 16px;
    }

    .cookie-modal__actions {
        flex-direction: column;
    }
}

/* ==========================================================================
   Produktové fotky – vždy vyplní celé políčko do krajů (object-fit: cover),
   co přesahuje, se ořízne na střed. Celou fotku ukáže lightbox.
   ========================================================================== */
.product-media {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
}

.product-media__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-media--zoomable {
    cursor: zoom-in;
}

.product-media--zoomable:focus-visible {
    outline: 3px solid #EAA81F;
    outline-offset: -3px;
}

.product-zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: rgba(26, 26, 26, 0.68);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

/* ==========================================================================
   Lightbox – fotka produktu přes celou obrazovku (js/lightbox.js)
   ========================================================================== */
.fk-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1250;
    background: rgba(12, 14, 16, 0.95);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fk-lightbox.is-open {
    opacity: 1;
}

.fk-lightbox[hidden] {
    display: none;
}

.fk-lightbox__stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 80px;
    overflow: hidden;
    touch-action: pinch-zoom;
}

.fk-lightbox.is-zoomed .fk-lightbox__stage {
    touch-action: none;
}

.fk-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.fk-lightbox.is-zoomed .fk-lightbox__img {
    cursor: zoom-out;
}

.fk-lightbox.is-panning .fk-lightbox__img {
    transition: opacity 0.2s ease;
}

.fk-lightbox__img.is-loading {
    opacity: 0;
}

.fk-lightbox__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fk-lightbox__btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.fk-lightbox__btn:focus-visible {
    outline: 2px solid #EAA81F;
    outline-offset: 2px;
}

.fk-lightbox__btn[hidden] {
    display: none;
}

.fk-lightbox__close {
    top: 16px;
    right: 16px;
}

.fk-lightbox__prev,
.fk-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
}

.fk-lightbox__prev {
    left: 16px;
}

.fk-lightbox__next {
    right: 16px;
}

.fk-lightbox__counter {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
}

.fk-lightbox__hint {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fk-lightbox.is-zoomed .fk-lightbox__hint {
    opacity: 0;
}

@media (max-width: 640px) {
    .fk-lightbox__stage {
        padding: 64px 0 80px;
    }

    .fk-lightbox__prev,
    .fk-lightbox__next {
        top: auto;
        bottom: 16px;
        transform: none;
    }

    .fk-lightbox__hint {
        bottom: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fk-lightbox,
    .fk-lightbox__img {
        transition: none;
    }
}

/* Popis produktu – odstavce a odrážky z textu v adminu (produkt.html: renderDescription) */
.product-description p,
.product-description ul {
    margin: 0 0 0.85em;
}

.product-description > :last-child {
    margin-bottom: 0;
}

.product-description ul {
    padding: 0;
    list-style: none;
}

.product-description li {
    position: relative;
    padding-left: 1.25em;
    margin-bottom: 0.35em;
}

.product-description li::before {
    content: '';
    position: absolute;
    left: 0.2em;
    top: 0.62em;
    width: 0.4em;
    height: 0.4em;
    border-radius: 9999px;
    background: #EAA81F;
}

.fk-card-note {
    margin-top: 16px;
    border-radius: 10px;
    border: 1px solid rgba(212, 186, 156, 0.35);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

.dark .fk-card-note {
    color: #d1d5db;
    border-color: rgba(42, 77, 62, 0.6);
}

.fk-card-note .fk-pay-logos {
    margin-top: 8px;
}

/* ── Stránka výsledku platby (platba.html) ─────────────────────────── */
.fk-pay-status-icon {
    width: 96px;
    height: 96px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
}

.fk-pay-status-icon svg {
    width: 48px;
    height: 48px;
}

.fk-pay-status-icon--ok { background: #dcfce7; color: #16a34a; }
.fk-pay-status-icon--wait { background: #fef3c7; color: #d97706; }
.fk-pay-status-icon--fail { background: #fee2e2; color: #dc2626; }
.fk-pay-status-icon--info { background: #e5e7eb; color: #4b5563; }

.fk-spinner {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    border: 4px solid rgba(234, 168, 31, 0.25);
    border-top-color: #EAA81F;
    animation: fk-spin 0.9s linear infinite;
}

.fk-spinner--sm {
    width: 20px;
    height: 20px;
    border-width: 3px;
    border-color: rgba(42, 77, 62, 0.25);
    border-top-color: currentColor;
    flex-shrink: 0;
}

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

.fk-test-badge {
    display: inline-block;
    margin-bottom: 16px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

/* ── Administrace: stav úhrady objednávky ──────────────────────────── */
.fk-paybadge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.fk-paybadge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: currentColor;
}

.fk-paybadge--paid { background: #dcfce7; color: #166534; }
.fk-paybadge--unpaid { background: #fee2e2; color: #991b1b; }
.fk-paybadge--pending { background: #fef3c7; color: #92400e; }
.fk-paybadge--cod { background: #e0e7ff; color: #3730a3; }
.fk-paybadge--refunded { background: #e5e7eb; color: #374151; }

.fk-paybtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
}

.fk-paybtn:disabled { opacity: 0.6; cursor: wait; }
.fk-paybtn--primary { background: #16a34a; color: #ffffff; }
.fk-paybtn--primary:hover { background: #15803d; }
.fk-paybtn--ghost { background: #ffffff; color: #1f2937; border-color: #d1d5db; }
.fk-paybtn--ghost:hover { background: #f3f4f6; }
