/* The Large Bottle Image */
#showcasePhoto {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-out;
    will-change: opacity, transform;
}

/* --- General Styles --- */
.store-note {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    min-width: 220px;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(126, 126, 126, 0.2);
    border-radius: 25px;
    box-shadow: 0px 3px 10px 1px rgba(0, 0, 0, 0.3);
    padding: 1rem;
    margin-top: 25px;
    margin-bottom: 25px;
    letter-spacing: 0.075em;
    text-align: center;
    align-items: center;
    text-align: center;
}

.exclusive-content {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    padding: 0;
    margin-top: 0px;
    align-items: center;
    text-align: center;
}

/* --- Card Styles --- */
.card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    letter-spacing: 0.075em;
}

.wine-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 3px;
    color: inherit;
    text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.5);
}

.wine-specs {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 10px;
}

.wine-rating {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.1;
    color: inherit;
    text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.5);
    align-items: center;
    text-align: center;
    margin-bottom: 15px;
}

.wine-rating p {
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
    margin-top: 0px;
    margin-bottom: 15px;
}

.wine-rating strong {
    font-size: 1.3rem;
    font-weight: 800;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.wine-description {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.5;
    align-items: left;
    text-align: start;
    margin-bottom: 15px;
    color: inherit;
    text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.5);
}

.wine-description p {
    margin-bottom: 15px;
}

.wine-price {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.wine-review {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.4;
    color: inherit;
    text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    align-items: center;
    text-align: center;
}

.wine-review-author {
    font-size: 0.95rem;
    font-weight: 600;
    align-items: right;
    text-align: right;
    margin-top: 5px;
    color: inherit;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
}

.order-btn {
    display: inline-block;
    position: relative;
    padding: 5px 15px 6px 15px;
    border: 2px solid rgba(54, 54, 54, 0.5);
    background: rgba(255, 204, 51, 0.9);
    color: #ffffff !important;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    white-space: nowrap;
}

.panel-title {
    font-size: 2rem;
    padding: 0;
    color: #ffcc33;
}

.header-text {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* --- Showcase Container & Nav --- */
.wine-showcase-container {
    max-width: 100%;
    margin-top: 40px;
}

.wine-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    position: sticky;
}

/* --- The Showcase Grid (Desktop) --- */
.wine-showcase {
    display: grid;
    grid-template-columns: 200px 1fr;
    /* Fixed space for bottle, flexible for cards */
    align-items: start;
    gap: 0;
    position: relative;
}

.showcase-area {
    position: relative;
    z-index: 10;
    /* Sits above the content area */
}

.sticky-bottle-wrap {
    width: 300px;
    height: auto;
    position: relative;
    /* WiP Use the dynamic variable from main.js, with a 171px fallback */
    top: -65px;
    /* var(--header-height, 171px); */
    padding: 0px;
    z-index: 8;
    transition: top 0.3s ease;
}

.sticky-bottle-wrap img {
    width: 100%;
    height: auto;
    margin-right: -1px;
    margin-top: 0px;
    filter: drop-shadow(10px 10px 20px rgba(0, 0, 0, 0.5));
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-out;
}


/* --- Panels & Themes --- */
/* The Content Panels */
.wine-panel {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    padding: 40px 40px 40px 120px;
}

.wine-panel.active {
    display: block;
    opacity: 1;
    /* Turn the content on */
}

/* Make sure to bring a bottle to the party */
#showcasePhoto {
    opacity: 1;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-out;
}

/* Make sure the area has a default height for smooth transitions */
.wine-display-area {
    transition: min-height 0.4s ease-in-out;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--accent-color);
    overflow: clip;
    min-height: 400px;
    width: 100%;
    /* min-height to prevent jumping */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Data Themes for Easy Color Control */
[data-theme="red"] {
    background: linear-gradient(135deg, #40121a 0%, #27070d 100%);
    color: #ffffff;
}

[data-theme="white"] {
    background: linear-gradient(135deg, #eeecd7 0%, #ffe4e1 100%);
    color: #333333;
}

[data-theme="rose"] {
    background: linear-gradient(135deg, #fdf5ee 0%, #ffe4e1 100%);
    color: #333333;
}

[data-theme="black"] {
    background: linear-gradient(135deg, #2a2a2a 0%, #111 100%);
    color: #ffffff;
}

.wine-panel h3 {
    margin-bottom: 10px;
    font-size: 2rem;
    color: inherit;
}

/* --- Panel Header & Controls --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 15px;
}

.view-controls {
    position: relative;
    right: -90%;
    top: -10px;
    display: flex;
    width: 80px;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: inherit;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.5;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.view-toggle-btn.active {
    background: var(--accent-color);
    opacity: 1;
    color: white;
}

/* --- Default Grid View --- */
.wine-card-grid {
    display: grid;
    /* Change repeat(auto-fit, minmax(300px, 300px)) to something fluid */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    justify-content: space-evenly;
    align-items: start;
    width: 100%;
}

.wine-card {
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 25px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
    background-blend-mode: lighten;
    box-shadow: 0px 3px 10px 1px rgba(0, 0, 0, 0.5);
}

.card-img-wrap img {
    min-height: 400px;
    max-height: 750px;
    height: 100%;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    margin-bottom: 12px;
}

.card-actions-controls {
    width: 100%;
    max-width: 300px;
    align-items: center;
    justify-content: center;
}

/* --- List View Overrides --- */
.wine-card-grid.view-list {
    grid-template-columns: 1fr;
    /* Stacked rows */
}

.wine-card-grid.view-list .wine-card {
    flex-direction: row;
    /* Side-by-side */
    text-align: left;
    align-items: center;
    padding: 15px 25px;
}

.wine-card-grid.view-list .card-img-wrap {
    flex: 0 0 80px;
    /* Small image area */
    margin-right: 25px;
}

.wine-card-grid.view-list .card-img-wrap img {
    height: 200px;
    object-fit: contain;
    margin-bottom: 0;
}

.wine-card-grid.view-list .card-content-wrapper {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 30px;
}

.wine-card-grid.view-list .wine-title {
    margin-bottom: 5px;
}

.wine-card-grid.view-list .card-actions {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 20px;
}

.wine-card-grid.view-list .wine-price {
    text-align: right;
    align-items: right;
    padding-right: 15px;
    margin-bottom: 15px;
}


/* Responsive: Force Grid/Stack on mobile even if List is selected */
@media (max-width: 720px) {
    .wine-display-area {
        transition: min-height 0.4s ease-in-out;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 20px;
        border: 1px solid var(--accent-color);
        overflow: clip;
        min-height: 400px;
        width: 100%;

        /* min-height to prevent jumping */
    }

    .wine-showcase-container {
        width: 100%;
        max-width: fit-content;
        padding: 0px;
        margin: 10px 0px;
    }

    .wine-panel {
        width: 100%;
        margin: 0px;
        padding: 0px 0px 0px 0px;
        /* Remove left padding for mobile */
    }

    .card-content-wrapper {
        padding: 0px;
        margin: 0px;
    }

    .card-img-wrap img {
        min-height: 400px;
        max-height: 750px;
        height: 100%;
        width: auto;
        max-width: 220px;
        object-fit: contain;
        margin-bottom: 12px;
    }

    .standard-text {
        width: 100%;
        min-width: 100%;
        max-width: max-content;
        margin: 0px;
        padding: 0px 0px 0px 0px;
        /* Remove left padding for mobile */
    }

    .wine-card {
        width: 100%;
        min-width: 250px;
        margin: 0px;
        padding-top: 15px;
    }

    .wine-card-grid {
        grid-template-columns: repeat(auto-fit, minmax(1fr));
    }

    .wine-card-grid.view-list .wine-card {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        flex-direction: column;
        text-align: center;
    }

    .wine-card-grid.view-list .card-content-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .view-controls {
        display: none;
    }

    /* Hide toggle on small screens */

    .card-actions-controls {
        position: relative;
        top: 0;
        width: 220px;
        max-width: 220px;
        text-align: center;
        align-items: center;
    }


    .panel-title {
        font-size: 1.5rem;
        line-height: 1.1;
        padding: 0;
        color: #ffcc33;
    }

}

/* --- Mobile Responsiveness --- */
@media (max-width: 992px) {
    .wine-showcase {
        grid-template-columns: 1fr;
        /* Stack vertically */
    }

    .showcase-area {
        display: none;
        /* Hide the big bottle on mobile to save space */
    }

    .wine-panel {
        padding: 30px 20px;
        /* Remove the extra left padding */
    }

    .wine-nav {
        top: 140px;
        /* Adjust for mobile header height */
    }

    .exclusive-content {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
        margin-top: 15px;
        margin-bottom: 15px;
        line-height: 2.25rem;
        align-items: center;
        text-align: end;
    }

    /*     .nav-item {
        flex: 0 1 70px;
    }

    .nav-item span { font-size: 0.6rem; }
 */
}