/* The main calendar widget.  DIV containing a table. */

.calendar {
  position: relative;
  display: none;
  border-top: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  border-left: 2px solid #fff;
  font-size: 11px;
  color: #000;
  cursor: default;
  background: #d4d0c8;
  font-family: tahoma,verdana,sans-serif;
}

.calendar table {
  border-top: 1px solid #000;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  border-left: 1px solid #000;
  font-size: 11px;
  color: #000;
  cursor: default;
  background: #d4d0c8;
  font-family: tahoma,verdana,sans-serif;
}

/* Header part -- contains navigation buttons and day names. */

.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
  text-align: center;
  padding: 1px;
  border-top: 1px solid #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  border-left: 1px solid #fff;
}

.calendar .nav {
  background: transparent url(https://www.ladypromdress.com/js/calendar/menuarrow.gif) no-repeat 100% 100%;
}

.calendar thead .title { /* This holds the current "month, year" */
  font-weight: bold;
  padding: 1px;
  border: 1px solid #000;
  background: #848078;
  color: #fff;
  text-align: center;
}

.calendar thead .headrow { /* Row <TR> containing navigation buttons */
}

.calendar thead .daynames { /* Row <TR> containing the day names */
}

.calendar thead .name { /* Cells <TD> containing the day names */
  border-bottom: 1px solid #000;
  padding: 2px;
  text-align: center;
  background: #f4f0e8;
}

.calendar thead .weekend { /* How a weekend day name shows in header */
  color: #f00;
}

.calendar thead .hilite { /* How do the buttons in header appear when hover */
  border-top: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  border-left: 2px solid #fff;
  padding: 0px;
  background-color: #e4e0d8;
}

.calendar thead .active { /* Active (pressed) buttons in header */
  padding: 2px 0px 0px 2px;
  border-top: 1px solid #000;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  border-left: 1px solid #000;
  background-color: #c4c0b8;
}

/* The body part -- contains all the days in month. */

.calendar tbody .day { /* Cells <TD> containing month days dates */
  width: 2em;
  text-align: right;
  padding: 2px 4px 2px 2px;
}
.calendar tbody .day.othermonth {
  font-size: 80%;
  color: #aaa;
}
.calendar tbody .day.othermonth.oweekend {
  color: #faa;
}

.calendar table .wn {
  padding: 2px 3px 2px 2px;
  border-right: 1px solid #000;
  background: #f4f0e8;
}

.calendar tbody .rowhilite td {
  background: #e4e0d8;
}

.calendar tbody .rowhilite td.wn {
  background: #d4d0c8;
}

.calendar tbody td.hilite { /* Hovered cells <TD> */
  padding: 1px 3px 1px 1px;
  border-top: 1px solid #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  border-left: 1px solid #fff;
}

.calendar tbody td.active { /* Active (pressed) cells <TD> */
  padding: 2px 2px 0px 2px;
  border-top: 1px solid #000;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  border-left: 1px solid #000;
}

.calendar tbody td.selected { /* Cell showing selected date */
  font-weight: bold;
  border-top: 1px solid #000;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  border-left: 1px solid #000;
  padding: 2px 2px 0px 2px;
  background: #e4e0d8;
}

.calendar tbody td.weekend { /* Cells showing weekend days */
  color: #f00;
}

.calendar tbody td.today { /* Cell showing today date */
  font-weight: bold;
  color: #00f;
}

.calendar tbody .disabled { color: #999; }

.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
  visibility: hidden;
}

.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
  display: none;
}

/* The footer part -- status bar and "Close" button */

.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
}

.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
  background: #f4f0e8;
  padding: 1px;
  border: 1px solid #000;
  background: #848078;
  color: #fff;
  text-align: center;
}

.calendar tfoot .hilite { /* Hover style for buttons in footer */
  border-top: 1px solid #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  border-left: 1px solid #fff;
  padding: 1px;
  background: #e4e0d8;
}

.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
  padding: 2px 0px 0px 2px;
  border-top: 1px solid #000;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  border-left: 1px solid #000;
}

/* Combo boxes (menus that display months/years for direct selection) */

.calendar .combo {
  position: absolute;
  display: none;
  width: 4em;
  top: 0px;
  left: 0px;
  cursor: default;
  border-top: 1px solid #fff;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  border-left: 1px solid #fff;
  background: #e4e0d8;
  font-size: 90%;
  padding: 1px;
  z-index: 100;
}

.calendar .combo .label,
.calendar .combo .label-IEfix {
  text-align: center;
  padding: 1px;
}

.calendar .combo .label-IEfix {
  width: 4em;
}

.calendar .combo .active {
  background: #c4c0b8;
  padding: 0px;
  border-top: 1px solid #000;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  border-left: 1px solid #000;
}

.calendar .combo .hilite {
  background: #048;
  color: #fea;
}

.calendar td.time {
  border-top: 1px solid #000;
  padding: 1px 0px;
  text-align: center;
  background-color: #f4f0e8;
}

.calendar td.time .hour,
.calendar td.time .minute,
.calendar td.time .ampm {
  padding: 0px 3px 0px 4px;
  border: 1px solid #889;
  font-weight: bold;
  background-color: #fff;
}

.calendar td.time .ampm {
  text-align: center;
}

.calendar td.time .colon {
  padding: 0px 2px 0px 3px;
  font-weight: bold;
}

.calendar td.time span.hilite {
  border-color: #000;
  background-color: #766;
  color: #fff;
}

.calendar td.time span.active {
  border-color: #f00;
  background-color: #000;
  color: #0f0;
}

/* Product View Styles - Extracted from view.phtml */
/* Browser caches this external file for faster repeat visits */
/* Consolidated Review and Modal Styles */
.login-modal-overlay,
.reviews-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Essential: Lightboxes must be above the All Reviews overlay (z-index 10000/10001) */
.review-lightbox,
.review-lightbox-mobile {
    z-index: 20000 !important;
}

.login-modal-container,
.reviews-popup-container {
    background: #fff;
    width: 90%;
    padding: 30px;
    border-radius: 8px;
    position: relative;
}

.login-modal-container {
    max-width: 400px;
}

.reviews-popup-container {
    width: 800px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 40px;
}

.login-modal-close,
.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
}

.login-modal-title,
.popup-title {
    margin: 0 0 20px;
    font-size: 1.3rem;
    text-align: center;
}

.view-more-handler {
    text-align: center;
    margin-top: 20px;
}

.btn-link {
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 1rem;
    color: #000;
}

@media (min-width: 768px) {
    .view-more-mobile {
        display: none;
    }
}

@media (max-width: 767px) {
    .view-more-pc {
        display: none;
    }

    .reviews-list .review-item:nth-child(n+4) {
        display: none;
    }
}

.reviews-slidein-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 10001;
    transition: left 0.3s ease;
}

.reviews-slidein-overlay.active {
    left: 0;
}

.slidein-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.slidein-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.slidein-back {
    border: none;
    background: none;
    font-size: 24px;
    margin-right: 15px;
}

.slidein-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Form Styles */
.login-modal-container .form-group,
.write-review-form .form-group {
    margin-bottom: 15px;
}

.login-modal-container .form-control,
.write-review-form .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.write-review-form {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(247, 103, 147, 0.3);
    border-radius: 50%;
    border-top-color: #f76793;
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-wrapper {
    text-align: center;
    padding: 40px 0;
}

/* Frequently Bought Together Styles - PC width constraint */
@media (min-width: 769px) {
    .frequently-bought-section {
        padding: 40px 0;
        /* Inherit container width like reviews section */
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .frequently-bought-section .cross-sell-carousel {
        padding-left: 0;
        padding-right: 0;
        overflow: visible;
    }
}

.together-title {
    text-align: center;
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 30px;
}

.cross-sell-carousel {
    padding-bottom: 30px;
    min-height: 200px;
    position: relative;
}

/* CSS Scroll Snap for Cross-Sell */
.cross-sell-carousel .swiper-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    gap: 15px;
    padding-bottom: 15px;
    /* Space for shadow/scrollbar */
}

.cross-sell-carousel .swiper-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

/* PC width */
@media (min-width: 769px) {
    .cross-sell-item {
        flex: 0 0 calc((100% - 15px * 3.5) / 4.5);
        /* Show 4.5 items */
        scroll-snap-align: start;
        background: #fff;
    }
}

.cross-sell-image {
    display: block;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f5f5f5;
}

.cross-sell-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cross-sell-image:hover img {
    transform: scale(1.05);
}

.cross-sell-info {
    padding: 10px 0;
    text-align: left;
}

.cross-sell-price {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.cross-sell-price .old-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 5px;
}

.cross-sell-price .sale-price {
    color: #000;
    font-weight: 600;
}

.cross-options {
    min-height: 50px;
}

.cross-sell-select {
    width: 100%;
    height: 36px;
    margin-bottom: 8px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #fff;
}

.cross-sell-spacer {
    height: 10px;
}

.size-guide-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.cross-sell-addtocart {
    width: 100%;
    background-color: #f76793;
    color: #fff;
    border: none;
    padding: 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s;
}

.cross-sell-addtocart:hover {
    background-color: #e55680;
}

/* Cross-sell PC navigation buttons */
.cross-sell-nav {
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #333;
    font-weight: 300;
    line-height: 1;
    padding-bottom: 4px;
    transition: all 0.2s;
}

.cross-sell-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cross-sell-prev {
    left: -10px;
}

.cross-sell-next {
    right: -10px;
}

.cross-sell-nav:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 768px) {
    .together-title {
        font-size: 1rem;
        margin-bottom: 20px;
        padding: 0 15px;
    }

    .frequently-bought-section {
        padding: 20px 0;
        overflow: hidden;
    }

    .cross-sell-carousel {
        padding: 0 0 20px;
        margin: 0;
    }

    .cross-sell-carousel .swiper-wrapper {
        gap: 10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .cross-sell-item {
        flex: 0 0 calc((100% - 10px) / 2);
        /* Mobile: show 2 items */
        scroll-snap-align: start;
        padding: 0;
        box-sizing: border-box;
    }

    .cross-sell-image {
        aspect-ratio: 3/4;
        min-height: 180px;
    }

    .cross-sell-info {
        padding: 10px 5px;
    }

    .cross-sell-price {
        font-size: 0.9rem;
        margin-bottom: 8px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .cross-options {
        min-height: auto;
    }

    .cross-sell-select {
        width: 100%;
        height: 38px;
        font-size: 0.85rem;
        padding: 0 8px;
        margin-bottom: 10px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("https://www.ladypromdress.com/skin/frontend/maga27/default/css/data:image/svg+xml;charset=UTF-8,%3csv")xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 16px;
        padding-right: 30px;
    }

    .cross-sell-addtocart {
        padding: 12px 8px;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }

    .cross-sell-nav {
        display: none;
    }
}

/* Cross-Sell Skeleton Loading Styles */
.cross-sell-skeleton {
    display: flex;
    gap: 10px;
    overflow: hidden;
}

.cross-sell-skeleton .skeleton-card {
    flex: 0 0 calc((100% - 40px) / 5);
    background: #fff;
}

.cross-sell-skeleton .skeleton-image {
    aspect-ratio: 3/4;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: cross-skeleton-shimmer 1.5s infinite;
}

.cross-sell-skeleton .skeleton-price {
    height: 16px;
    width: 60%;
    margin: 15px 5px 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: cross-skeleton-shimmer 1.5s infinite;
}

.cross-sell-skeleton .skeleton-select {
    height: 44px;
    margin: 0 5px 15px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: cross-skeleton-shimmer 1.5s infinite;
}

.cross-sell-skeleton .skeleton-button {
    height: 48px;
    margin: 0 5px;
    background: linear-gradient(90deg, #ffb3cc 25%, #ff99bb 50%, #ffb3cc 75%);
    background-size: 200% 100%;
    animation: cross-skeleton-shimmer 1.5s infinite;
}

@keyframes cross-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 768px) {
    .cross-sell-skeleton .skeleton-card {
        flex: 0 0 calc((100% - 10px) / 2);
    }

    .cross-sell-skeleton .skeleton-select {
        height: 38px;
    }

    .cross-sell-skeleton .skeleton-button {
        height: 42px;
    }
}

.recently-viewed-section {
    margin-top: 60px;
    margin-bottom: 40px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s;
}

.recently-viewed-section.visible {
    opacity: 1;
}

.recent-title h2 {
    text-align: center;
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.recent-products-slider-container {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.recent-products-slider {
    display: flex;
    gap: 15px;
    transition: transform 0.4s ease-out;
}

.recent-product-card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.recent-product-image {
    display: block;
    width: 100%;
    aspect-ratio: 279/380;
    background: #f5f5f5;
    overflow: hidden;
    position: relative;
}

.recent-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.recent-product-image:hover img {
    transform: scale(1.05);
}

.recent-product-info {
    padding: 12px 0 0;
    text-align: left;
}

.recent-product-info h3 {
    margin: 0 0 5px;
    font-size: 0.9rem;
    line-height: 1.35;
    height: 2.7em;
    overflow: hidden;
    font-weight: 400;
}

.recent-product-info h3 a {
    color: #333;
    text-decoration: none;
}

.recent-product-info .price {
    font-weight: 600;
    color: #000;
    font-size: 1rem;
}

.recent-nav-btn {
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #333;
    font-weight: 300;
    line-height: 1;
    padding-bottom: 4px;
    transition: all 0.2s;
}

.recent-nav-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recent-prev {
    left: -10px;
}

.recent-next {
    right: -10px;
}

.recent-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 768px) {
    .recent-products-slider-container {
        padding: 0 16px;
    }

    .recent-nav-btn {
        display: none;
    }

    .recent-products-slider {
        overflow-x: auto;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .recent-products-slider::-webkit-scrollbar {
        display: none;
    }

    .recent-product-card {
        width: calc(50% - 8px);
    }
}

/* Recently Viewed Skeleton Override - 6 items layout */
.recently-viewed-section .related-skeleton-loading {
    display: flex;
    width: 100%;
    gap: 15px;
}

.recently-viewed-section .skeleton-card {
    flex: 0 0 auto;
    /* PC: 6 items, 5 gaps of 15px = 75px total gap */
    width: calc((100% - 75px) / 6);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 768px) {
    .recently-viewed-section .related-skeleton-loading {
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .recently-viewed-section .skeleton-card {
        /* Mobile: 2 items, 1 gap of 10px */
        width: calc((100% - 10px) / 2);
        flex-shrink: 0;
    }

    .recently-viewed-section .skeleton-card:nth-child(n+3) {
        display: none;
    }
}

/* Custom Size Validation Styles */
.measurement-input.validation-error {
    border-color: #c00 !important;
    background-color: #fff8f8 !important;
}

.custom-size-validation-msg {
    color: #c00;
    background: #fff0f0;
    padding: 12px 15px;
    margin: 15px 0;
    border: 1px solid #fdd;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.validation-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #c00;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

/* Size Options Grid */
.size-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.size-options-grid .size-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    min-height: 44px;
}

.size-options-grid .size-opt:hover {
    border-color: #999;
    color: #333;
    background: #f5f5f5;
}

.size-options-grid .size-opt.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.size-options-grid .size-opt .size-name {
    font-weight: 500;
}

.size-options-grid .size-opt .size-price {
    font-size: 0.75rem;
    color: #595959;
    margin-top: 2px;
}

.size-options-grid .size-opt.active .size-price {
    color: #ccc;
}

.size-options-grid .custom-size-btn {
    grid-column: span 1;
}

/* Mobile: 3 columns */
@media (max-width: 767px) {
    .size-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Filled state for Custom Size button */
.size-options-grid .size-opt.filled::after {
    content: '\2713';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: #fff;
}

.size-options-grid .size-opt {
    position: relative;
}

/* =========================================
   Custom Size Drawer (Unified for PC & Mobile)
   ========================================= */
.custom-size-drawer,
.picker-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    z-index: 2000;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.custom-size-drawer.active,
.picker-drawer.active {
    transform: translateY(0);
}

.picker-drawer {
    z-index: 2100;
}

/* Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Header */
.custom-size-drawer .drawer-header,
.picker-drawer .drawer-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}

.custom-size-drawer .drawer-header h3,
.picker-drawer .drawer-header h3 {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 1px;
}

.btn-close-custom-drawer,
.btn-close-picker {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

/* Scroll Content */
.drawer-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
}

.drawer-scroll-content.no-padding {
    padding: 0;
    padding-bottom: 80px;
}

/* Unit Toggle */
.custom-size-drawer .unit-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.custom-size-drawer .unit-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #999;
    transition: all 0.3s;
    cursor: pointer;
    padding: 4px 8px;
}

.custom-size-drawer .unit-label.active {
    color: #000;
    font-weight: 700;
}

/*    .toggle-switch-custom {
        width: 48px;
        height: 26px;
        background-color: #e0e0e0;
        border-radius: 13px;
        position: relative;
        cursor: pointer;
        transition: background-color 0.3s;
        flex-shrink: 0;
    }

    .toggle-switch-custom::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 20px;
        height: 20px;
        background-color: #fff;
        border-radius: 50%;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }
*/
.unit-toggle-container.cm-active .toggle-switch-custom {
    background-color: #000;
}

.unit-toggle-container.cm-active .toggle-switch-custom::after {
    transform: translateX(22px);
}

/* Custom Fields List */
.custom-fields-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.custom-field-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.custom-field-item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.custom-field-item .field-select {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.custom-field-item .field-arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Drawer Fixed Footer */
.drawer-fixed-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 20;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.drawer-fixed-footer .btn {
    width: 100%;
    height: 48px;
    background-color: #000;
    color: #fff;
    font-size: 1rem;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
}

/* Picker Drawer Styles */
.picker-guide-info {
    padding: 20px;
    background-color: #fff;
    text-align: center;
}

.guide-text {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.guide-image img {
    max-width: 100%;
    height: auto;
    max-height: 150px;
    border-radius: 8px;
    mix-blend-mode: multiply;
}

/* Picker Wheel */
.picker-wheel-container {
    position: relative;
    height: 200px;
    background: #fff;
    overflow: hidden;
    margin-top: 10px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.picker-wheel {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    padding: 80px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.picker-wheel::-webkit-scrollbar {
    display: none;
}

.picker-option {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    font-size: 1rem;
    color: #999;
    transition: all 0.2s;
}

.picker-option.selected {
    color: #000;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Highlight Bar */
.picker-highlight-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 40px;
    margin-top: -20px;
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    pointer-events: none;
    z-index: 5;
}

/* Filled state for Custom Size button */
.size-options-grid .size-opt.filled::after {
    content: '\2713';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: #fff;
}

.size-options-grid .size-opt {
    position: relative;
}

/* Custom Measurement Display */
.custom-measurements-display {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}

.custom-measurements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.custom-measurements-grid .measurement-item {
    font-size: 0.9rem;
    color: #333;
}

.custom-measurements-grid .measurement-item strong {
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 5px;
}

/* PC specific - center drawer */
@media (min-width: 768px) {

    .custom-size-drawer,
    .picker-drawer {
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        max-width: 500px;
        border-radius: 16px 16px 0 0;
    }

    .custom-size-drawer.active,
    .picker-drawer.active {
        transform: translateX(-50%) translateY(0);
    }
}

/* 绉诲姩绔嚜瀹氫箟灏哄琛ㄦ牸鏍峰紡 */
.custom-measurements-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: #fff;
}

.custom-measurements-table th,
.custom-measurements-table td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.custom-measurements-table th {
    font-weight: 600;
    color: #666;
    font-size: 0.7rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.custom-measurements-table td {
    color: #333;
    font-weight: 500;
}

@media (max-width: 767px) {
    .custom-measurements-table {
        font-size: 0.75rem;
        overflow-x: auto;
        display: block;
    }

    .custom-measurements-table th,
    .custom-measurements-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
}

/* =========================================
       PC Custom Size Form Styles
       ========================================= */
.pc-custom-form {
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.pc-custom-form .custom-size-note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
}

/* PC Unit Toggle */
.pc-unit-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.pc-unit-toggle-container .unit-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s;
}

.pc-unit-toggle-container .unit-label.active {
    color: #000;
    font-weight: 700;
}

.toggle-switch-pc {
    width: 48px;
    height: 26px;
    background-color: #333;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.toggle-switch-pc::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pc-unit-toggle-container.cm-active .toggle-switch-pc::after {
    transform: translateX(22px);
}

/* Measurement Fields Grid */
.measurement-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 30px;
}

.measurement-fields-grid .measurement-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.measurement-fields-grid .measurement-row label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.measurement-fields-grid .measurement-row label em {
    color: #c00;
    font-style: normal;
    margin-right: 3px;
}

.measurement-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("https://www.ladypromdress.com/skin/frontend/maga27/default/css/data:image/svg+xml,%3Csv")xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.measurement-select:focus {
    outline: none;
    border-color: #000;
}

/* Add to Cart Loading State */
.btn-add-bag.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn-add-bag.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spinner 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes btn-spinner {
    to {
        transform: rotate(360deg);
    }
}

.btn-add-bag.loading .btn-text {
    opacity: 0.5;
}

/* Hide PC form on mobile */
@media (max-width: 767px) {
    .pc-custom-form {
        display: none !important;
    }
}

/* Size Guide Common */
.size-guide-link {
    text-decoration: underline;
    cursor: pointer;
    margin-left: 10px;
    font-size: 0.9rem;
    color: #666;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px;
    text-align: left;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 20px;
}

.size-table th,
.size-table td {
    border: 1px solid #eee;
    padding: 10px 5px;
    text-align: center;
}

.size-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
}

.measure-guide-section h4 {
    margin: 25px 0 15px;
    font-weight: 600;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* Image Zoom Styles */
.measure-img-content {
    padding: 10px;
}

.measure-img-container {
    position: relative;
    display: inline-block;
    cursor: zoom-in;
}

.zoom-icon-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.zoom-svg {
    width: 18px;
    height: 18px;
    color: #333;
}

.zoom-overlay {
    position: fixed;
    z-index: 20010;
    /* Above everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    /* White background */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.zoom-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.zoom-close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #333;
    /* Dark color for white bg */
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.zoom-close-btn:hover {
    color: #000;
}

/* Toggle Switch */
.size-unit-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Default Centered */
    margin: 15px 0;
}

.mobile-toggle {
    margin: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    justify-content: center;
    /* Explicitly centered */
}

.toggle-label {
    font-weight: 600;
    margin-right: 15px;
    color: #333;
    font-size: 14px;
}

.toggle-switch {
    display: inline-flex;
    background: #eee;
    border-radius: 30px;
    padding: 3px;
    position: relative;
    vertical-align: middle;
}

.toggle-switch input {
    display: none;
}

.toggle-switch label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    height: 32px;
    /* Explicit height */
    cursor: pointer;
    border-radius: 28px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 1;
    position: relative;
    margin: 0;
    color: #666;
    user-select: none;
    line-height: 1;
    /* Reset line-height */
}

.toggle-switch input:checked+label {
    background: #000;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Fix for theme interference (remove radio circles) */
.toggle-switch label:before,
.toggle-switch label:after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

/* Unit Visibility */
.val-cm {
    display: none;
}

/* PC Modal */
.size-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.size-guide-container {
    background: #fff;
    width: 800px;
    max-width: 90%;
    max-height: 85vh;
    padding: 30px;
    border-radius: 8px;
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.popup-title {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: #999;
}

.popup-close:hover {
    color: #333;
}

/* Mobile Drawer */
.size-guide-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20002;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.size-guide-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.size-guide-drawer-overlay .drawer-container {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 80vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    transition: bottom 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.size-guide-drawer-overlay.active .drawer-container {
    bottom: 0;
}

.drawer-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.btn-close-drawer {
    font-size: 24px;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.drawer-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

@media (max-width: 767px) {
    .size-table {
        font-size: 12px;
    }

    .size-table th,
    .size-table td {
        padding: 5px 2px;
    }

    /* Ensure toggle is centered */
    .size-unit-toggle {
        justify-content: center;
        padding-right: 0;
        margin: 10px 0;
    }
}

/* Lazy Gallery Styles */
.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 5;
}

.gallery-image-wrapper.loading .gallery-loader {
    display: block;
}

.gallery-main-img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 1;
    transition: opacity 0.3s;
}

/* Mobile Scroll Logic */
@media (max-width: 1023px) {
    .main-image-slider {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .main-image-slider::-webkit-scrollbar {
        display: none;
    }

    /* Force display block on mobile to allow scrolling, overriding JS inline styles */
    .gallery-image-wrapper {
        flex: 0 0 100%;
        display: block !important;
        scroll-snap-align: start;
    }

    .mobile-video-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;
    }
}

/* Hide placeholder if needed, though we use transparent gif */

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 0;
    box-sizing: border-box;
}

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.auth-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: auto;
}

.auth-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

.auth-tab.active {
    border-bottom-color: #000;
    color: #000;
}

.auth-modal .auth-form {
    display: none;
}

.auth-modal .auth-form.active {
    display: block;
}

.input-box {
    margin-bottom: 15px;
}

.input-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-box .input-text {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.captcha-wrapper {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.captcha-wrapper input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.captcha-wrapper img {
    cursor: pointer;
    height: auto;
    width: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    object-fit: contain;
}

/* Toast */
.ajax-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 30px;
    border-radius: 25px;
    z-index: 10001;
    font-size: 16px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.ajax-toast.show {
    opacity: 1;
}

@media (min-width: 768px) {
    .auth-modal-content {
        max-width: 500px;
        padding: 30px;
    }
}

/* Favorited state for wishlist button */
.btn-favorite.is-favorited {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
}

.btn-favorite.is-favorited svg {
    fill: #fff;
    stroke: #fff;
}
