/* ============================================
   🌮 DIRECTORIO DE COMIDA MEXICANA
   Minimalist 90s OS Interface
   ============================================ */

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

:root {
    --win-bg: #c0c0c0;
    --win-light: #ffffff;
    --win-dark: #808080;
    --win-darker: #000000;
    --win-blue: #000080;
    --text-color: #000000;
}

body {
    font-family: 'MS Sans Serif', 'Arial', sans-serif;
    background-color: #008080; /* Classic Win95 Teal Background */
    color: var(--text-color);
    padding: 20px;
    font-size: 14px;
}

.layout-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   WINDOWS 9X COMPONENTS
   ============================================ */
.win-panel {
    background-color: var(--win-bg);
    border-top: 2px solid var(--win-light);
    border-left: 2px solid var(--win-light);
    border-right: 2px solid var(--win-darker);
    border-bottom: 2px solid var(--win-darker);
    padding: 10px;
    box-shadow: inset -1px -1px 0px var(--win-dark), inset 1px 1px 0px var(--win-bg);
}

.win-btn {
    font-family: 'MS Sans Serif', 'Arial', sans-serif;
    font-size: 13px;
    background-color: var(--win-bg);
    border-top: 2px solid var(--win-light);
    border-left: 2px solid var(--win-light);
    border-right: 2px solid var(--win-darker);
    border-bottom: 2px solid var(--win-darker);
    padding: 4px 12px;
    cursor: pointer;
    color: var(--text-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset -1px -1px 0px var(--win-dark), inset 1px 1px 0px var(--win-bg);
}

.win-btn:active, .win-btn.active {
    border-top: 2px solid var(--win-darker);
    border-left: 2px solid var(--win-darker);
    border-right: 2px solid var(--win-light);
    border-bottom: 2px solid var(--win-light);
    box-shadow: inset 1px 1px 0px var(--win-dark), inset -1px -1px 0px var(--win-bg);
    padding: 5px 11px 3px 13px; /* Shift content to simulate press */
}

.win-btn:disabled {
    color: var(--win-dark);
    text-shadow: 1px 1px 0px var(--win-light);
    cursor: default;
}

.win-input {
    font-family: 'MS Sans Serif', 'Arial', sans-serif;
    font-size: 13px;
    padding: 3px 6px;
    border-top: 2px solid var(--win-darker);
    border-left: 2px solid var(--win-darker);
    border-right: 2px solid var(--win-light);
    border-bottom: 2px solid var(--win-light);
    background-color: #fff;
    box-shadow: inset 1px 1px 0px var(--win-dark);
}

.win-input:focus {
    outline: none;
}

/* ============================================
   HEADER & NAV
   ============================================ */
.main-header {
    text-align: center;
}

.main-header h1 {
    font-size: 20px;
    margin-bottom: 4px;
}

.main-header p {
    color: #444;
}

.win-nav .nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

/* ============================================
   TOOLBAR
   ============================================ */
.win-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-container input {
    width: 250px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   GRID
   ============================================ */
.restaurant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.restaurant-grid.list-view {
    grid-template-columns: 1fr;
}

/* CARD */
.restaurant-card {
    background-color: var(--win-bg);
    border-top: 2px solid var(--win-light);
    border-left: 2px solid var(--win-light);
    border-right: 2px solid var(--win-darker);
    border-bottom: 2px solid var(--win-darker);
    box-shadow: inset -1px -1px 0px var(--win-dark), inset 1px 1px 0px var(--win-bg);
    display: flex;
    flex-direction: column;
}

.card-header {
    background-color: var(--win-blue);
    color: white;
    padding: 3px 6px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-name {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 6px;
}

.card-info-item {
    margin-bottom: 4px;
    line-height: 1.3;
}

.card-info-item strong {
    color: var(--win-darker);
}

.card-actions {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* List view adjustments */
.list-view .restaurant-card {
    flex-direction: row;
}

.list-view .card-header {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    padding: 6px 3px;
    align-items: center;
}

.list-view .card-body {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.list-view .card-actions {
    margin-top: 0;
    padding-top: 0;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.page-info {
    margin: 0 4px;
}

/* ============================================
   POPUP DIALOG
   ============================================ */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.win-dialog {
    background-color: var(--win-bg);
    border-top: 2px solid var(--win-light);
    border-left: 2px solid var(--win-light);
    border-right: 2px solid var(--win-darker);
    border-bottom: 2px solid var(--win-darker);
    box-shadow: inset -1px -1px 0px var(--win-dark), inset 1px 1px 0px var(--win-bg), 2px 2px 5px rgba(0,0,0,0.5);
    width: 400px;
    max-width: 90%;
}

.win-titlebar {
    background: linear-gradient(90deg, var(--win-blue), #1084d0);
    color: white;
    padding: 3px 6px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.win-close-btn {
    background-color: var(--win-bg);
    border-top: 2px solid var(--win-light);
    border-left: 2px solid var(--win-light);
    border-right: 2px solid var(--win-darker);
    border-bottom: 2px solid var(--win-darker);
    color: black;
    font-weight: bold;
    width: 16px;
    height: 14px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.win-close-btn:active {
    border-top: 2px solid var(--win-darker);
    border-left: 2px solid var(--win-darker);
    border-right: 2px solid var(--win-light);
    border-bottom: 2px solid var(--win-light);
}

.win-body {
    padding: 15px;
}

.dialog-content {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.dialog-icon {
    font-size: 32px;
}

.dialog-text h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.dialog-text p {
    margin-bottom: 6px;
    line-height: 1.4;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================
   FOOTER
   ============================================ */
.win-footer {
    text-align: center;
    font-size: 12px;
    color: var(--win-darker);
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .win-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-container input {
        width: 100%;
    }
    
    .list-view .restaurant-card {
        flex-direction: column;
    }
    
    .list-view .card-header {
        writing-mode: horizontal-tb;
        transform: none;
        width: 100%;
    }
    
    .list-view .card-body {
        flex-direction: column;
        align-items: flex-start;
    }
}
