/* Basic banner styles */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 99999;
    font-size: 14px;
    box-sizing: border-box;
    line-height: 1.5;
}

.cookie-text { 
    flex: 1 1 auto; 
    min-width: 200px;
    margin-bottom: 0;
}

.cookie-actions { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.cm-btn {
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.cm-btn:hover {
    opacity: 0.9;
}

.cm-btn:active {
    opacity: 0.8;
}

/* hidden helper */
.hidden { display: none !important; }

/* Custom modal */
.cm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 16px;
    box-sizing: border-box;
}

.cm-modal-inner {
    background: #fff;
    color: #111;
    border-radius: 8px;
    padding: 24px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    box-sizing: border-box;
}

.cm-modal h3 { 
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    line-height: 1.3;
}

.cm-modal p {
    margin-top: 0;
    margin-bottom: 16px;
    color: #555;
    line-height: 1.5;
}

#cm-categories {
    margin-bottom: 16px;
}

.cm-category {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.cm-category:last-child {
    border-bottom: none;
}

.cm-category input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.cm-category input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.cm-category label { 
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
    display: block;
}

.cm-category .cm-desc { 
    color: #666; 
    font-size: 13px;
    line-height: 1.5;
    margin-top: 4px;
}

.cm-category .required-text {
    font-weight: normal;
    color: #999;
}

/* Modal buttons container */
#cm-custom-form > div:last-child {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    #cookie-banner {
        padding: 14px;
        font-size: 13px;
        gap: 10px;
    }
    
    .cookie-text {
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    .cookie-actions {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }
    
    .cm-btn {
        flex: 1 1 auto;
        min-width: 80px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .cm-modal-inner {
        padding: 20px;
        max-height: 85vh;
    }
    
    .cm-modal h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    #cookie-banner {
        padding: 12px;
        font-size: 12px;
    }
    
    .cookie-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .cm-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .cm-modal {
        padding: 12px;
    }
    
    .cm-modal-inner {
        padding: 16px;
        border-radius: 6px;
        max-height: 80vh;
    }
    
    .cm-modal h3 {
        font-size: 17px;
        margin-bottom: 10px;
    }
    
    .cm-modal p {
        font-size: 13px;
        margin-bottom: 14px;
    }
    
    .cm-category {
        padding: 10px 0;
        gap: 10px;
    }
    
    .cm-category input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    .cm-category label {
        font-size: 14px;
    }
    
    .cm-category .cm-desc {
        font-size: 12px;
    }
    
    #cm-custom-form > div:last-child {
        flex-direction: column;
        gap: 8px;
    }
    
    #cm-custom-form > div:last-child .cm-btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    #cookie-banner {
        padding: 10px;
        font-size: 11px;
    }
    
    .cm-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .cm-modal-inner {
        padding: 14px;
    }
    
    .cm-modal h3 {
        font-size: 16px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (max-height: 500px) {
    .cm-modal-inner {
        max-height: 95vh;
    }
    
    .cm-modal h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .cm-modal p {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .cm-category {
        padding: 8px 0;
    }
}

