/* ============================================================
   Opening Hours Widget – Frontend Styles
   ============================================================ */

/* Collapsed Tab Trigger */
.ohw-tab-trigger {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99998;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: #fff;
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 2px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 52px;
}

.ohw-tab-trigger:hover {
    box-shadow: 2px 4px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(-50%) scale(1.04);
}

.ohw-tab-trigger.ohw-pos-left {
    left: 0;
    border-radius: 0 10px 10px 0;
}

.ohw-tab-trigger.ohw-pos-right {
    right: 0;
    border-radius: 10px 0 0 10px;
}

.ohw-tab-icon {
    width: 28px;
    height: 28px;
    color: var(--ohw-accent);
}

.ohw-tab-icon svg {
    width: 100%;
    height: 100%;
}

.ohw-tab-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ohw-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ohw-status-dot.open {
    background: var(--ohw-primary);
    box-shadow: 0 0 6px var(--ohw-primary);
    animation: ohw-pulse 2s ease-in-out infinite;
}

.ohw-status-dot.closed {
    background: var(--ohw-closed);
}

@keyframes ohw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.ohw-tab-text {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    color: #333;
    transform: rotate(180deg);
    white-space: nowrap;
}

/* Hidden state */
.ohw-tab-trigger.ohw-hidden {
    transform: translateY(-50%) translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.ohw-pos-right.ohw-tab-trigger.ohw-hidden {
    transform: translateY(-50%) translateX(100%);
}

/* ============================================================
   Expanded Panel
   ============================================================ */

.ohw-panel {
    position: fixed;
    top: 50%;
    transform: translateY(-50%) translateX(-110%);
    z-index: 99999;
    width: 300px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 0 14px 14px 0;
    box-shadow: 4px 4px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: #333;
}

.ohw-panel.ohw-pos-left {
    left: 0;
    border-radius: 0 14px 14px 0;
}

.ohw-panel.ohw-pos-right {
    right: 0;
    left: auto;
    border-radius: 14px 0 0 14px;
    transform: translateY(-50%) translateX(110%);
}

.ohw-panel.ohw-open {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    pointer-events: all;
}

/* Close button */
.ohw-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    z-index: 2;
}

.ohw-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Header */
.ohw-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 12px;
}

.ohw-header-icon {
    width: 36px;
    height: 36px;
    color: var(--ohw-accent);
    flex-shrink: 0;
}

.ohw-header-icon svg {
    width: 100%;
    height: 100%;
}

.ohw-store-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.ohw-store-address {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Status Banner */
.ohw-status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.ohw-status-banner.open {
    background: color-mix(in srgb, var(--ohw-primary) 12%, transparent);
    color: var(--ohw-primary);
}

.ohw-status-banner.closed {
    background: color-mix(in srgb, var(--ohw-closed) 10%, transparent);
    color: var(--ohw-closed);
}

.ohw-status-dot-lg {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ohw-status-dot-lg.open {
    background: var(--ohw-primary);
    box-shadow: 0 0 8px var(--ohw-primary);
    animation: ohw-pulse 2s ease-in-out infinite;
}

.ohw-status-dot-lg.closed {
    background: var(--ohw-closed);
}

.ohw-status-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ohw-status-text strong {
    font-size: 14px;
    font-weight: 700;
}

.ohw-status-text span {
    font-size: 12px;
    opacity: 0.85;
}

/* Sections */
.ohw-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    padding: 16px 16px 6px;
}

/* Hours Table */
.ohw-hours-list {
    width: 100%;
    border-collapse: collapse;
    padding: 0 16px;
}

.ohw-hours-list tr {
    border-bottom: 1px solid #f2f2f2;
}

.ohw-hours-list tr:last-child {
    border-bottom: none;
}

.ohw-hours-list td {
    padding: 7px 16px;
    font-size: 13px;
}

.ohw-day-label {
    font-weight: 500;
    color: #666;
    width: 40px;
}

.ohw-day-hours {
    text-align: right;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.ohw-today {
    background: color-mix(in srgb, var(--ohw-accent) 6%, transparent);
}

.ohw-today .ohw-day-label {
    font-weight: 700;
    color: var(--ohw-accent);
}

.ohw-today .ohw-day-hours {
    font-weight: 700;
    color: var(--ohw-accent);
}

.ohw-closed-text {
    color: var(--ohw-closed);
    font-style: italic;
    font-weight: 500;
}

/* Contact */
.ohw-contact-section {
    padding-bottom: 4px;
}

.ohw-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
    border-radius: 4px;
    margin: 0 8px;
}

.ohw-contact-item:hover {
    background: #f5f5f5;
    color: var(--ohw-accent);
}

.ohw-contact-item svg {
    color: var(--ohw-accent);
    flex-shrink: 0;
}

/* Footer */
.ohw-footer {
    padding: 8px 16px 14px;
    text-align: center;
}

.ohw-hide-btn {
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 12px;
    transition: color 0.2s;
}

.ohw-hide-btn:hover {
    color: #666;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 480px) {
    .ohw-panel {
        width: calc(100vw - 20px);
        max-width: 320px;
    }

    .ohw-tab-trigger {
        top: auto;
        bottom: 20px;
        transform: translateY(0);
    }

    .ohw-tab-trigger:hover {
        transform: translateY(0) scale(1.04);
    }

    .ohw-tab-trigger.ohw-hidden {
        transform: translateY(0) translateX(-100%);
    }

    .ohw-pos-right.ohw-tab-trigger.ohw-hidden {
        transform: translateY(0) translateX(100%);
    }

    .ohw-panel {
        top: auto;
        bottom: 10px;
        transform: translateY(0) translateX(-110%);
    }

    .ohw-panel.ohw-pos-right {
        transform: translateY(0) translateX(110%);
    }

    .ohw-panel.ohw-open {
        transform: translateY(0) translateX(0);
    }

    .ohw-tab-text {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 7px;
    }
}

/* Scrollbar */
.ohw-panel::-webkit-scrollbar {
    width: 4px;
}

.ohw-panel::-webkit-scrollbar-track {
    background: transparent;
}

.ohw-panel::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* User chose to hide – applied via early inline script, no flash */
.ohw-user-hidden .ohw-tab-trigger,
.ohw-user-hidden .ohw-panel {
    display: none !important;
}
