/* ==========================================================================
   ZAWAYA PACKAGING — v1.4
   ========================================================================== */

/* ═══════════════════════════════════════════════════════════════════
   A. CART PAGE — PACKAGING SELECTOR
   ═══════════════════════════════════════════════════════════════════ */

.zw-packaging {
    margin-top: 12px;
    width: 100%;
}

.zw-packaging__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    border-bottom: 1px solid #1a1a1a;
    cursor: pointer;
    padding: 6px 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #1a1a1a;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.zw-packaging__toggle:hover { color: #93614c; border-color: #93614c; }
.zw-packaging__toggle-gift { display: inline-flex; flex-shrink: 0; }
.zw-packaging__toggle-chevron { transition: transform 0.3s ease; flex-shrink: 0; }
.zw-packaging__toggle[aria-expanded="true"] .zw-packaging__toggle-chevron { transform: rotate(180deg); }

.zw-packaging__panel {
    padding: 24px 0 16px;
    animation: zwPkgSlide 0.3s ease;
}
@keyframes zwPkgSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.zw-packaging__category { margin-bottom: 32px; }
.zw-packaging__cat-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 18px; font-weight: 600; letter-spacing: 2.4px;
    text-transform: uppercase; text-align: center; color: #1a1a1a;
    margin: 0 0 24px; padding-bottom: 12px; line-height: 30px;
}

.zw-packaging__grid { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.zw-packaging__card {
    display: flex; flex-direction: column; align-items: center; cursor: pointer;
    flex: 1 1 0; max-width: 320px; min-width: 220px;
    border: 1px solid #b7b7b7; transition: border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative; background: #fff;
}
.zw-packaging__card:hover { border-color: #93614c; }
.zw-packaging__card.is-selected { border-color: #1a1a1a; box-shadow: 0 0 0 1px #1a1a1a; }

.zw-packaging__radio {
    position: absolute !important; opacity: 0 !important;
    width: 0 !important; height: 0 !important; pointer-events: none !important;
}

.zw-packaging__card-image {
    width: 100% !important; height: 324px !important;
    overflow: hidden !important; background: #f5f2ef !important;
    position: relative !important; display: block !important;
}
.zw-packaging__card-image img {
    width: 100% !important; height: 100% !important;
    object-fit: cover !important; display: block !important;
    max-width: 100% !important; max-height: 100% !important;
    min-width: 100% !important; min-height: 100% !important;
    position: absolute !important; top: 0 !important; left: 0 !important;
    transition: transform 0.5s ease;
}
.zw-packaging__card:hover .zw-packaging__card-image img { transform: scale(1.04); }

.zw-packaging__radio-indicator {
    position: absolute !important; top: 24px !important; right: 24px !important;
    width: 24px !important; height: 24px !important; border-radius: 50% !important;
    border: 1.5px solid rgba(255,255,255,0.7) !important;
    background: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex !important; align-items: center !important; justify-content: center !important;
    transition: all 0.25s ease; z-index: 2 !important;
}
.zw-packaging__radio-dot {
    width: 0; height: 0; border-radius: 50%; background: #fff; transition: all 0.25s ease;
}
.zw-packaging__card.is-selected .zw-packaging__radio-indicator {
    border-color: #fff !important; background: rgba(0,0,0,0.45) !important;
}
.zw-packaging__card.is-selected .zw-packaging__radio-dot { width: 12px; height: 12px; }

.zw-packaging__card-info {
    padding: 24px 24px 28px; text-align: center; width: 100%;
    display: flex; flex-direction: column; gap: 16px;
}
.zw-packaging__card-name {
    display: block; font-family: 'Open Sans', sans-serif;
    font-size: 16px; font-weight: 600; letter-spacing: 1.6px;
    text-transform: uppercase; color: #1a1a1a; line-height: 20px;
}
.zw-packaging__card-desc {
    font-family: 'Open Sans', sans-serif; font-size: 16px;
    font-weight: 400; line-height: 20px; color: #3c3c3d; margin: 0;
}

.zw-packaging__msg-wrap { margin-top: 20px; text-align: center; }
.zw-packaging__write-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 256px; padding: 16px 48px; background: #fff; color: #1a1a1a;
    border: none; border-bottom: 1px solid #1a1a1a; border-radius: 4px;
    font-family: 'Open Sans', sans-serif; font-size: 16px; font-weight: 600;
    letter-spacing: 1.6px; text-transform: uppercase; cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.zw-packaging__write-btn:hover { color: #93614c; border-color: #93614c; }

.zw-packaging__card-message {
    width: 100%; max-width: 500px; margin: 16px auto 0; display: block;
    border: 1px solid #b7b7b7; padding: 14px 18px;
    font-family: 'Open Sans', sans-serif; font-size: 14px; color: #1a1a1a;
    resize: vertical; transition: border-color 0.2s ease; background: #fff;
}
.zw-packaging__card-message:focus { outline: none; border-color: #93614c; }
.zw-packaging__card-message::placeholder { color: #bbb; font-weight: 300; }

.zw-packaging__actions { text-align: center; margin-top: 32px; padding-top: 48px; }
.zw-packaging__save-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 256px; padding: 16px 48px; background: #202020; color: #fff;
    border: none; border-radius: 4px; font-family: 'Open Sans', sans-serif;
    font-size: 16px; font-weight: 600; letter-spacing: 1.6px;
    text-transform: uppercase; cursor: pointer;
    transition: background 0.3s ease, transform 0.15s ease;
}
.zw-packaging__save-btn:hover { background: #333; }
.zw-packaging__save-btn:active { transform: scale(0.98); }
.zw-packaging__save-btn.is-saving { pointer-events: none; opacity: 0.6; }
.zw-packaging__save-btn.is-saved { background: #93614c; }

.zw-packaging__toast {
    display: inline-block; margin-top: 10px;
    font-family: 'Open Sans', sans-serif; font-size: 12px; font-weight: 500;
    letter-spacing: 1px; text-transform: uppercase; color: #93614c;
    opacity: 0; transition: opacity 0.3s ease;
}
.zw-packaging__toast.is-visible { opacity: 1; }


/* ═══════════════════════════════════════════════════════════════════
   B. SIDEBAR / FLYOUT MINI-CART
   ═══════════════════════════════════════════════════════════════════ */

.zw-minicart-pkg {
    margin-top: 10px !important;
    padding: 10px 12px !important;
    background: #f8f5f2 !important;
    border-left: 2px solid #93614c !important;
    border-radius: 0 4px 4px 0 !important;
    display: block !important;
    clear: both !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.zw-minicart-pkg__header {
    display: flex !important; align-items: center !important;
    gap: 6px !important; margin-bottom: 8px !important;
}
.zw-minicart-pkg__header svg { flex-shrink: 0; }
.zw-minicart-pkg__header span {
    font-family: 'Open Sans', sans-serif !important;
    font-size: 10px !important; font-weight: 600 !important;
    letter-spacing: 1.5px !important; text-transform: uppercase !important;
    color: #93614c !important; line-height: 1 !important;
}
.zw-minicart-pkg__choices {
    display: flex !important; flex-direction: column !important; gap: 6px !important;
}
.zw-minicart-pkg__item {
    display: flex !important; align-items: center !important; gap: 8px !important;
}
.zw-minicart-pkg__thumb {
    width: 32px !important; height: 32px !important;
    min-width: 32px !important; min-height: 32px !important;
    max-width: 32px !important; max-height: 32px !important;
    object-fit: cover !important; border-radius: 2px !important;
    flex-shrink: 0 !important; display: block !important;
}
.zw-minicart-pkg__text {
    display: flex !important; flex-direction: column !important;
    gap: 1px !important; min-width: 0 !important;
}
.zw-minicart-pkg__cat {
    font-family: 'Open Sans', sans-serif !important;
    font-size: 9px !important; font-weight: 500 !important;
    letter-spacing: 1px !important; text-transform: uppercase !important;
    color: #999 !important; line-height: 12px !important;
}
.zw-minicart-pkg__opt {
    font-family: 'Open Sans', sans-serif !important;
    font-size: 11px !important; font-weight: 600 !important;
    color: #1a1a1a !important; line-height: 14px !important;
    white-space: nowrap !important; overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.zw-minicart-pkg__message {
    margin-top: 6px !important; padding-top: 6px !important;
    border-top: 1px solid rgba(0,0,0,0.06) !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 11px !important; color: #666 !important; line-height: 15px !important;
}
.zw-minicart-pkg__message em { color: #3c3c3d !important; font-style: italic !important; }


/* ═══════════════════════════════════════════════════════════════════
   C. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .zw-packaging__grid { flex-direction: column; align-items: center; }
    .zw-packaging__card { max-width: 100%; min-width: 0; width: 100%; }
    .zw-packaging__card-image { height: 240px !important; }
    .zw-packaging__save-btn, .zw-packaging__write-btn { width: 100%; min-width: 0; }
    .zw-packaging__cat-title { font-size: 16px; letter-spacing: 2px; }
    .zw-packaging__card-name { font-size: 14px; }
    .zw-packaging__card-desc { font-size: 14px; }
    .zw-packaging__card-message { max-width: 100%; }
    .zw-packaging__card-info { padding: 20px 16px 24px; gap: 12px; }
}

@media (max-width: 480px) {
    .zw-packaging__panel { padding: 16px 0 8px; }
    .zw-packaging__category { margin-bottom: 24px; }
    .zw-packaging__card-image { height: 200px !important; }
    .zw-packaging__radio-indicator { top: 16px !important; right: 16px !important; }
}