/**
 * ============================================
 * RESTAURANT/CAFÉ PREMIUM THEME - LAYOUT
 * Grid systems, containers, and layout utilities
 * Version: 1.0.0
 * ============================================
 */

/* ========================================
 * CONTAINER SYSTEM
 * ======================================== */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-px);
    padding-right: var(--container-px);
}

.container-sm {
    max-width: var(--container-sm);
}

.container-md {
    max-width: var(--container-md);
}

.container-lg {
    max-width: var(--container-lg);
}

.container-xl {
    max-width: var(--container-xl);
}

.container-xxl {
    max-width: var(--container-xxl);
}

.container-fluid {
    max-width: 100%;
}

/* Narrow container for text content */
.container-narrow {
    max-width: 720px;
}

/* Wide container */
.container-wide {
    max-width: 1600px;
}

/* ========================================
 * CSS GRID SYSTEM
 * ======================================== */
.grid {
    display: grid;
    gap: var(--space-6);
}

/* Auto-fit Grid */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-auto-fit-sm {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-auto-fit-lg {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* Fixed Column Grids */
.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

.grid-cols-12 {
    grid-template-columns: repeat(12, 1fr);
}

/* Gap Variants */
.gap-0 { gap: 0; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }
.gap-16 { gap: var(--space-16); }

.gap-x-4 { column-gap: var(--space-4); }
.gap-x-6 { column-gap: var(--space-6); }
.gap-x-8 { column-gap: var(--space-8); }

.gap-y-4 { row-gap: var(--space-4); }
.gap-y-6 { row-gap: var(--space-6); }
.gap-y-8 { row-gap: var(--space-8); }

/* ========================================
 * FLEXBOX UTILITIES
 * ======================================== */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

/* Flex Direction */
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-col { flex-direction: column; }
.flex-col-reverse { flex-direction: column-reverse; }

/* Flex Wrap */
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-wrap-reverse { flex-wrap: wrap-reverse; }

/* Justify Content */
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

/* Align Items */
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* Align Content */
.content-start { align-content: flex-start; }
.content-end { align-content: flex-end; }
.content-center { align-content: center; }
.content-between { align-content: space-between; }
.content-around { align-content: space-around; }
.content-stretch { align-content: stretch; }

/* Align Self */
.self-auto { align-self: auto; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.self-center { align-self: center; }
.self-stretch { align-self: stretch; }

/* Flex Grow & Shrink */
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-none { flex: none; }

.grow { flex-grow: 1; }
.grow-0 { flex-grow: 0; }

.shrink { flex-shrink: 1; }
.shrink-0 { flex-shrink: 0; }

/* ========================================
 * SECTION LAYOUTS
 * ======================================== */
.section {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
}

.section-sm {
    padding-top: var(--section-py-sm);
    padding-bottom: var(--section-py-sm);
}

.section-lg {
    padding-top: var(--section-py-lg);
    padding-bottom: var(--section-py-lg);
}

/* Section Background Variants */
.section-light {
    background-color: var(--neutral-50);
}

.section-dark {
    background-color: var(--neutral-900);
    color: var(--neutral-100);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 {
    color: var(--white);
}

.section-primary {
    background-color: var(--primary-main);
    color: var(--white);
}

.section-gradient {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    color: var(--white);
}

/* Section with Pattern */
.section-pattern {
    position: relative;
    background-color: var(--secondary-light);
}

.section-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c19a6b' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* ========================================
 * HERO LAYOUTS
 * ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-medium {
    min-height: 70vh;
}

.hero-small {
    min-height: 50vh;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-8);
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-background img,
.hero-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 1;
}

/* Page Header */
.page-header {
    position: relative;
    padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-16);
    background-color: var(--neutral-900);
    text-align: center;
    overflow: hidden;
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    color: var(--white);
    margin-bottom: var(--space-4);
}

.page-header .lead {
    color: var(--neutral-300);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
 * TWO COLUMN LAYOUTS
 * ======================================== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

.two-col-reverse {
    direction: rtl;
}

.two-col-reverse > * {
    direction: ltr;
}

.two-col-40-60 {
    grid-template-columns: 2fr 3fr;
}

.two-col-60-40 {
    grid-template-columns: 3fr 2fr;
}

.two-col-30-70 {
    grid-template-columns: 3fr 7fr;
}

.two-col-70-30 {
    grid-template-columns: 7fr 3fr;
}

/* ========================================
 * SIDEBAR LAYOUTS
 * ======================================== */
.layout-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-12);
}

.layout-sidebar-left {
    grid-template-columns: 320px 1fr;
}

.sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
    align-self: start;
}

.sidebar-widget {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.sidebar-widget-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--primary-main);
}

/* ========================================
 * MASONRY GRID
 * ======================================== */
.masonry {
    column-count: 3;
    column-gap: var(--space-6);
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: var(--space-6);
}

.masonry-2 {
    column-count: 2;
}

.masonry-4 {
    column-count: 4;
}

/* ========================================
 * POSITION UTILITIES
 * ======================================== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.static { position: static; }

/* Inset */
.inset-0 { inset: 0; }
.inset-x-0 { left: 0; right: 0; }
.inset-y-0 { top: 0; bottom: 0; }

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

.top-50 { top: 50%; }
.left-50 { left: 50%; }

/* ========================================
 * DISPLAY UTILITIES
 * ======================================== */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ========================================
 * OVERFLOW UTILITIES
 * ======================================== */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }

.overflow-x-auto { overflow-x: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-y-hidden { overflow-y: hidden; }

/* ========================================
 * WIDTH & HEIGHT UTILITIES
 * ======================================== */
.w-full { width: 100%; }
.w-screen { width: 100vw; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }

.max-w-none { max-width: none; }
.max-w-full { max-width: 100%; }
.max-w-prose { max-width: 65ch; }

.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-auto { height: auto; }

.min-h-0 { min-height: 0; }
.min-h-full { min-height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ========================================
 * SPACING UTILITIES
 * ======================================== */
/* Margin */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

.mt-0 { margin-top: 0; }
.mr-0 { margin-right: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

/* Padding */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-12 { padding: var(--space-12); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }

.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }

/* ========================================
 * TEXT ALIGNMENT
 * ======================================== */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* ========================================
 * Z-INDEX UTILITIES
 * ======================================== */
.z-0 { z-index: var(--z-0); }
.z-10 { z-index: var(--z-10); }
.z-20 { z-index: var(--z-20); }
.z-30 { z-index: var(--z-30); }
.z-40 { z-index: var(--z-40); }
.z-50 { z-index: var(--z-50); }

/* ========================================
 * ASPECT RATIO
 * ======================================== */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-4-3 { aspect-ratio: 4 / 3; }
.aspect-3-2 { aspect-ratio: 3 / 2; }
.aspect-2-3 { aspect-ratio: 2 / 3; }

/* ========================================
 * CENTERING UTILITIES
 * ======================================== */
.center-flex {
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-absolute {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.center-x {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.center-y {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
