/* ==========================================================================
   RAOVAT49 DESIGN SYSTEM v2.0
   Black / White / Gray + Green #00B14F accent
   Clean + Modern + Content-first + Responsive + Professional
   ========================================================================== */

/* ============ CSS VARIABLES ============ */
:root {
    /* Brand */
    --rv-accent: #00B14F;
    --rv-accent-hover: #009a44;
    --rv-accent-light: #e6f7ee;
    --rv-accent-dark: #008c3f;

    /* Light Theme (Default) */
    --rv-bg: #FFFFFF;
    --rv-bg-secondary: #F7F7F7;
    --rv-bg-tertiary: #EFEFEF;
    --rv-surface: #FFFFFF;
    --rv-text: #111111;
    --rv-text-secondary: #444444;
    --rv-muted: #666666;
    --rv-border: #E5E5E5;
    --rv-border-light: #F0F0F0;
    --rv-divider: #E5E5E5;

    /* Semantic */
    --rv-error: #DC3545;
    --rv-success: #00B14F;
    --rv-warning: #FFC107;
    --rv-info: #0D6EFD;

    /* Spacing */
    --rv-space-xs: 4px;
    --rv-space-sm: 8px;
    --rv-space-md: 16px;
    --rv-space-lg: 24px;
    --rv-space-xl: 32px;
    --rv-space-2xl: 48px;
    --rv-space-3xl: 64px;

    /* Typography */
    --rv-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rv-font-mono: 'SF Mono', 'Fira Code', monospace;
    --rv-text-xs: 0.75rem;
    --rv-text-sm: 0.8125rem;
    --rv-text-base: 0.9375rem;
    --rv-text-lg: 1.0625rem;
    --rv-text-xl: 1.25rem;
    --rv-text-2xl: 1.5rem;
    --rv-text-3xl: 2rem;
    --rv-line-height: 1.6;

    /* Radius */
    --rv-radius-sm: 6px;
    --rv-radius-md: 10px;
    --rv-radius-lg: 14px;
    --rv-radius-xl: 18px;
    --rv-radius-full: 9999px;

    /* Shadows */
    --rv-shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --rv-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --rv-shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
    --rv-shadow-lg: 0 10px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.04);
    --rv-shadow-xl: 0 20px 40px rgba(0,0,0,.1);

    /* Transitions */
    --rv-transition: 150ms ease;
    --rv-transition-slow: 250ms ease;

    /* Z-index */
    --rv-z-dropdown: 100;
    --rv-z-sticky: 200;
    --rv-z-overlay: 300;
    --rv-z-modal: 400;
    --rv-z-toast: 500;

    /* Layout */
    --rv-header-height: 60px;
    --rv-sidebar-width: 300px;
    --rv-container-max: 1200px;
}

/* Dark Theme */
[data-theme="dark"] {
    --rv-bg: #0F0F0F;
    --rv-bg-secondary: #181818;
    --rv-bg-tertiary: #1E1E1E;
    --rv-surface: #212121;
    --rv-text: #FFFFFF;
    --rv-text-secondary: #D0D0D0;
    --rv-muted: #AAAAAA;
    --rv-border: #303030;
    --rv-border-light: #282828;
    --rv-divider: #303030;

    --rv-accent-light: #1a3a28;
    --rv-shadow-xs: 0 1px 2px rgba(0,0,0,.2);
    --rv-shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --rv-shadow-md: 0 4px 6px rgba(0,0,0,.3);
    --rv-shadow-lg: 0 10px 25px rgba(0,0,0,.4);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--rv-font);
    font-size: var(--rv-text-base);
    line-height: var(--rv-line-height);
    color: var(--rv-text);
    background: var(--rv-bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--rv-transition);
}

a:hover {
    color: var(--rv-accent);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--rv-text);
}

h1 { font-size: var(--rv-text-3xl); }
h2 { font-size: var(--rv-text-2xl); }
h3 { font-size: var(--rv-text-xl); }
h4 { font-size: var(--rv-text-lg); }

.text-muted { color: var(--rv-muted); }
.text-accent { color: var(--rv-accent); }
.text-sm { font-size: var(--rv-text-sm); }
.text-xs { font-size: var(--rv-text-xs); }

/* ============ LAYOUT ============ */
.rv-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.rv-container {
    width: 100%;
    max-width: var(--rv-container-max);
    margin: 0 auto;
    padding: 0 var(--rv-space-md);
}

.rv-main {
    flex: 1;
    display: flex;
    gap: var(--rv-space-lg);
    max-width: var(--rv-container-max);
    margin: 0 auto;
    padding: var(--rv-space-lg) var(--rv-space-md);
    width: 100%;
}

.rv-content {
    flex: 1;
    min-width: 0;
}

.rv-sidebar {
    width: var(--rv-sidebar-width);
    flex-shrink: 0;
}

@media (max-width: 991px) {
    .rv-sidebar {
        display: none;
    }
}

/* ============ HEADER — See rv-header.css ============ */

/* ============ BUTTONS ============ */
.rv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--rv-space-sm);
    padding: 10px 20px;
    border-radius: var(--rv-radius-full);
    font-weight: 600;
    font-size: var(--rv-text-sm);
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: all var(--rv-transition);
    white-space: nowrap;
}

.rv-btn--primary {
    background: var(--rv-accent);
    color: #fff;
}

.rv-btn--primary:hover {
    background: var(--rv-accent-hover);
    color: #fff;
}

.rv-btn--secondary {
    background: var(--rv-bg-secondary);
    color: var(--rv-text);
    border: 1px solid var(--rv-border);
}

.rv-btn--secondary:hover {
    background: var(--rv-bg-tertiary);
}

.rv-btn--ghost {
    background: transparent;
    color: var(--rv-text-secondary);
}

.rv-btn--ghost:hover {
    background: var(--rv-bg-secondary);
    color: var(--rv-text);
}

.rv-btn--sm {
    padding: 6px 14px;
    font-size: var(--rv-text-xs);
}

.rv-btn--lg {
    padding: 14px 28px;
    font-size: var(--rv-text-base);
}

/* ============ CARDS ============ */
.rv-card {
    background: var(--rv-surface);
    border-radius: var(--rv-radius-lg);
    overflow: hidden;
    transition: box-shadow var(--rv-transition-slow), transform var(--rv-transition-slow);
    border: 1px solid var(--rv-border-light);
}

.rv-card:hover {
    box-shadow: var(--rv-shadow-md);
    transform: translateY(-2px);
}

.rv-card__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--rv-bg-tertiary);
}

.rv-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--rv-transition-slow);
}

.rv-card:hover .rv-card__thumb img {
    transform: scale(1.03);
}

.rv-card__badge {
    position: absolute;
    top: var(--rv-space-sm);
    left: var(--rv-space-sm);
    padding: 3px 10px;
    border-radius: var(--rv-radius-full);
    font-size: var(--rv-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.rv-card__badge--vip-diamond {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
}

.rv-card__badge--vip-gold {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
}

.rv-card__badge--vip-silver {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: #fff;
}

.rv-card__badge--free {
    background: var(--rv-accent);
    color: #fff;
}

.rv-card__body {
    padding: var(--rv-space-md);
}

.rv-card__title {
    font-size: var(--rv-text-base);
    font-weight: 600;
    line-height: 1.4;
    color: var(--rv-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--rv-space-xs);
}

.rv-card__title:hover {
    color: var(--rv-accent);
}

.rv-card__price {
    font-size: var(--rv-text-lg);
    font-weight: 700;
    color: var(--rv-accent);
    margin-bottom: var(--rv-space-sm);
}

.rv-card__meta {
    display: flex;
    align-items: center;
    gap: var(--rv-space-sm);
    font-size: var(--rv-text-xs);
    color: var(--rv-muted);
}

.rv-card__meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.rv-card__meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--rv-muted);
}

.rv-card__location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--rv-text-xs);
    color: var(--rv-muted);
    margin-top: var(--rv-space-sm);
}

/* Card Grid */
.rv-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--rv-space-md);
}

@media (max-width: 575px) {
    .rv-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--rv-space-sm);
    }
    .rv-card__body {
        padding: var(--rv-space-sm);
    }
    .rv-card__title {
        font-size: var(--rv-text-sm);
    }
    .rv-card__price {
        font-size: var(--rv-text-base);
    }
}

/* ============ WIDGET / SIDEBAR ============ */
.rv-widget {
    background: var(--rv-surface);
    border-radius: var(--rv-radius-lg);
    border: 1px solid var(--rv-border-light);
    overflow: hidden;
    margin-bottom: var(--rv-space-md);
}

.rv-widget__header {
    padding: var(--rv-space-md);
    border-bottom: 1px solid var(--rv-border-light);
    font-weight: 700;
    font-size: var(--rv-text-base);
    color: var(--rv-text);
}

.rv-widget__body {
    padding: var(--rv-space-md);
}

/* ============ FORMS ============ */
.rv-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--rv-border);
    border-radius: var(--rv-radius-md);
    background: var(--rv-bg);
    color: var(--rv-text);
    font-size: var(--rv-text-sm);
    transition: border-color var(--rv-transition), box-shadow var(--rv-transition);
    outline: none;
}

.rv-input:focus {
    border-color: var(--rv-accent);
    box-shadow: 0 0 0 3px var(--rv-accent-light);
}

.rv-input::placeholder {
    color: var(--rv-muted);
}

.rv-label {
    display: block;
    font-size: var(--rv-text-sm);
    font-weight: 600;
    color: var(--rv-text-secondary);
    margin-bottom: var(--rv-space-xs);
}

/* ============ BADGES ============ */
.rv-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--rv-radius-full);
    font-size: var(--rv-text-xs);
    font-weight: 600;
}

.rv-badge--accent {
    background: var(--rv-accent-light);
    color: var(--rv-accent);
}

.rv-badge--muted {
    background: var(--rv-bg-tertiary);
    color: var(--rv-muted);
}

/* ============ PAGINATION ============ */
.rv-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--rv-space-xs);
    margin-top: var(--rv-space-xl);
}

.rv-pagination__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--rv-space-sm);
    border-radius: var(--rv-radius-sm);
    font-size: var(--rv-text-sm);
    font-weight: 500;
    color: var(--rv-text-secondary);
    transition: background var(--rv-transition), color var(--rv-transition);
}

.rv-pagination__item:hover {
    background: var(--rv-bg-secondary);
    color: var(--rv-text);
}

.rv-pagination__item.active {
    background: var(--rv-accent);
    color: #fff;
    font-weight: 600;
}

.rv-pagination__item.disabled {
    opacity: .4;
    pointer-events: none;
}

/* ============ SKELETON ============ */
.rv-skeleton {
    background: linear-gradient(90deg, var(--rv-bg-tertiary) 25%, var(--rv-border-light) 50%, var(--rv-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: rv-shimmer 1.5s infinite;
    border-radius: var(--rv-radius-sm);
}

.rv-skeleton--text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}

.rv-skeleton--title {
    height: 20px;
    margin-bottom: 12px;
    width: 60%;
}

.rv-skeleton--thumb {
    aspect-ratio: 16/10;
    width: 100%;
}

.rv-skeleton--circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

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

/* ============ EMPTY STATE ============ */
.rv-empty {
    text-align: center;
    padding: var(--rv-space-3xl) var(--rv-space-md);
}

.rv-empty__icon {
    font-size: 3rem;
    margin-bottom: var(--rv-space-md);
    opacity: .3;
}

.rv-empty__title {
    font-size: var(--rv-text-lg);
    font-weight: 600;
    margin-bottom: var(--rv-space-sm);
}

.rv-empty__desc {
    color: var(--rv-muted);
    font-size: var(--rv-text-sm);
}

/* ============ FOOTER ============ */
.rv-footer {
    background: var(--rv-text);
    color: #ccc;
    padding: var(--rv-space-3xl) 0 var(--rv-space-lg);
    margin-top: auto;
}

.rv-footer a {
    color: #aaa;
    transition: color var(--rv-transition);
}

.rv-footer a:hover {
    color: var(--rv-accent);
}

.rv-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--rv-space-xl);
    max-width: var(--rv-container-max);
    margin: 0 auto;
    padding: 0 var(--rv-space-md);
}

.rv-footer__brand {
    font-size: var(--rv-text-lg);
    font-weight: 800;
    color: #fff;
    margin-bottom: var(--rv-space-md);
}

.rv-footer__brand .accent {
    color: var(--rv-accent);
}

.rv-footer__desc {
    font-size: var(--rv-text-sm);
    line-height: 1.7;
    color: #999;
}

.rv-footer__heading {
    font-size: var(--rv-text-sm);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: var(--rv-space-md);
}

.rv-footer__link {
    display: block;
    padding: 4px 0;
    font-size: var(--rv-text-sm);
    color: #aaa;
}

.rv-footer__bottom {
    max-width: var(--rv-container-max);
    margin: var(--rv-space-xl) auto 0;
    padding: var(--rv-space-md) var(--rv-space-md) 0;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--rv-text-xs);
    color: #666;
}

@media (max-width: 767px) {
    .rv-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--rv-space-lg);
    }
    .rv-footer__bottom {
        flex-direction: column;
        gap: var(--rv-space-sm);
        text-align: center;
    }
}

@media (max-width: 479px) {
    .rv-footer__grid {
        grid-template-columns: 1fr;
    }
}

/* ============ THEME TOGGLE — See rv-header.css ============ */

/* ============ UTILITIES ============ */
.rv-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.rv-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.rv-gap-sm { gap: var(--rv-space-sm); }
.rv-gap-md { gap: var(--rv-space-md); }
.rv-gap-lg { gap: var(--rv-space-lg); }

/* ============ SECTION ============ */
.rv-section {
    margin-bottom: var(--rv-space-xl);
}

.rv-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--rv-space-md);
}

.rv-section__title {
    font-size: var(--rv-text-xl);
    font-weight: 700;
    color: var(--rv-text);
}

.rv-section__more {
    font-size: var(--rv-text-sm);
    font-weight: 500;
    color: var(--rv-accent);
}

.rv-section__more:hover {
    text-decoration: underline;
}

/* ============ CATEGORY TABS ============ */
.rv-tabs {
    display: flex;
    gap: var(--rv-space-xs);
    overflow-x: auto;
    padding-bottom: var(--rv-space-sm);
    scrollbar-width: none;
}

.rv-tabs::-webkit-scrollbar { display: none; }

.rv-tab {
    padding: 8px 18px;
    border-radius: var(--rv-radius-full);
    font-size: var(--rv-text-sm);
    font-weight: 500;
    color: var(--rv-text-secondary);
    background: var(--rv-surface);
    border: 1px solid var(--rv-border);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--rv-transition);
}

.rv-tab:hover {
    border-color: var(--rv-accent);
    color: var(--rv-accent);
}

.rv-tab.active {
    background: var(--rv-accent);
    color: #fff;
    border-color: var(--rv-accent);
}

/* ============ MODAL ============ */
.rv-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: var(--rv-z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--rv-space-md);
}

.rv-modal-overlay.active {
    display: flex;
}

.rv-modal {
    background: var(--rv-surface);
    border-radius: var(--rv-radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--rv-shadow-xl);
}

.rv-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--rv-space-md) var(--rv-space-lg);
    border-bottom: 1px solid var(--rv-border-light);
}

.rv-modal__title {
    font-size: var(--rv-text-lg);
    font-weight: 700;
}

.rv-modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rv-radius-full);
    color: var(--rv-muted);
}

.rv-modal__close:hover {
    background: var(--rv-bg-secondary);
    color: var(--rv-text);
}

.rv-modal__body {
    padding: var(--rv-space-lg);
}

/* ============ DROPDOWN — See rv-header.css ============ */

/* ============ AVATAR ============ */
.rv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--rv-bg-tertiary);
    flex-shrink: 0;
}

.rv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rv-avatar--sm { width: 28px; height: 28px; }
.rv-avatar--lg { width: 48px; height: 48px; }

/* ============ TOAST ============ */
.rv-toast {
    position: fixed;
    bottom: var(--rv-space-lg);
    right: var(--rv-space-lg);
    padding: 12px 20px;
    background: var(--rv-text);
    color: var(--rv-bg);
    border-radius: var(--rv-radius-md);
    font-size: var(--rv-text-sm);
    font-weight: 500;
    box-shadow: var(--rv-shadow-lg);
    z-index: var(--rv-z-toast);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--rv-transition-slow);
}

.rv-toast.active {
    transform: translateY(0);
    opacity: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 767px) {
    :root {
        --rv-header-height: 56px;
    }

    .rv-main {
        padding: var(--rv-space-md) var(--rv-space-sm);
    }

    .rv-card-grid {
        gap: var(--rv-space-sm);
    }

    h1 { font-size: var(--rv-text-2xl); }
    h2 { font-size: var(--rv-text-xl); }
}

/* ============ PRINT ============ */
@media print {
    .rv-header,
    .rv-footer,
    .rv-sidebar,
    .rv-drawer-overlay,
    .rv-drawer {
        display: none !important;
    }

    .rv-main {
        padding: 0;
    }

    .rv-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
