/* 아시아푸드원 커스텀 스타일 */

/* 안전영역 (iPhone notch) */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

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

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

/* 토스트 메시지 자동 사라짐 */
.toast-message {
    animation: fadeIn 0.3s ease-out, fadeOut 0.3s ease-out 3s forwards;
}

/* 배너 슬라이더 */
.banner-slider {
    overflow: hidden;
    position: relative;
    touch-action: pan-y;
}

.banner-track {
    display: flex;
    transition: transform 0.5s ease;
}

.banner-slide {
    min-width: 100%;
    flex-shrink: 0;
}

.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.banner-dot.active {
    background: white;
    width: 20px;
    border-radius: 4px;
}

/* 상품 카드 */
.product-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card .product-image {
    aspect-ratio: 1;
    overflow: hidden;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

/* 할인 뱃지 */
.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #dc2626;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 상품 뱃지 */
.product-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
}

/* 수량 선택기 */
.qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.qty-selector button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    user-select: none;
}

.qty-selector button:active {
    background: #e5e7eb;
}

.qty-selector input {
    width: 48px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
}

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

/* 탭 메뉴 */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-nav a,
.tab-nav button {
    padding: 12px 16px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-nav a.active,
.tab-nav button.active {
    color: #dc2626;
    border-bottom-color: #dc2626;
    font-weight: 700;
}

/* 스켈레톤 로딩 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* 스크롤바 숨기기 (카테고리 스크롤) */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* 모달 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

/* 이미지 확대 */
.img-zoom {
    cursor: zoom-in;
}

.img-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.img-zoom-overlay img {
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
}

/* 폼 스타일 */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.form-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}

/* 별점 */
.star-rating {
    display: flex;
    gap: 2px;
}

.star-rating .star {
    font-size: 18px;
    cursor: pointer;
    color: #d1d5db;
}

.star-rating .star.active {
    color: #fbbf24;
}

/* 로딩 스피너 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* 상품 수평 스크롤 */
.product-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.product-scroll>* {
    scroll-snap-align: start;
    flex-shrink: 0;
}