/* ============================================
   Whimsy Wishes — Product Pages Shared Styles
   Used by: keychain, clothing, bouquet,
            decoration, bag, flower pages
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
    --bg:           #FFF5F7;
    --surface:      #FFFFFF;
    --accent:       #E8547A;
    --accent-dark:  #C03B60;
    --blush:        #F9C6D0;
    --blush-light:  #FFF0F3;
    --text:         #2D2D2D;
    --muted:        #8C6B72;
    --border:       #F2DCE1;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'DM Sans', Arial, sans-serif;
}

/* ── Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Page Wrapper ── */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* ── Page Header ── */
.page-header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.page-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 300;
}

/* ── Quick Links (Cart + Wishlist) ── */
.quick-links {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 36px;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.quick-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 84, 122, 0.15);
    border-color: var(--blush);
}

.quick-link-badge {
    background: var(--accent);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    min-width: 20px;
    text-align: center;
}

/* ── Mobile Category Nav ── */
.mobile-category-nav {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 72px;
    gap: 6px;
}

.category-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--blush-light);
}

.category-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.category-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.category-label {
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 992px) {
    .mobile-category-nav {
        display: block;
    }
}

/* ── Products Grid ── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

/* ── Product Card ── */
.product-card {
    background: var(--surface);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(232, 84, 122, 0.12);
    border-color: var(--blush);
}

/* ── Product Image ── */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 260px;
    background: var(--blush-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.image-placeholder {
    font-size: 3.5rem;
    opacity: 0.25;
}

/* ── Stock Badge ── */
.stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    z-index: 2;
    font-family: var(--font-body);
}

.stock-badge.in-stock {
    background: white;
    color: #2D7A4F;
    border: 1px solid #C3E6CB;
}

.stock-badge.out-of-stock {
    background: white;
    color: #8B2526;
    border: 1px solid #F5C6CB;
}

/* ── Wishlist Heart ── */
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    30%       { transform: scale(1.25); }
    60%       { transform: scale(1.1); }
}

.wishlist-heart {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wishlist-heart:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(232, 84, 122, 0.25);
}

.wishlist-heart.active {
    background: var(--accent);
    border-color: var(--accent);
    animation: heartBeat 0.4s ease;
}

.wishlist-heart svg {
    width: 18px;
    height: 18px;
    fill: #ddd;
    transition: fill 0.2s ease;
    pointer-events: none;
}

.wishlist-heart:hover svg {
    fill: var(--accent);
}

.wishlist-heart.active svg {
    fill: white;
}

/* ── Hover Overlay — subtle, image stays visible ── */
.hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(35, 10, 18, 0.82) 0%,
        rgba(35, 10, 18, 0.4) 45%,
        transparent 75%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .hover-overlay {
    opacity: 1;
}

.overlay-description {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.5;
    margin-bottom: 12px;
    font-weight: 300;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.overlay-actions {
    display: flex;
    gap: 8px;
}

.btn-quick-view,
.btn-overlay-details {
    flex: 1;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
}

.btn-quick-view {
    background: white;
    color: var(--accent);
}

.btn-quick-view:hover {
    background: var(--blush-light);
}

.btn-overlay-details {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-overlay-details:hover {
    background: rgba(255,255,255,0.25);
}

/* ── Product Info ── */
.product-info {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.3;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-body);
}

.product-old-price {
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: line-through;
}

.discount-badge {
    background: var(--blush-light);
    color: var(--accent-dark);
    border: 1px solid var(--blush);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ── Product Buttons — 2 only ── */
.product-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.btn {
    padding: 11px 14px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.01em;
}

.btn-add-cart {
    background: var(--blush-light);
    color: var(--accent-dark);
    border: 1px solid var(--blush);
}

.btn-add-cart:hover:not(:disabled) {
    background: var(--blush);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-add-cart:disabled {
    background: #f5f5f5;
    color: #bbb;
    border-color: #eee;
    cursor: not-allowed;
}

.btn-buy-now {
    background: var(--accent);
    color: white;
}

.btn-buy-now:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232, 84, 122, 0.3);
}

.btn-buy-now:disabled {
    background: #ddd;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
}

/* hide old view details btn if it's still in HTML */
.btn-view-details {
    display: none;
}

/* Size badges (clothing) */
.product-sizes {
    display: flex;
    gap: 5px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.size-badge {
    padding: 3px 10px;
    background: var(--blush-light);
    color: var(--accent-dark);
    border: 1px solid var(--blush);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ── Loading State ── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-add-cart.loading::after {
    border-color: rgba(192, 59, 96, 0.2);
    border-top-color: var(--accent-dark);
}

/* ── No Products ── */
.no-products {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
}

.no-products h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 10px;
}

.no-products p {
    font-size: 0.95rem;
    font-weight: 300;
}

/* ── Quick View Modal ── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 5, 10, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

@keyframes modalSlideIn {
    from { transform: translateY(-24px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 22px;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.28s ease;
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    color: var(--muted);
    font-family: var(--font-body);
}

.modal-close:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 40px;
}

.modal-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--blush-light);
    border-radius: 16px;
    overflow: hidden;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.modal-description {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.7;
    font-weight: 300;
}

.modal-details .product-buttons {
    margin-top: 8px;
}

/* ── Notification Toast ── */
@keyframes toastIn  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

.ww-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 22px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 10000;
    animation: toastIn 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-width: 300px;
}

.ww-toast.success {
    background: #2D7A4F;
    color: white;
}

.ww-toast.error {
    background: #8B2526;
    color: white;
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-image {
        aspect-ratio: 4/3;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 32px 16px 60px;
    }

    .page-title {
        font-size: 2rem;
    }

    .product-image {
        height: 220px;
    }

    .quick-links {
        justify-content: center;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 540px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .product-image {
        height: 180px;
    }

    .product-info {
        padding: 14px 14px 16px;
    }

    .product-name {
        font-size: 1rem;
    }

    .product-buttons {
        gap: 6px;
    }

    .btn {
        font-size: 0.75rem;
        padding: 10px 8px;
    }

    .page-title {
        font-size: 1.7rem;
    }

    .modal-body {
        padding: 24px 20px;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .category-btn {
        min-height: 62px;
        padding: 10px 6px;
    }
}

@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}