* {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overscroll-behavior: none;
}

button, .wishlist-item, .filter-btn, .status-badge, .price-badge, .modal-overlay, #modal {
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, p, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.aspect-cinema, .wishlist-item .aspect-cinema {
    aspect-ratio: 16 / 10;
    position: relative;
}

@supports not (aspect-ratio: 16 / 10) {
    .aspect-cinema {
        overflow: hidden;
    }
    .aspect-cinema::before {
        content: '';
        display: block;
        width: 100%;
        padding-top: 62.5%;
    }
    .aspect-cinema > img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.filter-btn {
    border-radius: 6px;
    color: #78716c;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background-color: #1c1917;
    color: white;
}

.filter-btn:not(.active):hover, .close-btn:hover {
    background-color: #f5f5f4;
    color: #1c1917;
}

.wishlist-item {
    transition: all 0.3s ease;
    position: relative;
}

.wishlist-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.wishlist-item img {
    transition: transform 0.3s ease;
}

.price-badge, .modal-price-badge, .wishlist-item .price-badge {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    color: #1c1917;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: fit-content;
}

.modal-price-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    z-index: 10;
}

.wishlist-item .price-badge {
    position: absolute;
    z-index: 10;
    top: 12px;
    left: 12px;
    max-width: calc(50% - 8px);
}

.wishlist-item:hover .price-badge {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-badge, .wishlist-item .status-badge {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    min-width: fit-content;
    white-space: nowrap;
}

.wishlist-item .status-badge {
    position: absolute;
    z-index: 10;
    top: 12px;
    right: 12px;
    max-width: calc(50% - 8px);
}

.status-available {
    background-color: rgba(34, 197, 94, 0.95);
    color: white;
    border-color: rgba(34, 197, 94, 0.3);
    cursor: pointer;
}

.status-available:hover {
    background-color: rgba(22, 163, 74, 0.95);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.status-partially-reserved {
    background-color: rgba(254, 243, 199, 0.95);
    color: #92400e;
    border-color: rgba(146, 64, 14, 0.2);
    cursor: pointer;
}

.status-partially-reserved:hover {
    background-color: rgba(245, 158, 11, 0.95);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.status-fully-reserved {
    background-color: rgba(251, 146, 120, 0.95);
    color: #7c2d12;
    border-color: rgba(124, 45, 18, 0.2);
    cursor: pointer;
}

.status-fully-reserved:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(124, 45, 18, 0.2);
}

.status-available:active, .status-partially-reserved:active, .status-fully-reserved:active {
    transform: scale(0.95);
}

.status-fully-reserved .badge-text {
    filter: blur(3px);
    transition: filter 0.3s ease;
}

.status-fully-reserved.showing-name .badge-text, .status-fully-reserved.showing-name:hover .badge-text {
    filter: blur(0px);
}

.status-fully-reserved:hover .badge-text {
    filter: blur(1px);
}

.line-clamp-2, .description-text.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-overlay.show {
    display: flex !important;
}

.modal-overlay.show #modal {
    transform: scale(1);
    opacity: 1;
    animation: modalFadeIn 0.2s ease-out;
}

#modal {
    max-width: 420px;
    width: 100%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e7e5e4;
    overflow: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d6d3d1 transparent;
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-header {
    padding: 0.5rem 1rem 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1rem;
    font-weight: 500;
    color: #1c1917;
    line-height: 1.2;
    letter-spacing: 0.025em;
    margin: 0;
    flex: 1;
    margin-right: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-btn {
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: none;
    color: #78716c;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-body {
    padding: 0.5rem 1rem 1rem 1rem;
    overflow-y: auto;
    flex: 1;
}

.product-image-container {
    margin-bottom: 1rem;
    position: relative;
}

.product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e7e5e4;
    background-color: #fafaf9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-details {
    margin-bottom: 1rem;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #1c1917;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    letter-spacing: 0.025em;
}

.product-description {
    text-align: left;
    margin-top: 0.75rem;
}

.description-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #57534e;
    margin: 0;
    transition: all 0.3s ease;
}

.expand-btn {
    background: none;
    border: none;
    color: #78716c;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.25rem;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.expand-btn:hover {
    color: #1c1917;
}

.reservation-form {
    border-top: 1px solid #f5f5f4;
    padding-top: 1rem;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.form-row:has(.quantity-controls) {
    gap: 0.5rem;
}

.form-label {
    min-width: 3rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1c1917;
    letter-spacing: 0.025em;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.total-quantity {
    font-size: 0.8rem;
    color: #78716c;
    font-weight: 400;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.qty-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #e7e5e4;
    background: white;
    color: #57534e;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    border-color: #d6d3d1;
    background-color: #fafaf9;
}

.qty-btn:active {
    background-color: #f5f5f4;
}

.qty-input {
    width: 3rem;
    height: 2rem;
    text-align: center;
    border: 1px solid #e7e5e4;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1c1917;
    background: white;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

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

.qty-input:focus, .name-input:focus {
    outline: none;
    border-color: #a8a29e;
}

.name-input {
    flex: 1;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid #e7e5e4;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #1c1917;
    background: white;
    transition: border-color 0.2s ease;
}

.name-input::placeholder {
    color: #a8a29e;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.btn {
    flex: 1;
    height: 2.25rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.025em;
    border: 1px solid transparent;
}

.btn-secondary {
    background: white;
    color: #57534e;
    border-color: #e7e5e4;
}

.btn-secondary:hover {
    background-color: #fafaf9;
    border-color: #d6d3d1;
}

.btn-primary {
    background: #1c1917;
    color: white;
    border-color: #1c1917;
}

.btn-primary:hover {
    background: #292524;
    border-color: #292524;
}

.btn-primary:disabled {
    background: #a8a29e;
    border-color: #a8a29e;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after, .btn-primary.btn-loading::after, .btn-secondary.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.875rem;
    height: 0.875rem;
    margin: -0.4375rem 0 0 -0.4375rem;
    border: 1.5px solid transparent;
    border-top: 1.5px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary.btn-loading::after {
    border-top-color: white;
}

.btn-secondary.btn-loading::after {
    border-top-color: #57534e;
}

.modal-body::-webkit-scrollbar, #modal::-webkit-scrollbar {
    width: 3px;
}

.modal-body::-webkit-scrollbar-track, #modal::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #e7e5e4;
    border-radius: 2px;
}

#modal::-webkit-scrollbar-thumb {
    background-color: #d6d3d1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #d6d3d1;
}

#modal::-webkit-scrollbar-thumb:hover {
    background-color: #a8a29e;
}

.close-btn:focus, .qty-btn:focus, .qty-input:focus, .name-input:focus, .btn:focus, .expand-btn:focus {
    outline: 2px solid #d6d3d1;
    outline-offset: 1px;
}

.search-glass {
    margin-top: -4px;
}

.masonry {
    column-count: 1;
    column-gap: 1.5rem;
}

.masonry > * {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.handwriting {
    font-family: "Caveat", cursive;
    font-optical-sizing: auto;
    font-style: normal;
}

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

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@supports not (backdrop-filter: blur(12px)) {
    .modal-price-badge, .price-badge {
        background-color: rgba(255, 255, 255, 0.95);
    }
}

@supports not (backdrop-filter: blur(8px)) {
    .status-available {
        background-color: rgba(34, 197, 94, 0.98);
    }
    .status-partially-reserved {
        background-color: rgba(254, 243, 199, 0.98);
    }
    .status-fully-reserved {
        background-color: rgba(251, 146, 120, 0.98);
    }
}

@supports not (aspect-ratio: 16 / 9) {
    .product-image {
        height: calc(100vw * 9 / 16);
        max-height: 210px;
    }
}

@media (min-width: 768px) {
    .masonry {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry {
        column-count: 3;
    }
}

@media (max-width: 640px) {
    .sm-hidden {
        display: none;
    }
    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    #search-input {
        font-size: 16px;
    }
    .status-badge, .price-badge {
        font-size: 0.7rem;
        padding: 0.375rem 0.75rem;
        max-width: calc(45% - 4px);
    }
    .status-badge.status-available {
        font-size: 0.75rem;
        padding: 0.5rem 0.875rem;
        min-height: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .price-badge {
        top: 8px;
        left: 8px;
    }
    .status-badge {
        top: 8px;
        right: 8px;
    }
    #modal {
        max-width: 92vw;
        margin: 1rem;
        border-radius: 8px;
    }
    .modal-header {
        padding: 0.4rem 0.75rem 0.4rem 0.75rem;
    }
    .modal-body {
        padding: 0.5rem 0.75rem 0.75rem 0.75rem;
    }
    .modal-title {
        font-size: 0.9rem;
        margin-right: 0.5rem;
    }
    .modal-price-badge {
        top: 0.375rem;
        left: 0.375rem;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    .product-image {
        border-radius: 4px;
    }
    .product-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    .form-row {
        margin-bottom: 0.75rem;
    }
    .form-row:has(.quantity-controls) {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .quantity-controls {
        min-width: 0;
        flex: 1;
    }
    .total-quantity {
        margin-left: 0;
        flex-shrink: 0;
    }
    .qty-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    .qty-input {
        width: 3.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    .name-input {
        font-size: 16px !important;
        height: 2.5rem;
        padding: 0 0.75rem;
    }
    .btn {
        height: 2.5rem;
        font-size: 0.9rem;
    }
    .form-actions {
        gap: 0.75rem;
        margin-top: 1rem;
    }
}

html {
    scroll-behavior: smooth;
}