* {
    scrollbar-width: thin;
}

/* Custom Select Dropdown for Admin */
.custom-select {
    position: relative;
    width: 100%;
    min-width: 100px;
    user-select: none;
}

/* Custom select en formulario */
.form-group .custom-select {
    margin: 0;
}

.custom-select-trigger {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
}

.custom-select-trigger:hover {
    border-color: #ccc;
}

.custom-select.open .custom-select-trigger {
    border-color: #444;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-trigger svg {
    transition: transform 0.3s ease;
    color: #666;
}

.custom-select.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 2px solid #444;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.custom-select.open .custom-options {
    max-height: 300px;
    opacity: 1;
    overflow-y: auto;
}

.custom-option {
    padding: 10px 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
}

.custom-option:hover {
    background-color: #f5f5f5;
}

.custom-option.selected {
    background-color: #ddd;
    color: #444;
    font-weight: 500;
}

.custom-option:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: calc(100dvh - 80px);
}
@media (min-width: 769px) {
    .login-container {
        min-height: calc(100dvh - 130px);
    }
}
.login-box {
    padding: 40px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
}
.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #555;
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 250px;
}
.form-group input[type="file"] {
    padding: 8px;
    cursor: pointer;
}
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 0px;
}
.image-preview-box {
    aspect-ratio: 1;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-preview-box:hover {
    border-color: #444;
    background-color: #f0f0f0;
    transform: scale(1.02);
}
.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.placeholder-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-align: center;
    padding: 10px;
}
.placeholder-icon svg {
    stroke: #ccc;
    margin-bottom: 8px;
}
.placeholder-icon span {
    font-size: 12px;
    font-weight: 500;
    color: #999;
}
.image-preview-box:hover .placeholder-icon svg {
    stroke: #444;
}
.image-preview-box:hover .placeholder-icon span {
    color: #444;
}
@media (max-width: 768px) {
    .image-preview-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 480px) {
    .image-preview-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.image-input {
    font-size: 13px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}
.checkbox-group {
    display: flex;
    align-items: center;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #FF5722;
}
.checkbox-label span {
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

/* Featured checkboxes */
.featured-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .featured-checkboxes {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.featured-category-section {
    margin-bottom: 6px;
    padding: 6px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.featured-category-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-slots {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.slot-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.slot-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.slot-btn.selected {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.slot-btn.selected .slot-number {
    color: #333;
}

.slot-btn.occupied {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.slot-btn.occupied:hover {
    background-color: #ffe69c;
    border-color: #ff9800;
}

.slot-number {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.slot-status {
    font-size: 18px;
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-btn.occupied .slot-status::before {
    content: '🔒';
    font-size: 14px;
}

.slot-btn.selected .slot-status::before {
    content: '✓';
    font-size: 16px;
    color: white;
}

@media (max-width: 768px) {
    .featured-slots {
        gap: 8px;
    }
    
    .slot-btn {
        width: 50px;
        height: 50px;
    }
    
    .slot-number {
        font-size: 18px;
    }
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #212121;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-login:hover {
    transform: translateY(-2px);
}
.error-msg {
    color: #ff4444;
    text-align: center;
    margin-top: 15px;
    display: none;
}
.admin-panel {
    padding: 100px 12px 12px 12px;
    background-color: #f5f5f5;
}
@media (min-width: 769px) {
    .admin-panel {
        padding-top: 60px;
    }
}
@media (max-width: 600px) {
    .filters-container .btn-add-product .btn-text {
        display: none;
    }
    .filters-container .btn-add-product {
        padding: 12px;
        min-width: 44px;
        justify-content: center;
    }
    .admin-filter-buttons {
        flex-wrap: nowrap;
    }
}
.admin-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.filters-container {
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.products-list-section {
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-height: calc(100dvh - 220px);
    overflow-y: auto;
}
.products-list-section.filter-expanded {
    max-height: calc(100dvh - 347px);
}
.products-list-section.sort-expanded {
    max-height: calc(100dvh - 284px);
}
@media (min-width: 769px) {
    .products-list-section {
        max-height: calc(100dvh - 260px);
    }
    .products-list-section.filter-expanded {
        max-height: calc(100dvh - 387px);
    }
    .products-list-section.sort-expanded {
        max-height: calc(100dvh - 324px);
    }
}
@media (min-width: 601px) and (max-width: 768px) {
    .products-list-section {
        max-height: calc(100dvh - 220px);
    }
}
.product-form-section h2,
.products-list-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
}
.form-buttons {
    display: flex;
    gap: 10px;
}
.btn-save,
.btn-cancel {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-save {
    background-color: #444;
    color: white;
}
.btn-save:hover {
    background-color: #555;
}
.btn-cancel {
    background-color: #999;
    color: white;
}
.btn-cancel:hover {
    background-color: #777;
}
.admin-filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.admin-filter-btn,
.admin-sort-btn {
    padding: 12px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 50%;
}

/* Botón de agregar en el contenedor de filtros */
.filters-container .btn-add-product {
    padding: 12px 20px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filters-container .btn-add-product:hover {
    background-color: #555;
}

.filters-container .btn-add-product svg {
    stroke: white;
}
.admin-filter-btn:hover,
.admin-sort-btn:hover {
    border-color: #444;
    color: #444;
}
.admin-filter-btn.active,
.admin-sort-btn.active {
    background: #444;
    border-color: #444;
    color: white;
}
.admin-filter-btn svg,
.admin-sort-btn svg {
    stroke: currentColor;
}
.admin-filter-dropdown,
.admin-sort-dropdown {
    display: none;
    animation: slideDown 0.3s ease;
}
.admin-filter-dropdown.active,
.admin-sort-dropdown.active {
    display: block;
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.filter-row:last-child {
    margin-bottom: 0;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
    flex: 1;
}
.filter-group label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
}
.filter-section select,
.filter-section input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
}
.filter-price {
    flex: 2;
}
.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}
.price-inputs input {
    flex: 1;
    min-width: 80px;
}
.price-inputs span {
    color: #666;
    font-weight: 500;
}
.btn-apply-filter {
    padding: 8px 16px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.btn-apply-filter:hover {
    background-color: #45a049;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}
.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
}
@media (max-width: 480px) {
    .product-image-container {
        height: 120px;
    }
}
.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.out-of-stock-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(244, 67, 54, 0.95);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
}
.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-category {
    display: inline-block;
    padding: 4px 10px;
    background-color: #667eea;
    color: white;
    font-size: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    width: fit-content;
}
.product-info h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}
.product-info p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}
.product-description-preview {
    display: none;
}
.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #444;
}
.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}
.btn-edit,
.btn-delete {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
}
.btn-edit {
    background-color: #2196F3;
    color: white;
}
.btn-edit:hover {
    background-color: #0b7dda;
    transform: scale(1.05);
}
.btn-delete {
    background-color: #f44336;
    color: white;
}
.btn-delete:hover:not(:disabled) {
    background-color: #da190b;
    transform: scale(1.05);
}
.btn-cancel {
    background-color: #FF9800 !important;
}
.btn-cancel:hover {
    background-color: #F57C00 !important;
}
.countdown-active {
    background-color: #9E9E9E !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}
.countdown-number {
    font-size: 24px;
    font-weight: bold;
    animation: pulse 1s ease-in-out;
}
@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}
.ready-to-delete {
    background-color: #444 !important;
    animation: readyPulse 0.5s ease-in-out;
}
.ready-to-delete:hover {
    background-color: #45a049 !important;
}
@keyframes readyPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}
.icon-edit,
.icon-delete,
.icon-cancel,
.icon-confirm {
    font-size: 20px;
    display: inline-block;
}
.no-products {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}
@media (max-width: 1024px) {
    .admin-content {
        max-height: none;
    }
}
@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .product-card img {
        height: 120px;
    }
    .product-image-container {
        height: 120px;
    }
}
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 94dvh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}
.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background-color 0.3s;
}
.modal-close:hover {
    background-color: #f5f5f5;
}
.modal-close svg {
    stroke: #999;
}
.modal-close:hover svg {
    stroke: #333;
}
.modal-body {
    padding: 4px 12px 12px 12px;
    overflow-y: auto;
    flex: 1;
}
.modal-body .form-group {
    margin-bottom: 4px;
}
.modal-body .form-buttons {
    margin-top: -2px;
    padding-top: 2px;
    border-top: 1px solid #eee;
}
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95dvh;
    }
    .modal-body {
        padding: 20px;
    }
}
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

button[disabled] .spinner {
    border-color: rgba(0, 0, 0, 0.3);
    border-top-color: #666;
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.delete-image-btn:hover {
    background-color: rgba(244, 67, 54, 1);
    transform: scale(1.1);
}
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.confirm-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    text-align: center;
}

.confirm-modal-content h3 {
    margin: 0 0 15px 0;
    color: #212121;
    font-size: 22px;
}

.confirm-modal-content p {
    margin: 0 0 25px 0;
    color: #555;
    font-size: 16px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-confirm-cancel,
.btn-confirm-ok {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirm-cancel {
    background-color: #e0e0e0;
    color: #333;
}

.btn-confirm-cancel:hover {
    background-color: #d0d0d0;
}

.btn-confirm-ok {
    background-color: #ff5722;
    color: white;
}

.btn-confirm-ok:hover {
    background-color: #e64a19;
}