/* CubaShopy - Custom CSS */

/* ===========================
   CUSTOM TAILWIND CONFIG
=========================== */
:root {
    --primary: #137fec;
    --primary-hover: #0f6fd1;
    --bg-dark: #101922;
    --surface-dark: #1c2630;
    --border-dark: #2a3441;
    --text-secondary: #8898a4;
}

/* ===========================
   SCROLLBAR
=========================== */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) transparent;
}
*::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 99px;
}
.scrollbar-hide {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ===========================
   SAFE AREA (PWA / Mobile)
=========================== */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pt-safe {
    padding-top: env(safe-area-inset-top, 0px);
}

/* ===========================
   ANIMATIONS
=========================== */
@keyframes bounceIn {
    0%   { transform: scale(0.3); opacity: 0; }
    50%  { transform: scale(1.05); opacity: 1; }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
    0%   { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}
@keyframes shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.animate-bounce-in  { animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; }
.animate-fade-in    { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up   { animation: slideUp 0.4s ease forwards; }

/* ===========================
   SKELETON LOADING
=========================== */
.skeleton {
    background: linear-gradient(90deg, #1c2630 25%, #253040 50%, #1c2630 75%);
    background-size: 400px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}

/* ===========================
   PRODUCT CARD
=========================== */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
    transform: translateY(-2px);
}

/* ===========================
   IMAGE GALLERY
=========================== */
.gallery-thumb {
    transition: opacity 0.15s, border-color 0.15s;
    cursor: pointer;
}
.gallery-thumb:hover { opacity: 0.8; }
.gallery-thumb.active {
    border-color: var(--primary);
    opacity: 1;
}

/* ===========================
   STARS
=========================== */
.star-btn {
    cursor: pointer;
    transition: transform 0.1s;
    font-variation-settings: 'FILL' 0;
}
.star-btn:hover,
.star-btn.filled {
    color: #f59e0b;
    font-variation-settings: 'FILL' 1;
    transform: scale(1.15);
}

/* ===========================
   CHAT
=========================== */
.chat-bubble {
    max-width: 75%;
    word-break: break-word;
}
.chat-bubble-mine {
    background: var(--primary);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}
.chat-bubble-other {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 18px 18px 18px 4px;
}

/* ===========================
   BADGE PULSE (notifications)
=========================== */
.badge-pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.5;
    animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===========================
   MODAL BACKDROP
=========================== */
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ===========================
   TOAST NOTIFICATIONS
=========================== */
#toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease forwards;
    pointer-events: auto;
    white-space: nowrap;
}
.toast-success { background: #22c55e; color: #fff; }
.toast-error   { background: #ef4444; color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }

/* ===========================
   BOTTOM NAV ACTIVE
=========================== */
.bottom-nav-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
    color: var(--primary);
}
.bottom-nav-item.active span:last-child {
    color: var(--primary);
}

/* ===========================
   PRICE BADGE
=========================== */
.price-badge {
    background: linear-gradient(135deg, var(--primary), #0f6fd1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================
   CATEGORY PILLS - SCROLL
=========================== */
.category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

/* ===========================
   IMAGE UPLOAD SLOTS
=========================== */
.img-slot {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 2px dashed var(--border-dark);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-slot:hover { border-color: var(--primary); }
.img-slot img   { object-fit: cover; width: 100%; height: 100%; }
.img-slot .remove-btn {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px; height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

/* ===========================
   FORM FOCUS RING
=========================== */
input:focus, textarea:focus, select:focus {
    outline: none;
}

/* ===========================
   DARK MODE TWEAKS
=========================== */
.dark ::selection {
    background: rgba(19, 127, 236, 0.3);
    color: #fff;
}
.dark img {
    color: transparent; /* hide alt text on broken imgs */
}

/* ===========================
   RESPONSIVE HELPERS
=========================== */
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
}
@media (min-width: 641px) {
    .show-mobile-only { display: none !important; }
}
