/* CSS Custom Properties */
:root {
    /* Colors */
    --color-black: #000;
    --color-white: #ffffff;
    --color-gray-light: #ccc;
    --color-gray-medium: #999;
    --color-gray-dark: #666;
    --color-gray-darker: #333;
    
    /* Typography */
    --font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-size-small: 14px;
    --font-size-base: 16px;
    --font-size-medium: 18px;
    --font-size-large: 20px;
    --font-size-xlarge: 22px;
    
    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
    
    /* Layout */
    --sidebar-width: 250px;
    --cart-icon-size-mobile: 56px;
    --cart-icon-size-desktop: 40px;
    --modal-z-index: 2000;
    --modal-close-z-index: 2001;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-white);
    color: var(--color-black);
    line-height: 1.2;
    font-weight: var(--font-weight-normal);
}

/* Header */
.header {
    background: transparent;
    padding: 20px 30px;
}

.nav-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: var(--font-size-medium);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    color: var(--color-gray-light);
    transition: color var(--transition-normal);
    padding: var(--spacing-xs) 0;
    font-family: var(--font-family);
}

.toggle-btn.active {
    color: var(--color-black);
    font-weight: var(--font-weight-bold);
}

.toggle-btn:hover {
    color: var(--color-gray-dark);
}

.search-container {
    display: flex;
    align-items: baseline;
    margin-bottom: 20px;
    gap: 10px;
}

.search-label {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    white-space: nowrap;
    line-height: 1;
}

.search-input {
    border: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    outline: none;
    font-size: 16px;
    padding: 0;
    padding-top: 2px;
    background: transparent;
    flex: 1;
    min-width: 100px;
    line-height: 1;
    height: 1em;
    margin-bottom: -1px;
    -webkit-appearance: none;
    appearance: none;
}

.search-input::-webkit-search-cancel-button {
    display: none;
}

.title-container {
    position: fixed;
    right: 30px;
    top: 0;
    bottom: 100px;
    display: flex;
    align-items: center;
    z-index: 999;
}

.main-title {
    font-size: calc(100vh / 12);
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    line-height: 1;
    letter-spacing: 0.02em;
}

/* Main content */
.main-content {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    padding: 20px 30px;
    background: white;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.park-list h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 20px 0 5px 0;
    color: #000;
    line-height: 1.1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.park-list h3:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.park-list ul {
    list-style: none;
    margin-bottom: 10px;
}

.park-list li {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin-bottom: 1px;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.park-list li:hover {
    color: #000;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.park-list li.active {
    color: #000;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Date list styling */
.date-list {
    flex: 1;
    overflow-y: auto;
}

.date-list ul {
    list-style: none;
    margin: 20px 0;
}

.date-list li {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin-bottom: 2px;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1.3;
}

.park-list {
    flex: 1;
    overflow-y: auto;
}

.date-list li:hover {
    color: #000;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.date-list li.active {
    color: #000;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.sidebar-info-btn {
    background: none;
    border: none;
    color: #999;
    text-decoration: underline;
    cursor: pointer;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    padding: 0;
    margin-top: 20px;
    text-align: left;
    transition: color 0.2s ease;
    display: block;
    width: auto;
}

.sidebar-info-btn:hover {
    color: #000;
}

/* Product grid */
.product-grid {
    flex: 1;
    padding: 30px 30px 30px 30px;
    padding-right: 120px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    align-content: start;
}

/* Product card */
.product-card {
    cursor: pointer;
}

.product-image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 4px;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.product-info {
    margin-top: 15px;
    padding: 0 20px;
    text-align: center;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin-bottom: 2px;
    line-height: 1.1;
}

.product-date {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    line-height: 1.1;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    z-index: 1000;
}

.footer-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.footer-btn:hover {
    transform: scale(1.05);
}

.info-icon {
    width: 32px;
    height: 32px;
    border: 3px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.cart-icon {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* Desktop-specific styles consolidated */
@media (min-width: 769px) {
    /* Cart icons in footer */
    .cart-icon {
        width: var(--cart-icon-size-desktop);
        height: var(--cart-icon-size-desktop);
    }
    
    .cart-image {
        width: var(--cart-icon-size-desktop);
        height: var(--cart-icon-size-desktop);
    }
    
    .cart-count {
        font-size: var(--font-size-large);
    }
    
    /* Cart modal alignment */
    #cart-modal .modal-content {
        max-width: 550px;
        margin-left: auto;
        margin-right: 0;
        padding-right: var(--spacing-xl);
    }
    
    /* Cart badge in modal */
    .cart-badge-icon {
        width: var(--cart-icon-size-desktop);
        height: var(--cart-icon-size-desktop);
    }
    
    .cart-badge-image {
        width: var(--cart-icon-size-desktop);
        height: var(--cart-icon-size-desktop);
    }
    
    .cart-badge-count {
        font-size: var(--font-size-large);
    }
    
    /* Sidebar always visible */
    .sidebar {
        position: relative;
        opacity: 1;
        pointer-events: all;
        width: var(--sidebar-width);
        height: auto;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .mobile-menu-close {
        display: none;
    }
}

.cart-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-70%, -70%);
    background: transparent;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    z-index: 10;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 2000;
    overflow-y: auto;
}

.modal.show {
    display: block;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 1400px;
    height: 100vh;
    position: relative;
    display: block;
    padding: 40px;
    box-sizing: border-box;
    margin: 0 auto;
}


.modal-close {
    position: fixed;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2001;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-detail-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 80px);
    gap: 0;
    align-items: stretch;
}

.product-image-container {
    flex: 2;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 40px;
    box-sizing: border-box;
}

.product-detail-image {
    width: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    transition: height 0.3s ease;
}

.product-details-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    padding-left: 0;
    box-sizing: border-box;
    text-align: left;
}

.cart-badge-fixed {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 2001;
}

.cart-badge-icon {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
}


.cart-badge-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-70%, -70%);
    background: transparent;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    z-index: 10;
}

.add-to-cart-btn:hover {
    color: #666 !important;
}

.checkout-btn:hover {
    color: #666 !important;
}

/* Flash overlay for add to cart */
.cart-flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.cart-flash-overlay.show {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile header - hidden on desktop */
.mobile-header {
    display: none;
}

.mobile-nav-toggle {
    display: flex;
    gap: 8px;
}

.mobile-toggle-btn {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.3s;
}

.mobile-toggle-btn.active {
    color: #000;
    font-weight: 700;
}

.filter-display-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-display {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    padding: 5px 0;
    line-height: 1.2;
    text-align: right;
    max-width: 120px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.filter-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 14px;
    height: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-clear-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mobile-menu-close {
    display: none;
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 0;
        position: fixed;
        top: 15px;
        left: 20px;
        right: 20px;
        background: transparent;
        z-index: 1001;
    }
    
    .mobile-nav-toggle {
        align-self: flex-start;
    }
    
    .filter-clear-btn {
        display: flex;
        margin-top: 7px;
        align-self: flex-start;
    }
    
    .filter-display-container {
        align-items: baseline;
        align-self: flex-start;
    }
    
    .filter-display {
        line-height: 1;
    }
    
    .nav-toggle {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: white;
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        overflow-y: auto;
        padding: 60px 20px 40px 20px;
    }
    
    .sidebar.mobile-menu-open {
        opacity: 1;
        pointer-events: all;
    }
    
    .mobile-header.menu-open .filter-display {
        display: none;
    }
    
    .sidebar.mobile-menu-open .mobile-menu-close {
        display: block;
        position: fixed;
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1002;
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar.mobile-menu-open .mobile-menu-close img {
        width: 24px;
        height: 24px;
        display: block;
    }
    
    .sidebar .search-container {
        margin-bottom: 30px;
        margin-top: 20px;
    }
    
    .sidebar .search-label {
        font-size: 18px !important;
        font-weight: 700 !important;
    }
    
    .sidebar .search-input {
        font-size: 18px !important;
        font-weight: 700 !important;
        flex: 0 1 auto !important;
        max-width: 150px !important;
    }
    
    .sidebar .park-list,
    .sidebar .date-list {
        max-width: 800px;
    }
    
    .sidebar .park-list ul,
    .sidebar .date-list ul {
        padding-left: 0;
    }
    
    .sidebar .park-list h3 {
        font-size: 18px !important;
        font-weight: 700 !important;
        margin-bottom: 10px;
        cursor: pointer;
    }
    
    .sidebar .park-list li {
        font-size: 18px !important;
        font-weight: 700 !important;
        margin-bottom: 5px;
        cursor: pointer;
    }
    
    .sidebar .date-list li {
        font-size: 18px !important;
        font-weight: 700 !important;
        margin-bottom: 5px;
        cursor: pointer;
    }
    
    .mobile-menu-overlay {
        display: none;
    }
    
    .header {
        padding: 15px 20px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 999;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0px;
        column-gap: -10px;
        padding: 30px 20px;
        padding-right: 20px;
        margin-top: 110px;
        max-width: calc(100vw - 20px);
    }
    
    .product-card {
        max-width: 180px;
        margin: 0 auto;
    }
    
    .product-image {
        max-width: none;
        width: 200px;
        height: 230px;
        object-fit: cover;
        object-position: top;
        transform: translateX(-10px);
        overflow: hidden;
    }
    
    .product-info {
        padding: 0 5px;
    }
    
    .product-title {
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: none;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .title-container {
        right: 10px;
        top: 80px;
        bottom: 120px;
        align-items: flex-end;
    }
    
    .main-title {
        font-size: calc(100vh / 22);
    }
    
    .footer {
        padding: 0;
        right: 5px;
        bottom: 15px;
    }
    
    .cart-badge-fixed {
        right: 5px;
        bottom: 19px;
    }
    
    .modal-content {
        padding: 20px;
        padding-top: 60px;
        height: auto;
        min-height: 100vh;
    }
    
    .modal {
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    .product-detail-container {
        flex-direction: column;
        height: auto;
        gap: 10px;
        min-height: auto;
        align-items: flex-start;
    }
    
    .product-image-container {
        flex: none;
        height: 40vh;
        padding: 20px;
        padding-bottom: 15px;
    }
    
    .product-image-container.cart-spacer {
        display: none;
    }
    
    .product-details-container {
        flex: none;
        padding: 20px;
        padding-top: 15px;
        padding-bottom: 0;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        width: 100%;
        gap: 15px !important;
    }
    
    /* Align product title to top in modal */
    .modal .product-details-container {
        padding-top: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .modal .product-details-container > div:first-child {
        align-self: flex-start !important;
        width: 100%;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .modal .product-details-container h2 {
        align-self: flex-start !important;
        text-align: left !important;
        margin-top: 0 !important;
    }
    
    .modal .product-details-container .product-date {
        align-self: flex-start !important;
        text-align: left !important;
    }
    
    .modal .content-swap-container {
        margin-top: 0 !important;
    }
    
    .modal-close {
        top: 20px;
        right: 20px;
    }
    
    .product-details-container > div:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .product-details-container h2 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0px;
        column-gap: -15px;
        padding: 20px;
        padding-right: 15px;
        max-width: calc(100vw - 15px);
    }
    
    .product-card {
        max-width: 160px;
        margin: 0 auto;
    }
    
    .product-image {
        max-width: none;
        width: 180px;
        height: 210px;
        object-fit: cover;
        object-position: top;
        transform: translateX(-10px);
        overflow: hidden;
    }
    
    .product-info {
        padding: 0 2px;
    }
    
    .product-title {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: none;
    }
    
    .product-date {
        font-size: 12px;
        font-weight: 700;
    }
    
    /* Product detail modal spacing adjustments for mobile */
    .modal .product-date {
        margin-bottom: 20px !important; /* Less space between date and "Select Size" */
    }
    
    .content-swap-container {
        margin: 20px 0 !important; /* Less top margin on mobile */
        padding-bottom: 40px !important; /* Space below print details for scrolling */
    }
    
    .back-to-sizes-btn {
        margin-bottom: 20px !important; /* Add space after "Back to Sizes" button */
    }
    
    .add-to-cart-btn {
        margin-bottom: 60px !important; /* Space below Add to Cart button for scrolling */
    }
    
    /* Ensure modal content can scroll */
    .modal-content {
        padding-bottom: 40px;
    }
    
    /* Reduce line-height for checkout button when text breaks to two lines */
    .checkout-btn {
        line-height: 1.2 !important;
        font-size: 20px !important;
    }
}
