/* Guest store (/store) — card grid: 2 columns on phone, 3 on md, 4 on lg */

.guest-store .store-tab-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.25rem;
}

.guest-store .store-tab-bar .tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 7.5rem;
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background-color: #e5e7eb;
    color: #1f2937;
    font-size: clamp(0.78rem, 2.5vw, 0.95rem);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.guest-store .store-tab-bar .tab-button:hover {
    background-color: #d1d5db;
    border-color: #94a3b8;
    color: #111827;
}

.guest-store .store-tab-bar .tab-button.border-primary,
.guest-store .store-tab-bar .tab-button.bg-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

.guest-store .store-tab-bar .tab-button.text-white {
    color: #ffffff !important;
}

@media (max-width: 575.98px) {
    .guest-store .store-tab-bar {
        flex-direction: column;
        max-width: 100%;
    }

    .guest-store .store-tab-bar .tab-button {
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
        white-space: normal;
    }
}

.guest-store .store-item-card {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.guest-store .store-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
    border-color: rgba(15, 23, 42, 0.12);
}

.guest-store .store-item-card .card-body {
    text-align: center;
    padding: 0.75rem 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .guest-store .store-item-card .card-body {
        padding: 1rem 1rem 1.1rem;
    }
}

.guest-store .store-item-card__media {
    aspect-ratio: 4 / 3;
    max-height: 140px;
    padding: 0.4rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 768px) {
    .guest-store .store-item-card__media {
        max-height: 180px;
        padding: 0.65rem;
    }
}

.guest-store .store-item-card__img {
    max-height: 118px !important;
    object-fit: contain;
}

@media (min-width: 768px) {
    .guest-store .store-item-card__img {
        max-height: 168px !important;
    }
}

.guest-store .store-item-card__placeholder {
    width: 100%;
    min-height: 100%;
    aspect-ratio: 4 / 3;
    max-height: 140px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px dashed rgba(148, 163, 184, 0.45);
}

.guest-store .store-item-card__title {
    font-size: clamp(0.78rem, 2.6vw, 1.05rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guest-store .store-item-card__meta {
    font-size: 0.72rem;
    line-height: 1.2;
}

@media (min-width: 576px) {
    .guest-store .store-item-card__meta {
        font-size: 0.8rem;
    }
}

.guest-store .store-item-card__desc {
    font-size: 0.68rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0;
    margin-bottom: 0.35rem;
}

@media (min-width: 576px) {
    .guest-store .store-item-card__desc {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
    }
}

.guest-store .store-item-card__price {
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    color: #0f172a;
}

@media (min-width: 576px) {
    .guest-store .store-item-card__price {
        font-size: 1rem;
    }
}

/* Cart toggle — unified checkbox + label button */
.guest-store .store-cart-toggle {
    position: relative;
    width: 100%;
}

.guest-store .store-cart-toggle__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.guest-store .store-cart-toggle__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0;
    border: 1.5px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: clamp(0.68rem, 2.4vw, 0.84rem);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.guest-store .store-cart-toggle__label:hover {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

.guest-store .store-cart-toggle__icon {
    position: relative;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #94a3b8;
    border-radius: 5px;
    background: #ffffff;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.guest-store .store-cart-toggle__icon::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    opacity: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.guest-store .store-cart-toggle__input:checked + .store-cart-toggle__label {
    background: rgba(37, 99, 235, 0.08);
    border-color: #2563eb;
    color: #1d4ed8;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
}

.guest-store .store-cart-toggle__input:checked + .store-cart-toggle__label .store-cart-toggle__icon {
    background: #2563eb;
    border-color: #2563eb;
}

.guest-store .store-cart-toggle__input:checked + .store-cart-toggle__label .store-cart-toggle__icon::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

.guest-store .store-cart-toggle__input:focus-visible + .store-cart-toggle__label {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.guest-store .store-cart-toggle__input:disabled + .store-cart-toggle__label {
    opacity: 0.65;
    cursor: wait;
    pointer-events: none;
}

/* Neutralize legacy icon-container rules inside guest store */
.guest-store .icon-container img {
    height: auto;
    width: 100%;
}

/* Selected / in-cart */
.guest-store .store-item-card:has(.store-cart-toggle__input:checked),
.guest-store .store-item-card.selected {
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.55) 0%, rgba(255, 255, 255, 0.98) 55%) !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12) !important;
}

.guest-store .store-item-card.selected:hover,
.guest-store .store-item-card:has(.store-cart-toggle__input:checked):hover {
    transform: translateY(-3px);
}

/* Fly-to-cart animation */
.store-fly-item {
    position: fixed;
    z-index: 10050;
    pointer-events: none;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    will-change: transform, opacity;
}

@keyframes store-cart-bump {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.28);
    }
    100% {
        transform: scale(1);
    }
}

#cart-icon-fly-target.cart-fly-bump .fa-shopping-cart {
    display: inline-block;
    animation: store-cart-bump 0.42s ease;
}

body.theme-dark.guest-dashboard .guest-store .store-item-card {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
}

body.theme-dark.guest-dashboard .guest-store .store-item-card__price {
    color: #f8fafc;
}

body.theme-dark.guest-dashboard .guest-store .store-item-card__media {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: rgba(148, 163, 184, 0.15);
}

body.theme-dark.guest-dashboard .guest-store .store-cart-toggle__label {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

body.theme-dark.guest-dashboard .guest-store .store-cart-toggle__icon {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.5);
}

body.theme-dark.guest-dashboard .guest-store .store-cart-toggle__input:checked + .store-cart-toggle__label {
    background: rgba(37, 99, 235, 0.2);
    border-color: #3b82f6;
    color: #93c5fd;
}

.guest-store .store-action-btn,
.guest-store a.store-action-btn {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    font-weight: 600;
}

.guest-store .store-action-btn:hover,
.guest-store a.store-action-btn:hover {
    background-color: #15803d !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}
