/**
 * OPA Commerce - Bottom Bar Module Styles
 * Uses Design System CSS Variables natively.
 */

.opa-bottom-bar-wrapper {
    position: var(--opa-bb-position, fixed);
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--opa-bb-height, 60px);
    background-color: var(--opa-surface);
    border-top: 1px solid var(--opa-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    font-family: var(--opa-font-primary);
}

.opa-bottom-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--opa-text);
    height: 100%;
    transition: color 0.2s ease;
}

.opa-bottom-bar-item:hover,
.opa-bottom-bar-item:active {
    color: var(--opa-primary);
}

.opa-bottom-bar-icon {
    font-size: var(--opa-bb-icon-size, 24px);
    line-height: 1;
    margin-bottom: 2px;
}

.opa-bottom-bar-label {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
}

/* Visibility Control generated by PHP class logic based on show_on settings */
@media (min-width: 1025px) {
    .opa-hide-desktop {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .opa-hide-tablet {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .opa-hide-mobile {
        display: none !important;
    }
}

/* Glassmorphism overrides for the bar */
.opa-bottom-bar-wrapper {
    background: rgba(20, 20, 20, 0.85); /* fallback dark */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 15px rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Bottom Sheet Overlay & Popup */
.opa-bottom-sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.opa-bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* The Bottom Sheet itself */
.opa-bottom-sheet {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: var(--opa-surface);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
    border-top: 1px solid var(--opa-border);
}

.opa-bottom-sheet-overlay.active .opa-bottom-sheet {
    bottom: 0;
}

.opa-bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--opa-border);
}

.opa-bottom-sheet-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.opa-bottom-sheet-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--opa-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.opa-bottom-sheet-close:hover {
    background: var(--opa-primary);
    color: #fff;
}

.opa-bottom-sheet-content {
    overflow-y: auto;
    padding: 20px;
}

.opa-bb-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.opa-bb-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--opa-text);
    text-align: center;
}

.opa-bb-cat-image {
    width: 100%;
    aspect-ratio: 1/1;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--opa-border);
}

.opa-bb-cat-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opa-bb-cat-name {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.opa-bb-see-all {
    margin-top: 10px;
    text-align: center;
}

.opa-bb-btn-primary {
    display: block;
    background: var(--opa-primary);
    color: #ffffff !important;
    padding: 14px 20px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    transition: opacity 0.2s;
}

.opa-bb-btn-primary:hover {
    opacity: 0.9;
}
