/* ==========================================================================
   SHARED STRUCTURE (Applies to all styles)
   ========================================================================== */
.tb-toggle-wrapper {
    display: inline-block;
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
    min-width: 120px;
}

.tb-caption {
    margin-top: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: bold;
    color: #444;
    text-transform: uppercase;
}

/* ==========================================================================
   STYLE 1: THE PINT GLASS (CSS-Only Tipping)
   ========================================================================== */
.tb-style-pint .tb-toggle-wrapper {
    overflow: visible; /* Crucial: lets the glass tilt outside the box */
    padding: 30px;
}

.tb-style-pint .glass-container {
    position: relative;
    width: 48px;
    height: 75px;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid #ccc;
    border-top: none;
    border-radius: 2px 2px 12px 12px;
    margin: 0 auto;
    /* This handles the tilt animation */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom center;
}

.tb-style-pint .beer-liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to right, #e67e22, #f1c40f, #e67e22);
    /* This handles the draining animation */
    transition: height 0.6s ease-in-out;
    border-radius: 0 0 8px 8px;
}

/* Foam Head */
.tb-style-pint .beer-liquid:after {
    content: "";
    position: absolute;
    top: -6px; left: 0; width: 100%; height: 12px;
    background: #fff;
    border-radius: 50%;
}

/* --- THE CSS MAGIC --- */

/* 1. When the cookie is OFF (Opted Out), the JS adds 'is-off' or the slider is low */
/* If the liquid height is low (managed by your existing JS), we trigger the tilt here */

.tb-style-pint:has(input[value="0"]) .glass-container {
    transform: rotate(-25deg);
}

.tb-style-pint:has(input[value="100"]) .glass-container {
    transform: rotate(0deg);
}

/* Glass Reflection Shine */
.tb-style-pint .glass-container:before {
    content: "";
    position: absolute;
    top: 10%; left: 15%; width: 5px; height: 80%;
    background: rgba(255,255,255,0.3);
    border-radius: 20px;
    z-index: 2;
}

.tb-style-pint input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 50%; left: 50%;
    width: 100px; height: 80px;
    background: transparent;
    transform: translate(-50%, -50%) rotate(-90deg);
    cursor: pointer;
    z-index: 5;
}

/* ==========================================================================
   STYLE 2: THE WEDDING CAKE (Eaten/Slices Effect)
   ========================================================================== */
.tb-style-cake .cake-container {
    position: relative;
    width: 80px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.tb-style-cake .cake-tier {
    background: #fff;
    border: 2px solid #f8bbd0;
    margin-bottom: 2px;
    transition: all 0.5s ease-in-out;
    position: relative;
}

.tb-style-cake .tier-1 { width: 60px; height: 20px; z-index: 1; }
.tb-style-cake .tier-2 { width: 40px; height: 16px; z-index: 2; }
.tb-style-cake .tier-3 { width: 22px; height: 12px; z-index: 3; }

/* The Eaten Effect (Applied when is-off class is present) */
.tb-style-cake.is-off .cake-tier {
    clip-path: polygon(0% 0%, 50% 0%, 50% 50%, 100% 100%, 0% 100%);
    transform: translateY(10px) rotate(-5deg);
    background: #fdf2f5; 
    opacity: 0.7;
}

.tb-style-cake.is-off .tier-3 { transform: scale(0); opacity: 0; }

.tb-style-cake .cake-plate {
    width: 75px;
    height: 5px;
    background: #e0e0e0;
    border-radius: 10px;
    border-bottom: 2px solid #bbb;
}

/* ==========================================================================
   STYLE 3: THE STUDIO MIXER
   ========================================================================== */
.tb-style-mixer .fader-well {
    position: relative;
    width: 34px;
    height: 140px;
    background: #1a1a1a;
    margin: 0 auto;
    border-radius: 3px;
    border: 1px solid #000;
    box-shadow: inset 0 0 10px #000;
}

.tb-style-mixer .fader-track {
    position: absolute;
    left: 15px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: #333;
}

.tb-style-mixer input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    width: 120px;
    background: transparent;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    cursor: pointer;
    z-index: 5;
}

.tb-style-mixer input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 40px;
    background: linear-gradient(90deg, #333, #666, #333);
    border: 1px solid #000;
    border-radius: 2px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* ==========================================================================
   STYLE 4: THE BASIC TOGGLE
   ========================================================================== */
.tb-style-basic .tb-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.tb-style-basic .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #d1d1d1;
    transition: .4s;
    border-radius: 34px;
}

.tb-style-basic .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.tb-style-basic input:checked + .slider { background-color: #4cd137; }
.tb-style-basic input:checked + .slider:before { transform: translateX(26px); }

/* ==========================================================================
   STYLE 5: CLASSIC RADIO (Old School)
   ========================================================================== */
.tb-style-classic .tb-classic-radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 13px;
    color: #333;
}