* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    box-sizing: border-box;
}

body {
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

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

.animate-scaleIn {
    animation: scaleIn 0.2s ease-out;
}

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

.animate-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Buttons and links */
button, a {
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

button:active, a:active {
    transform: scale(0.96);
}

button:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Cards */
.product-card, .category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:active, .category-card:active {
    transform: scale(0.98);
}

/* Inputs */
input, textarea, select {
    font-size: 16px !important;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #8F2D29;
    box-shadow: 0 0 0 3px rgba(143, 45, 41, 0.1);
}

input[type="radio"], input[type="checkbox"] {
    accent-color: #8F2D29;
}

/* Text */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Toast notifications */
.app-toast {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Cart counter animation */
.cart-counter {
    transition: transform 0.2s ease;
}

.cart-counter.bump {
    animation: bump 0.3s ease;
}

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

/* Page transitions */
main {
    animation: fadeIn 0.25s ease-out;
}

/* Category grid items */
.category-item {
    animation: scaleIn 0.3s ease-out;
    animation-fill-mode: both;
}

.category-item:nth-child(1) { animation-delay: 0.02s; }
.category-item:nth-child(2) { animation-delay: 0.04s; }
.category-item:nth-child(3) { animation-delay: 0.06s; }
.category-item:nth-child(4) { animation-delay: 0.08s; }
.category-item:nth-child(5) { animation-delay: 0.1s; }
.category-item:nth-child(6) { animation-delay: 0.12s; }
.category-item:nth-child(7) { animation-delay: 0.14s; }
.category-item:nth-child(8) { animation-delay: 0.16s; }
.category-item:nth-child(9) { animation-delay: 0.18s; }
.category-item:nth-child(n+10) { animation-delay: 0.2s; }

/* Product grid items */
.product-item {
    animation: slideUp 0.3s ease-out;
    animation-fill-mode: both;
}

.product-item:nth-child(1) { animation-delay: 0.02s; }
.product-item:nth-child(2) { animation-delay: 0.04s; }
.product-item:nth-child(3) { animation-delay: 0.06s; }
.product-item:nth-child(4) { animation-delay: 0.08s; }
.product-item:nth-child(n+5) { animation-delay: 0.1s; }

/* Bottom nav active state */
.bottom-nav-item.active {
    color: #8F2D29;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
}

/* Safe areas */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .safe-bottom {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* Pastel backgrounds */
.bg-pastel-cream { background-color: #FFF8E4; }
.bg-pastel-green { background-color: #E8FCEA; }
.bg-pastel-orange { background-color: #FDF0E2; }
.bg-pastel-pink { background-color: #FFEBEB; }
.bg-pastel-blue { background-color: #E9F0FC; }
.bg-pastel-purple { background-color: #F3E9FB; }

/* Image loading */
img {
    transition: opacity 0.3s ease;
}

img.loading {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}
