* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f4f6;
    color: #222;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo a {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.top-nav a {
    margin-left: 16px;
    font-size: 0.95rem;
}

.page-content {
    padding: 24px 32px 64px;
    flex: 1;
}

/* Flash messages */
.flash-container {
    margin-bottom: 16px;
}

.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.flash-success {
    background: #e3f9e5;
    border: 1px solid #8ad48b;
}

.flash-error {
    background: #ffe3e3;
    border: 1px solid #f08a8a;
}

/* Layouts */

.layout-two-columns {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
}

.sidebar {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px;
    align-self: start;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.category-list li {
    margin-bottom: 6px;
}

.category-list a {
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.category-list a.active {
    background: #222;
    color: #fff;
}

/* Catalog */

.catalog-area {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 420px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.search-form button {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #222;
    color: #fff;
    cursor: pointer;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.catalog-card {
    background: #fafafa;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.catalog-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 10px 12px 12px;
}

.card-title {
    margin: 0 0 4px;
    font-size: 1rem;
}

.card-text {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #555;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.price {
    font-weight: 600;
}

.btn-small {
    padding: 5px 10px;
    background: #222;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Item page */

.item-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 24px;
}

.item-gallery {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 16px 20px;
}

.item-main-image img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 8px;
    background: #f4f4f6;
}

.item-main-image {
    position: relative;
}

.gallery-nav {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.item-thumbs {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.item-thumbs img {
    width: 80px;
    height: 60px;
    object-fit: contain;
    background: #f4f4f6;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.8;
}

.item-thumbs img.active {
    outline: 2px solid #222;
    opacity: 1;
}

.item-description h1 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.item-description p {
    margin: 0;
    line-height: 1.4;
}

.item-sidebar {
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-calendar-block {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px;
}

.item-calendar-block form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-calendar-block label {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-calendar-block input[type="date"],
.item-calendar-block input[type="text"],
.item-calendar-block input[type="email"] {
    padding: 7px 9px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

.date-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
}

.date-sep {
    text-align: center;
}

.price-per-day {
    margin-top: 4px;
    font-weight: 600;
}

.btn-primary {
    margin-top: 4px;
    padding: 9px 12px;
    border: none;
    border-radius: 6px;
    background: #222;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}

.item-extra-info {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.9rem;
}

.item-extra-info ul {
    padding-left: 18px;
    margin: 6px 0 0;
}

/* Profile */

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
    gap: 24px;
}

.profile-orders {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px;
}

.table-wrapper {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.orders-table th,
.orders-table td {
    border-bottom: 1px solid #eee;
    padding: 8px 6px;
    text-align: left;
}

.orders-table th {
    font-weight: 600;
    white-space: nowrap;
}

.profile-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-card,
.profile-filters {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.9rem;
}

.profile-links {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.profile-links li {
    margin-bottom: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

/* Auth pages */

.auth-layout {
    display: flex;
    justify-content: center;
}

.auth-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px 22px;
    width: 100%;
    max-width: 420px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.auth-form label {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-form input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.auth-form select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
}

.auth-link {
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Footer */

.footer {
    background: #111;
    color: #eee;
    padding: 24px 32px 32px;
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    font-size: 0.9rem;
}

.footer h4 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer a {
    color: #eee;
}

/* Responsive */

@media (max-width: 1100px) {
    .layout-two-columns,
    .item-layout,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }

    .page-content {
        padding: 16px 16px 40px;
    }

    .top-bar {
        padding: 10px 16px;
    }
}


.small-note {
    font-size: 0.8rem;
    color: #666;
}

.catalog-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.inline-form input[type="text"] {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.category-select {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 1100px) {
    .layout-two-columns {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .catalog-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: none;
        width: 100%;
    }

    .category-select {
        display: block;
        width: 100%;
    }

    .category-select select {
        width: 100%;
        padding: 10px 12px;
        border-radius: 6px;
        border: 1px solid #ccc;
        background: #fff;
    }

    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .item-layout,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .item-thumbs img {
        width: 60px;
        height: 60px;
    }

    .page-content {
        padding: 16px 16px 40px;
    }

    .top-bar {
        padding: 10px 16px;
    }
}
