/* Size picker modal + add-to-cart burst animation */
.add-to-cart-btn--pulse {
    animation: fdt-cart-pulse 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes fdt-cart-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.fdt-size-burst {
    position: fixed;
    z-index: 10050;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--light-green, #50c787);
    color: var(--dark-green, #031c12);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(80, 199, 135, 0.45);
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.35);
    opacity: 0;
}

.fdt-size-burst svg {
    width: 22px;
    height: 22px;
}

.fdt-size-burst.is-active {
    animation: fdt-size-burst 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fdt-size-burst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.35);
    }
    55% {
        opacity: 1;
        transform: translate(-50%, -58%) scale(1.12);
    }
    100% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(1);
    }
}

.fdt-size-overlay {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(3, 28, 18, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.fdt-size-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.fdt-size-modal {
    width: min(420px, calc(100vw - 28px));
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(80, 199, 135, 0.35);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(3, 28, 18, 0.28);
    padding: 22px 20px 20px;
    transform: translateY(28px) scale(0.94);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
}

.fdt-size-overlay.is-open .fdt-size-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

html[data-theme="dark"] .fdt-size-modal {
    background: rgba(8, 24, 18, 0.96);
    border-color: rgba(80, 199, 135, 0.25);
    color: #f4f3ed;
}

.fdt-size-modal__head {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.fdt-size-modal__thumb {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    background: #f0f0eb;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.fdt-size-modal__title {
    font-weight: 900;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--dark-green, #031c12);
    margin: 0 0 4px;
}

html[data-theme="dark"] .fdt-size-modal__title {
    color: #fff;
}

.fdt-size-modal__hint {
    margin: 0;
    font-size: 0.88rem;
    color: #666;
    font-weight: 600;
}

html[data-theme="dark"] .fdt-size-modal__hint {
    color: #b8c9bf;
}

.fdt-size-modal__close {
    margin-inline-start: auto;
    align-self: flex-start;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(3, 28, 18, 0.06);
    color: #444;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

html[data-theme="dark"] .fdt-size-modal__close {
    background: rgba(255, 255, 255, 0.08);
    color: #ddd;
}

.fdt-size-modal__label {
    font-weight: 800;
    font-size: 0.92rem;
    margin: 0 0 10px;
    color: var(--mid-green, #0b6e4f);
}

.fdt-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.fdt-size-option {
    min-width: 3.25rem;
    padding: 12px 16px;
    border: 2px solid rgba(11, 110, 79, 0.2);
    border-radius: 14px;
    background: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s, background 0.2s, color 0.2s;
    font-family: inherit;
    color: var(--dark-green, #031c12);
}

.fdt-size-option:hover:not(:disabled) {
    border-color: var(--light-green, #50c787);
    transform: translateY(-2px);
}

.fdt-size-option.is-selected {
    border-color: var(--dark-green, #031c12);
    background: var(--dark-green, #031c12);
    color: #fff;
}

.fdt-size-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
}

html[data-theme="dark"] .fdt-size-option {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(80, 199, 135, 0.2);
    color: #fff;
}

html[data-theme="dark"] .fdt-size-option.is-selected {
    background: var(--light-green, #50c787);
    border-color: var(--light-green, #50c787);
    color: var(--dark-green, #031c12);
}

.fdt-size-modal__actions {
    display: flex;
    gap: 10px;
}

.fdt-size-modal__btn {
    flex: 1;
    min-height: 48px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fdt-size-modal__btn--ghost {
    background: transparent;
    border: 2px solid rgba(11, 110, 79, 0.25);
    color: var(--dark-green, #031c12);
}

html[data-theme="dark"] .fdt-size-modal__btn--ghost {
    border-color: rgba(80, 199, 135, 0.45);
    color: var(--light-green, #50c787);
}

html[data-theme="dark"] .fdt-size-modal__btn--ghost:hover {
    background: rgba(80, 199, 135, 0.12);
    border-color: var(--light-green, #50c787);
    color: var(--light-green, #50c787);
}

.fdt-size-modal__btn--primary {
    background: var(--light-green, #50c787);
    color: var(--dark-green, #031c12);
    box-shadow: 0 10px 24px rgba(80, 199, 135, 0.35);
}

.fdt-size-modal__btn--primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.fdt-size-modal__btn--primary:not(:disabled):hover {
    transform: translateY(-2px);
}

.fdt-size-modal__btn--primary svg {
    width: 20px;
    height: 20px;
}

/* Featured / shop category pill */
.product-category-badge {
    display: inline-block;
    margin: 0 auto 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(80, 199, 135, 0.17);
    color: var(--mid-green, #0b6e4f);
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.2;
}

.products-section .product-category-badge {
    background: rgba(255, 255, 255, 0.14);
    color: var(--light-green, #50c787);
}

/* Checkout size dropdown */
.checkout-size-select {
    margin-top: 6px;
    width: 100%;
    max-width: 140px;
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 2px solid rgba(11, 110, 79, 0.25);
    background: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark-green, #031c12);
    cursor: pointer;
}

html[data-theme="dark"] .checkout-size-select {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(80, 199, 135, 0.3);
    color: #fff;
}

.order-item-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 4px;
}

.order-item-meta-row .checkout-size-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #666;
}

@media (prefers-reduced-motion: reduce) {
    .fdt-size-burst,
    .add-to-cart-btn--pulse,
    .fdt-size-overlay,
    .fdt-size-modal {
        animation: none !important;
        transition: none !important;
    }
}
