/* cart.css */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.cart-drawer-overlay.open {
    display: block;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1001;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    right: 0;
}

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

.cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 600;
}

.cart-item-sku {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
}

.cart-item-price {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary, #4338ca);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.cart-qty-btn {
    background: #f9f9f9;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

.cart-qty-btn:hover {
    background: #eee;
}

.cart-qty-input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 5px;
    -moz-appearance: textfield;
}

.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.9rem;
}

.cart-remove-btn:hover {
    text-decoration: underline;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fcfcfc;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.cart-checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary, #4338ca);
    color: white;
    border: none;
    border-radius: var(--radius, 10px);
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.cart-checkout-btn:hover {
    background: var(--primary-dark, #3730a3);
}

.cart-checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cart-error {
    color: #ef4444;
    margin-bottom: 10px;
    font-size: 0.9rem;
    padding: 10px;
    background: #fef2f2;
    border-radius: 4px;
}

/* Variable product selectors */
.product-variation-form {
    margin-top: 20px;
}

.variation-select-group {
    margin-bottom: 15px;
}

.variation-select-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.variation-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius, 10px);
    background-color: white;
    font-family: inherit;
    font-size: 1rem;
}

.variation-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary, #4338ca);
    margin: 15px 0;
}

.stock-status {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.stock-status.in-stock {
    color: #10b981;
}

.stock-status.out-of-stock {
    color: #ef4444;
}

.add-to-cart-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary, #4338ca);
    color: white;
    font-weight: 600;
    border-radius: var(--radius, 10px);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark, #3730a3);
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =============================================
   PRODUCT DETAIL PAGE (PDP) LAYOUT
============================================= */
.pdp-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: start;
}

.pdp-gallery {
    position: sticky;
    top: 100px;
}

.pdp-main-image {
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    background: var(--bg-light, #f5f3ff);
    margin-bottom: 16px;
    aspect-ratio: 1 / 1;
}

.pdp-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.pdp-main-image:hover img {
    transform: scale(1.05);
}

.pdp-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pdp-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.pdp-thumb:hover {
    border-color: var(--primary-light, #6366f1);
}

.pdp-thumb.active {
    border-color: var(--primary, #4338ca);
    box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.2);
}

.pdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdp-info {
    /* Sticky sidebar for product info */
}

/* Info cards grid for shipping/returns */
.pdp-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.pdp-info-card {
    background: var(--bg-white, #fff);
    padding: 24px;
    border-radius: var(--radius, 10px);
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Trust badges grid */
.pdp-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Alpine x-cloak */
[x-cloak] {
    display: none !important;
}

/* Responsive PDP */
@media (max-width: 900px) {
    .pdp-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .pdp-gallery {
        position: static;
    }

    .pdp-info-grid {
        grid-template-columns: 1fr;
    }

    .pdp-trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .pdp-trust-grid {
        grid-template-columns: 1fr 1fr;
    }
}
