/* =============================================
   ATROPHY Slide Panel - 5mc2.com style
   ============================================= */

:root {
    --slide-panel-width: 380px;
    --atrophy-bg: #fff;
    --atrophy-text: #1c1c1c;
    --atrophy-border: #eee;
    --atrophy-gray: #f6f6f6;
    --atrophy-dark: #000;
    --atrophy-white: #fff;
}

/* ----- Overlay ----- */
.atrophy-slide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.atrophy-slide-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ----- Panel ----- */
.atrophy-slide-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--slide-panel-width);
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: var(--atrophy-bg);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.atrophy-slide-panel.is-open {
    transform: translateX(0);
}

/* ----- Panel Header with Logo and Selectors ----- */
.atrophy-slide-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--atrophy-border);
    flex-shrink: 0;
}

.atrophy-slide-panel__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.atrophy-slide-panel__logo img {
    max-height: 20px;
    width: auto;
}

.atrophy-slide-panel__title {
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
    color: var(--atrophy-text);
}

.atrophy-slide-panel__header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.atrophy-panel-selectors {
    display: flex;
    gap: 8px;
    align-items: center;
}

.atrophy-panel-selectors .expand-more {
    font-size: 11px;
    font-weight: 500;
    color: var(--atrophy-text);
    text-transform: uppercase;
    padding: 4px 0;
}

.atrophy-slide-panel__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--atrophy-text);
    padding: 4px;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.atrophy-slide-panel__close:hover {
    opacity: 0.6;
}

/* ----- Panel Body ----- */
.atrophy-slide-panel__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* ----- Categories Section (5mc2.com style) ----- */
.atrophy-panel-categories {
    padding: 8px 0;
}

.atrophy-panel-category {
    border: none;
}

.atrophy-panel-category__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 24px;
    cursor: pointer;
    user-select: none;
}

.atrophy-panel-category__header:hover .atrophy-panel-category__name {
    opacity: 0.5;
}

.atrophy-panel-category__name {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--atrophy-text);
    text-decoration: none;
    flex: 1;
    transition: opacity 0.2s ease;
}

.atrophy-panel-category__name:hover {
    color: var(--atrophy-text);
    opacity: 0.5;
}

/* Arrow/Plus icon */
.atrophy-panel-category .atrophy-panel-section__arrow {
    font-size: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atrophy-panel-category .atrophy-panel-section__arrow::before {
    content: '+';
    font-size: 18px;
    font-weight: 300;
}

.atrophy-panel-category.is-open .atrophy-panel-section__arrow::before {
    content: '−';
}

/* Simple category (no children) */
.atrophy-panel-category--simple {
    border: none;
}

.atrophy-panel-category__link {
    display: block;
    padding: 5px 24px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--atrophy-text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.atrophy-panel-category__link:hover {
    color: var(--atrophy-text);
    opacity: 0.5;
}

/* Subcategories - same style, indented 10px */
.atrophy-panel-category .atrophy-panel-section__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.atrophy-panel-category.is-open .atrophy-panel-section__content {
    max-height: 500px;
}

.atrophy-panel-category .atrophy-panel-section__inner {
    padding: 0 24px 8px 34px;
}

.atrophy-panel-subcategories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.atrophy-panel-subcategories li {
    margin-bottom: 0;
}

.atrophy-panel-subcategories a {
    display: block;
    padding: 5px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--atrophy-text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    transition: opacity 0.2s ease;
}

.atrophy-panel-subcategories a:hover {
    color: var(--atrophy-text);
    opacity: 0.5;
}

.atrophy-panel-subcategories__all {
    display: none;
}

/* ----- Panel Sections (Accordion) ----- */
.atrophy-panel-section {
    border-top: 1px solid var(--atrophy-border);
}

.atrophy-panel-section:first-child {
    border-top: none;
}

.atrophy-panel-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    user-select: none;
}

.atrophy-panel-section__header:hover .atrophy-panel-section__title {
    opacity: 0.5;
}

.atrophy-panel-section__title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    color: var(--atrophy-text);
    transition: opacity 0.2s ease;
}

.atrophy-panel-section__arrow {
    font-size: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--atrophy-text);
}

.atrophy-panel-section__arrow::before {
    content: '+';
    font-size: 18px;
    font-weight: 300;
}

.atrophy-panel-section.is-open .atrophy-panel-section__arrow::before {
    content: '−';
}

.atrophy-panel-section__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.atrophy-panel-section.is-open .atrophy-panel-section__content {
    max-height: 800px;
}

.atrophy-panel-section__inner {
    padding: 0 24px 20px;
}

.atrophy-panel-section__inner ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.atrophy-panel-section__inner li {
    margin-bottom: 0;
}

.atrophy-panel-section__inner a {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    color: var(--atrophy-text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.atrophy-panel-section__inner a:hover {
    opacity: 0.5;
}

/* ----- Custom Links with Chevron ----- */
.atrophy-panel-custom-link {
    border-top: 1px solid var(--atrophy-border);
}

.atrophy-panel-custom-link__anchor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.atrophy-panel-custom-link__anchor:hover {
    opacity: 0.5;
}

.atrophy-panel-custom-link__name {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--atrophy-text);
}

.atrophy-panel-custom-link__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--atrophy-text);
}

.atrophy-panel-custom-link__chevron svg {
    width: 16px;
    height: 16px;
}

/* ----- Spacer ----- */
.atrophy-panel-spacer {
    flex: 1;
    min-height: 20px;
}

/* ----- Size Chart Image ----- */
.atrophy-sizechart-image {
    margin-top: 10px;
}

.atrophy-sizechart-image img {
    width: 100%;
    height: auto;
    display: block;
}

.atrophy-panel-placeholder {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* ----- Social Links ----- */
.atrophy-social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.atrophy-social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--atrophy-text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.atrophy-social-link:hover {
    opacity: 0.6;
    color: var(--atrophy-text);
}

.atrophy-social-link i,
.atrophy-social-link svg {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.atrophy-tiktok-icon {
    display: inline-block;
}

.atrophy-support-links {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--atrophy-border);
}

.atrophy-support-links li {
    margin-bottom: 10px;
}

.atrophy-support-links a {
    font-size: 14px;
    color: var(--atrophy-text);
    text-decoration: none;
}

/* ----- Newsletter (Bottom) ----- */
.atrophy-panel-newsletter {
    padding: 20px 24px;
    background: var(--atrophy-gray);
    border-top: 1px solid var(--atrophy-border);
}

.atrophy-panel-newsletter h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 8px;
    color: var(--atrophy-text);
}

.atrophy-newsletter-text {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px;
    line-height: 1.5;
}

.atrophy-panel-newsletter .block_newsletter {
    margin: 0;
    padding: 0;
}

.atrophy-panel-newsletter .block_newsletter p {
    display: none;
}

.atrophy-panel-newsletter .input-group {
    display: flex;
    border: 1px solid var(--atrophy-text);
    background: var(--atrophy-white);
}

.atrophy-panel-newsletter input[type="email"],
.atrophy-panel-newsletter input[type="text"] {
    border: none !important;
    background: transparent !important;
    padding: 12px !important;
    font-size: 13px;
    flex: 1;
    outline: none;
    min-width: 0;
}

.atrophy-panel-newsletter button[type="submit"],
.atrophy-panel-newsletter .btn {
    border: none !important;
    background: var(--atrophy-dark) !important;
    color: var(--atrophy-white) !important;
    font-size: 11px !important;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    padding: 12px 16px !important;
    white-space: nowrap;
}

/* ----- Account (Bottom) ----- */
.atrophy-panel-account {
    padding: 16px 24px;
    background: var(--atrophy-dark);
    color: var(--atrophy-white);
}

.atrophy-panel-account__logged {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.atrophy-panel-account__greeting {
    font-size: 12px;
    opacity: 0.7;
}

.atrophy-panel-account__links {
    font-size: 13px;
}

.atrophy-panel-account__links a {
    color: var(--atrophy-white);
    text-decoration: none;
}

.atrophy-panel-account__links a:hover {
    text-decoration: underline;
}

.atrophy-panel-account__separator {
    margin: 0 8px;
    opacity: 0.5;
}

.atrophy-panel-account__guest {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.atrophy-panel-account__signin {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--atrophy-white);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.atrophy-panel-account__signin:hover {
    color: var(--atrophy-white);
    opacity: 0.8;
}

.atrophy-panel-account__or {
    font-size: 12px;
    opacity: 0.6;
}

.atrophy-panel-account__register {
    font-size: 13px;
    color: var(--atrophy-white);
    text-decoration: underline;
}

.atrophy-panel-account__register:hover {
    color: var(--atrophy-white);
    opacity: 0.8;
}

/* ----- Body overflow when panel open ----- */
body.slide-panel-open {
    overflow: hidden;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    :root {
        --slide-panel-width: 100vw;
    }

    .atrophy-slide-panel__header {
        padding: 14px 20px;
    }

    .atrophy-slide-panel__logo img {
        max-height: 24px;
    }

    .atrophy-panel-category__header,
    .atrophy-panel-section__header {
        padding: 12px 20px;
    }

    .atrophy-panel-category__link {
        padding: 12px 20px;
    }

    .atrophy-panel-section__inner {
        padding: 0 20px 14px;
    }

    .atrophy-panel-newsletter {
        padding: 16px 20px;
    }

    .atrophy-panel-account {
        padding: 14px 20px;
    }

    .atrophy-panel-custom-link__anchor {
        padding: 12px 20px;
    }
}

/* =============================================
   SIZE CHART MODAL
   ============================================= */

.atrophy-sizechart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.atrophy-sizechart-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.atrophy-sizechart-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.atrophy-sizechart-modal__container {
    position: relative;
    z-index: 1;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.atrophy-sizechart-modal.is-open .atrophy-sizechart-modal__container {
    transform: scale(1);
}

.atrophy-sizechart-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.atrophy-sizechart-modal__close:hover {
    transform: scale(1.1);
    background: #f0f0f0;
}

.atrophy-sizechart-modal__content {
    background: #fff;
    padding: 0;
    overflow: auto;
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
}

.atrophy-sizechart-modal__image {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Body lock when modal is open */
body.sizechart-modal-open {
    overflow: hidden;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .atrophy-sizechart-modal__container {
        max-width: 100vw;
        max-height: 100vh;
        width: 100%;
    }

    .atrophy-sizechart-modal__close {
        position: fixed;
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 28px;
    }

    .atrophy-sizechart-modal__content {
        width: 100%;
        max-height: 100vh;
        padding: 0;
    }

    .atrophy-sizechart-modal__image {
        width: 100%;
    }
}

/* Make size chart button look like other links but as button */
button.atrophy-panel-custom-link__anchor {
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid var(--atrophy-border);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
