/* ════════════════════════════════════════════════
   Rikkayuu Cosrent — Custom Styles
   Theme: Purple/Lavender + Blue + Pink (from logo)
   ════════════════════════════════════════════════ */

:root {
    --brand-purple:     #7c3aed;
    --brand-violet:     #8b5cf6;
    --brand-lavender:   #c4b5fd;
    --brand-light:      #ede9fe;
    --brand-blue:       #93c5fd;
    --brand-blue-light: #dbeafe;
    --brand-pink:       #f9a8d4;
    --brand-pink-dark:  #ec4899;
    --brand-cyan:       #67e8f9;

    --grid-gap: 3px;
}

/* ── Product Grid ───────────────────────────────── */

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
}

@media (min-width: 640px) {
    .product-grid {
        gap: 8px;
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (min-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ── Product Card ───────────────────────────────── */

.card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #fff;
    border-radius: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 640px) {
    .card {
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(124, 58, 237, 0.15);
    }
}

.card__image-wrapper {
    position: relative;
    padding-bottom: 100%; /* 1:1 aspect ratio */
    overflow: hidden;
    background: var(--brand-light);
}

.card__image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card__image {
    transform: scale(1.05);
}

.card__badge {
    position: absolute;
    top: 6px; left: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.card__badge--rent {
    background: var(--brand-purple);
}

.card__badge--sale {
    background: var(--brand-pink-dark);
}

/* Card info (hidden on mobile, visible on sm+) */
.card__info {
    display: none;
    padding: 8px 10px 10px;
}

@media (min-width: 640px) {
    .card__info {
        display: block;
    }
}

.card__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card__price {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-purple);
    margin: 0 0 4px;
}

.card__price-note {
    font-size: 0.65rem;
    font-weight: 400;
    color: #6b7280;
}

.card__sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.size-chip {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.6rem;
    font-weight: 600;
    background: var(--brand-light);
    color: var(--brand-purple);
    border-radius: 4px;
}

.size-chip--lg {
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Selectable size chips in modal */
.size-chip--selectable {
    cursor: pointer;
    border: 1.5px solid var(--brand-light);
    transition: all 0.15s ease;
}
.size-chip--selectable:hover {
    border-color: var(--brand-purple);
}
.size-chip--selected {
    background: var(--brand-purple);
    color: #fff;
    border-color: var(--brand-purple);
}

/* Selectable add-on items in modal */
.addon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #374151;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}
.addon-item:hover {
    border-color: var(--brand-purple);
    background: #faf5ff;
}
.addon-item--selected {
    border-color: var(--brand-purple);
    background: var(--brand-light);
    color: var(--brand-purple);
}
.addon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.addon-item--selected .addon-check {
    background: var(--brand-purple);
    border-color: var(--brand-purple);
    color: #fff;
}

.addon-price {
    font-weight: 600;
    color: var(--brand-purple);
}
.addon-note {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

/* Size measurement details */
.size-details {
    margin-top: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.size-detail-row {
    display: flex;
    align-items: baseline;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-bottom: 1px solid #f3f4f6;
}

.size-detail-row:last-child {
    border-bottom: none;
}

.size-detail-label {
    font-weight: 700;
    color: var(--brand-purple);
    min-width: 36px;
    margin-right: 10px;
}

.size-detail-value {
    color: #4b5563;
}

/* ── Filter Chips ───────────────────────────────── */

.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #4b5563;
    border: 1.5px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}

.chip:hover {
    background: var(--brand-light);
    color: var(--brand-purple);
}

.chip--active {
    background: var(--brand-purple);
    color: #fff;
    border-color: var(--brand-purple);
}

.chip--active:hover {
    background: var(--brand-violet);
    color: #fff;
}

/* ── Filter Panel ───────────────────────────────── */

.filter-panel {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.filter-panel.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
}

@media (min-width: 768px) {
    .filter-panel,
    .filter-panel.hidden {
        max-height: none;
        opacity: 1;
        overflow: visible;
    }
}

/* ── Modal ──────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal--open {
    pointer-events: auto;
    opacity: 1;
}

.modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal__wrapper {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal__content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal--open .modal__wrapper {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .modal {
        align-items: center;
    }
    .modal__wrapper {
        max-width: 480px;
        max-height: 85vh;
        border-radius: 20px;
        margin: 1rem;
        transform: translateY(20px) scale(0.97);
    }
    .modal--open .modal__wrapper {
        transform: translateY(0) scale(1);
    }
}

.modal__close {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 20;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.15s;
}

.modal__close:hover {
    background: #fff;
}

/* Modal drag handle (mobile) */
.modal__handle {
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 8px auto 0;
}

/* Modal image */
.modal__image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.modal__body {
    padding: 16px 20px 24px;
}

.modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 8px 0 4px;
}

.modal__meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 2px 0;
}

.modal__price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-purple);
    margin: 10px 0 2px;
}

.modal__total {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-pink);
    margin: 0 0 10px;
    padding: 6px 10px;
    background: #fdf2f8;
    border-radius: 6px;
}

.modal__sizes {
    margin: 12px 0;
}

.modal__sizes-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.modal__description {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 12px 0 16px;
}

/* ── DM Button (IG gradient) ────────────────────── */

.btn-dm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #405DE6, #5B51D8, #833AB4, #C13584, #E1306C, #FD1D1D);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-dm:hover {
    opacity: 0.92;
    transform: scale(1.01);
}

/* ── Copy Message Box ───────────────────────────── */

.prefill-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.5;
    margin: 12px 0 8px;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-purple);
    background: var(--brand-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-copy:hover {
    background: var(--brand-lavender);
}

/* ── View Post Button ───────────────────────────── */

.btn-view-post {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-view-post:hover {
    background: #e5e7eb;
}

/* ── Badge in Modal ─────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge--rent {
    background: var(--brand-light);
    color: var(--brand-purple);
}

.badge--sale {
    background: #fce7f3;
    color: var(--brand-pink-dark);
}

/* ── Empty State ────────────────────────────────── */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-state__text {
    font-size: 0.95rem;
}

/* ── Scrollbar ──────────────────────────────────── */

.modal__content::-webkit-scrollbar {
    width: 6px;
}

.modal__content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 6px;
}

.modal__content::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 6px;
}

.modal__content::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.modal__content {
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f3f4f6;
}

/* ── Animations ─────────────────────────────────── */

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

.card {
    animation: fadeInUp 0.3s ease both;
}

.card:nth-child(3n+1) { animation-delay: 0s; }
.card:nth-child(3n+2) { animation-delay: 0.05s; }
.card:nth-child(3n+3) { animation-delay: 0.1s; }

/* ── Image carousel in modal ────────────────────── */

.modal__images {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.modal__images img {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.modal__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 4px;
}

.modal__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.modal__dot--active {
    background: var(--brand-purple);
    transform: scale(1.3);
}

/* ── Carousel arrows ───────────────────────────── */

.modal__carousel {
    position: relative;
}

.modal__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.15s, opacity 0.2s;
    opacity: 0;
    pointer-events: none;
}

.modal__arrow--visible {
    opacity: 1;
    pointer-events: auto;
}

.modal__arrow:hover {
    background: #fff;
}

.modal__arrow--left {
    left: 8px;
}

.modal__arrow--right {
    right: 8px;
}
