/* Ajánlatok gomb és modal stílusok */

/* Ajánlatok gomb */
.floating-offers {
    position: fixed;
    bottom: 140px; /* A Google gomb alatt, a kamera gomb felett */
    right: 20px;
    background: #FFD700; /* Arany színű háttér az ajánlatokhoz */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: var(--z-floating); /* 800 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-offers i {
    color: #fff;
    font-size: 20px;
}

.floating-offers:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Mobilon pozicionálás */
@media (max-width: 768px) {
    .floating-offers {
        bottom: 195px; /* Magasabbra a mobil nézeten */
    }
}

/* Ajánlatok modal */
.offers-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-modal); /* 3000 */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.offers-modal.active {
    display: flex;
}

.offers-modal .modal-content {
    position: relative;
    background: white;
    max-width: 90%;
    max-height: 90vh;
    width: 600px;
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.offers-modal .close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff; /* Fehér szín a jobb láthatóságért */
    font-size: 28px;
    background: rgba(0, 0, 0, 0.6); /* Sötét háttér a jobb kontrasztért */
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    z-index: var(--z-local); /* Lokális kiemelés a modalon belül */
    padding: 0;
    border-radius: 50%; /* Kerek forma */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Árnyék hozzáadva */
}

.offers-modal .close-modal:hover {
    transform: rotate(90deg);
}

.offers-content {
    padding: 25px;
}

.offers-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--brand-color);
    font-family: var(--menu-font, 'Playfair Display');
    font-size: 24px;
    font-weight: 600;
}

.offers-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.offer-item {
    display: flex;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.offer-item-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.offer-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-item-details {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.offer-item-details h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--header-color, #333);
    font-weight: 600;
}

.offer-item-details p {
    margin: 0 0 15px;
    font-size: 14px;
    color: var(--text-color, #666);
    line-height: 1.5;
    flex-grow: 1;
}

.offer-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--price-color, #e67e22);
    text-align: right;
    margin-top: auto;
}

.no-offers {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* Sötét mód - használjuk a body-n lévő data-theme attribútumot */
body[data-theme="dark"] .offers-modal .modal-content,
html[data-theme="dark"] .offers-modal .modal-content {
    background: #2d2d2d;
    color: #fff;
}

body[data-theme="dark"] .offers-modal .close-modal,
html[data-theme="dark"] .offers-modal .close-modal {
    color: #fff;
    background: rgba(0, 0, 0, 0.6); /* Sötét mód háttér */
}

body[data-theme="dark"] .offer-item,
html[data-theme="dark"] .offer-item {
    background: #333;
    border: 1px solid #444;
}

body[data-theme="dark"] .offer-item-details h3,
html[data-theme="dark"] .offer-item-details h3 {
    color: #fff;
}

body[data-theme="dark"] .offer-item-details p,
html[data-theme="dark"] .offer-item-details p {
    color: #ccc;
}

body[data-theme="dark"] .no-offers,
html[data-theme="dark"] .no-offers {
    color: #aaa;
}

/* Auto mód támogatás (rendszer beállítás alapján) */
@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .offers-modal .modal-content {
        background: #2d2d2d;
        color: #fff;
    }
    
    body[data-theme="auto"] .offers-modal .close-modal {
        color: #fff;
        background: rgba(0, 0, 0, 0.6); /* Sötét mód háttér */
    }
    
    body[data-theme="auto"] .offer-item {
        background: #333;
        border: 1px solid #444;
    }
    
    body[data-theme="auto"] .offer-item-details h3 {
        color: #fff;
    }
    
    body[data-theme="auto"] .offer-item-details p {
        color: #ccc;
    }
    
    body[data-theme="auto"] .no-offers {
        color: #aaa;
    }
}

/* Mobil optimalizáció */
@media (max-width: 768px) {
    .offers-modal .modal-content {
        max-width: 95%;
        width: 95%;
        max-height: 80vh;
        margin: 0 auto;
    }
    
    .offers-content {
        padding: 20px 15px;
    }
    
    .offers-content h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .offer-item {
        flex-direction: column;
        margin-bottom: 15px;
    }
    
    .offer-item-image {
        width: 100%;
        height: 200px;
    }
    
    .offer-price {
        margin-top: 10px;
    }
    
    /* Bezárás gomb módosítása mobilon */
    .offers-modal .close-modal {
        top: 15px; /* Kicsit lejjebb */
        right: 15px; /* Kicsit jobban jobbra */
        width: 44px; /* Nagyobb méret a jobb érinthetőségért */
        height: 44px; /* Nagyobb méret a jobb érinthetőségért */
        font-size: 30px; /* Nagyobb ikon méret */
    }
}

/* Kisebb képernyőkre optimalizálás */
@media (max-width: 480px) {
    .offers-modal .modal-content {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .offers-content {
        padding: 15px 10px;
    }
    
    .offer-item-image {
        height: 180px;
    }
    
    .offer-item-details {
        padding: 12px;
    }
    
    .offer-item-details h3 {
        font-size: 16px;
    }
    
    .offer-item-details p {
        font-size: 13px;
    }
    
    .offer-price {
        font-size: 16px;
    }
    
    .offers-modal .close-modal {
        top: 10px;
        right: 10px;
        width: 48px; /* Még nagyobb méret */
        height: 48px; /* Még nagyobb méret */
    }
}

/* Akadálymentesség */
@media (prefers-reduced-motion: reduce) {
    .floating-offers,
    .offers-modal .close-modal {
        transition: none !important;
    }
}

/* Animációk */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.offers-modal.active {
    animation: fadeIn 0.3s ease forwards;
}

/* Fokuszálható elemek megfelelő kiemelése */
.floating-offers:focus,
.offers-modal .close-modal:focus {
    outline: 2px solid #4d90fe;
    outline-offset: 2px;
}

/* Érintőképernyő optimalizáció */
@media (hover: none) {
    .floating-offers:active {
        transform: scale(0.95);
    }
    
    .offers-modal .close-modal {
        padding: 10px;
    }
}

/* Kategória címek */
.category-section {
    margin-bottom: 25px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 18px;
    color: var(--brand-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Sötét módban a kategória címek formázása */
body[data-theme="dark"] .category-title,
html[data-theme="dark"] .category-title {
    color: #e6c9a8;
    border-bottom-color: rgba(255,255,255,0.1);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .category-title {
        color: #e6c9a8;
        border-bottom-color: rgba(255,255,255,0.1);
    }
}