/* ==========================================================================
   BAOWEY — LUXURY GIFT BOX CURATION STUDIO & UNIFIED PRODUCT CARDS
   ========================================================================== */

.gift-boxes-page {
    padding: var(--space-9) var(--page-padding);
    max-width: var(--container-width);
    margin: 0 auto;
    color: var(--color-text);
    background-color: var(--color-background);
    font-family: var(--font-ui);
}

.gift-boxes-hero {
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-8);
    border-bottom: var(--border-thin);
}

.hero-meta {
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1.05;
    margin: 0 0 var(--space-3) 0;
}

.hero-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-muted);
    margin: 0;
    font-weight: 400;
}

/* Master Curation Layout */
.gift-box-builder-container {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: var(--space-8);
    align-items: start;
}

@media (max-width: 1024px) {
    .gift-box-builder-container {
        grid-template-columns: 1fr;
        gap: var(--space-7);
    }
}

.section-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-6);
    border-bottom: var(--border-thin);
}

.col-label {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    font-weight: 500;
    text-transform: uppercase;
}

.counter-display {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* Perfectly Scaled Editorial Product Cards Grid */
.builder-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

@media (max-width: 600px) {
    .builder-product-grid {
        grid-template-columns: 1fr;
    }
}

.builder-product-card {
    border: var(--border-thin);
    background: var(--color-white);
    transition: border-color var(--duration-fast) var(--ease-standard);
    display: flex;
    flex-direction: column;
}

.builder-product-card:hover {
    border-color: var(--color-black);
}

.builder-product-card.selected-item {
    border-color: var(--color-black);
    background-color: var(--color-surface-grey);
}

.card-image-wrap {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--color-surface-grey);
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-standard) var(--ease-standard);
}

.builder-product-card:hover .card-image-wrap img {
    transform: scale(1.03);
}

.quick-add-btn {
    position: absolute;
    bottom: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
    background: var(--color-black);
    color: var(--color-white);
    border: 1px solid var(--color-black);
    padding: 0.65rem 1rem;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: none;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.builder-product-card:hover .quick-add-btn {
    opacity: 1;
    transform: translateY(0);
}

.builder-product-card.is-out-of-stock .quick-add-btn {
    background: var(--color-text-muted);
    border-color: var(--color-text-muted);
    cursor: not-allowed;
    opacity: 1;
    transform: none;
}

.card-details {
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    border-top: var(--border-thin);
}

.product-card-title {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 400;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-price {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}


/* ==========================================================================
   AUTHENTIC LUXURY WHITE/SURFACE-GREY GIFT BOX SCULPTURE WITH RED RIBBON & BOW
   ========================================================================== */
.sticky-summary-wrapper {
    position: sticky;
    top: var(--space-6);
    border: var(--border-thin);
    padding: var(--space-6);
    background: var(--color-white);
}

.gift-box-sculpture {
    margin-bottom: var(--space-7);
}

.physical-box-container {
    position: relative;
    width: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    box-shadow: 0 16px 40px rgba(0,0,0,0.06);
    overflow: visible;
}

/* Vertical & Horizontal Red Accent Satin Ribbons */
.box-ribbon-vertical {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 26px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #941B25, var(--color-red), #941B25);
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(179,33,45,0.25);
}

.box-ribbon-horizontal {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 26px;
    transform: translateY(-50%);
    background: linear-gradient(180deg, #941B25, var(--color-red), #941B25);
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(179,33,45,0.25);
}

/* 3D Red Accent Bow on Top of Lid */
.box-ribbon-bow {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 24px;
    z-index: 25;
    pointer-events: none;
}

.bow-loop-left, .bow-loop-right {
    position: absolute;
    width: 22px;
    height: 16px;
    border: 3px solid var(--color-red);
    border-radius: 50%;
    top: 0;
    background: rgba(179,33,45,0.1);
}
.bow-loop-left { left: 0; transform: rotate(-25deg); }
.bow-loop-right { right: 0; transform: rotate(25deg); }
.bow-knot {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: var(--color-red);
    border-radius: 2px;
}

/* Hinged Lid */
.box-physical-lid {
    position: relative;
    background: var(--color-surface-grey);
    color: var(--color-black);
    padding: var(--space-3) var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-border);
    border-top-left-radius: var(--radius-small);
    border-top-right-radius: var(--radius-small);
    z-index: 20;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    transform-origin: top center;
}

.physical-box-container.closed .box-physical-lid {
    transform: translateY(0) rotateX(0deg);
}

.physical-box-container.open .box-physical-lid {
    transform: translateY(-38px) rotateX(15deg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.lid-title-tag {
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text);
    font-weight: 500;
}

.lid-action-toggle {
    background: transparent;
    border: 1px solid var(--color-black);
    color: var(--color-black);
    padding: 0.3rem 0.65rem;
    font-size: var(--text-xs);
    text-transform: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
    z-index: 30;
}

.lid-action-toggle:hover {
    background: var(--color-black);
    color: var(--color-white);
}

/* Box Body & Interior Slots */
.box-physical-body {
    padding: var(--space-4);
    background: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-bottom-left-radius: var(--radius-small);
    border-bottom-right-radius: var(--radius-small);
    min-height: 180px;
}

.box-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    height: 100px;
    z-index: 10;
    position: relative;
}

.slot-item {
    background: var(--color-surface-grey);
    border: 1px dashed var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-small);
    transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.slot-item span {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.slot-item.filled {
    border: 1px solid var(--color-black);
    background: var(--color-white);
}

.slot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-slot-item {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
    z-index: 15;
}

.slot-item:hover .remove-slot-item {
    opacity: 1;
}

.box-brand-stamp {
    text-align: right;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    z-index: 10;
    position: relative;
}

/* Packaging Options */
.packaging-options-group {
    margin-bottom: var(--space-6);
}

.pack-option-label {
    display: block;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: var(--space-3);
}

.pack-radios {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.pack-radio-card {
    display: flex;
    align-items: center;
    border: var(--border-thin);
    padding: 0.85rem 1rem;
    cursor: pointer;
    background: var(--color-white);
    transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}

.pack-radio-card.active {
    border-color: var(--color-black);
    background: var(--color-surface-grey);
}

.pack-radio-card input {
    margin-right: var(--space-3);
    accent-color: var(--color-black);
}

.pack-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: var(--text-sm);
}

.pack-cost {
    color: var(--color-text-muted);
}

/* Gift Message */
.gift-message-group {
    margin-bottom: var(--space-7);
}

.optional-tag {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.gift-message-group textarea {
    width: 100%;
    border: var(--border-thin);
    background: var(--color-white);
    padding: var(--space-3);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    resize: none; /* Removes the browser resize handle */
    outline: none;
    border-radius: var(--radius-small);
    transition: border-color var(--duration-fast) ease;
}

.gift-message-group textarea:focus {
    border-color: var(--color-black);
}

/* Totals and Submission */
.builder-totals-box {
    border-top: var(--border-thin);
    padding-top: var(--space-5);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
    color: var(--color-text-muted);
}

.total-row.grand-total {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-text);
    border-top: var(--border-thin);
    padding-top: var(--space-3);
    margin-top: var(--space-3);
    margin-bottom: var(--space-6);
}

.baowey-static-black-btn {
    width: 100%;
    min-height: 48px;
    background: var(--color-black) !important;
    color: var(--color-white) !important;
    border: 1px solid var(--color-black) !important;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    cursor: pointer;
    transition: none !important;
}

.baowey-static-black-btn:hover:not(:disabled) {
    background: var(--color-black) !important;
}

.baowey-static-black-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.builder-feedback {
    margin-top: var(--space-3);
    font-size: var(--text-xs);
    text-align: center;
    color: var(--color-accent);
}