* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    background: #f5f5f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #111;
    line-height: 1.5;
    padding-bottom: 75px;
    -webkit-font-smoothing: antialiased;
    background: #f5f5f5;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
    display: none;
}

::selection {
    background: #f97316;
    color: white;
}

/* ============================================ */
/* CONTAINER                                    */
/* ============================================ */

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background:white;
}

/* ============================================ */
/* PRODUCT DETAILS                              */
/* ============================================ */

.product-details {
    background: #f5f5f5;
    padding: 0;
}

/* ============================================ */
/* PRODUCT GRID - single column (mobile)        */
/* ============================================ */

.product-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
}

/* ============================================ */
/* PRODUCT GALLERY                              */
/* ============================================ */

.product-gallery {
    background: white;
    padding: 0;
    border-bottom: 1px solid #eef2f6;
}

.main-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: white;
}

.thumbnail-container {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    background: #fafafa;
}

.thumbnail {
    flex: 0 0 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
}

.thumbnail.active {
    border-color: #f97316;
}

.thumbnail:active {
    transform: scale(0.95);
}

/* ============================================ */
/* PRODUCT INFO                                 */
/* ============================================ */

.product-info {
    padding: 16px;
    background: white;
}

.product-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    text-decoration: none !important;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #666;
}

.product-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 4px;
}

/* ============================================ */
/* PRICE BOX                                    */
/* ============================================ */

.price-box {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 24px;
    font-weight: 700;
    color: #f97316;
}

.old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.discount-badge {
    background: #f97316;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.stock-status {
    margin-top: 6px;
    font-size: 13px;
}

.in-stock {
    color: #28a745;
}

.in-stock i {
    margin-right: 4px;
}

.out-of-stock {
    color: #dc3545;
}

.out-of-stock i {
    margin-right: 4px;
}

/* ============================================ */
/* VARIANT SECTION                              */
/* ============================================ */

.variant-section {
    margin-bottom: 16px;
}

.variant-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-btn {
    padding: 6px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.variant-btn:active {
    transform: scale(0.95);
}

.variant-btn.active {
    background: #f97316;
    color: white;
    border-color: #f97316;
}

/* ============================================ */
/* QUANTITY SECTION                             */
/* ============================================ */

.quantity-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.quantity-btn:active {
    background: #e5e5e5;
}

.quantity-input {
    width: 48px;
    height: 36px;
    border: none;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
}

.max-stock {
    font-size: 12px;
    color: #999;
}

/* ============================================ */
/* ACTION BUTTONS                               */
/* ============================================ */

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-add-to-cart {
    flex: 1;
    padding: 14px 20px;
    background: #f97316;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-add-to-cart:active {
    opacity: 0.8;
    transform: scale(0.97);
}

.btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-wishlist {
    padding: 14px 18px;
    background: white;
    color: #111;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.btn-wishlist:active {
    background: #f5f5f5;
    transform: scale(0.97);
}

/* ============================================ */
/* ADDITIONAL INFO                              */
/* ============================================ */

.additional-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e5;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.info-item i {
    color: #f97316;
    width: 18px;
}

/* ============================================ */
/* PRODUCT TABS                                 */
/* ============================================ */

.product-tabs {
    background: white;
    margin-top: 8px;
    padding: 0 16px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid #e5e5e5;
    gap: 0;
}

.tab-btn {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #f97316;
    border-bottom-color: #f97316;
}

.tab-btn:active {
    opacity: 0.7;
}

.tab-content {
    padding: 16px 0;
}

.tab-pane {
    display: none;
    font-size: 14px;
    line-height: 1.8;
    color: #444;
}

.tab-pane.active {
    display: block;
}

/* Specifications Table */
.specs-table {
    max-width: 70%;
    margin: 0 auto;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.specs-table th {
    padding: 10px 0;
    text-align: left;
    font-weight: 600;
    color: #111;
    width: 40%;
}

.specs-table td {
    padding: 10px 0;
    text-align: left;
    color: #555;
}

/* ============================================ */
/* RELATED PRODUCTS - Horizontal Scroll         */
/* ============================================ */

.related-products {
    padding: 8px 16px;
}

.related-products .section-title {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
}

.related-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    background: white;
    padding: 4px 0 12px;
    scrollbar-width: thin;
    scrollbar-color: #888 #eee;
}

/* Chrome, Edge, Safari */
.related-grid::-webkit-scrollbar {
    height: 8px;
}

.related-grid::-webkit-scrollbar-track {
    background: #eee;
    border-radius: 10px;
}

.related-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.related-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Related Product Cards - Horizontal */
.related-grid .product-card {
    flex: 0 0 160px;
    min-width: 160px;
    max-width: 160px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
}

.related-grid .product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.related-grid .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-grid .product-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.related-grid .product-badges .badge {
    padding: 2px 8px;
    font-size: 8px;
    font-weight: 700;
    background: #f97316;
    color: white;
    border-radius: 4px;
}

.related-grid .product-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}

.related-grid .btn-wishlist-related {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #f97316;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.related-grid .btn-wishlist-related:active {
    transform: scale(0.9);
    background: #f97316;
    color: white;
}

.related-grid .product-body {
    padding: 8px 10px 12px;
}

.related-grid .product-title {
    font-size: 12px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.related-grid .product-price {
    font-size: 14px;
    font-weight: 700;
    color: #f97316;
    margin-bottom: 6px;
}

.related-grid .product-meta small {
    font-size: 10px;
    color: #999;
    display: block;
}

.related-grid .btn-outline {
    display: block;
    width: 100%;
    padding: 6px;
    background: transparent;
    border: 1px solid #f97316;
    color: #f97316;
    text-align: center;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.related-grid .btn-outline:active {
    background: #f97316;
    color: white;
}

/* ============================================ */
/* NOTIFICATION                                 */
/* ============================================ */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    background: #10b981;
    color: #fff;
    font-size: 13px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================ */
/* RESPONSIVE - LARGER SCREENS                  */
/* ============================================ */

@media (min-width: 576px) {
    .product-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
        padding: 20px;
        max-width: 1200px;
        margin: 0 auto;
        background: transparent;
    }

    .product-gallery {
        flex: 1 1 45%;
        border-bottom: none;
        background: white;
        border-radius: 16px;
        overflow: hidden;
    }

    .product-info {
        flex: 1 1 45%;
        padding: 0;
        background: transparent;
    }

    .related-products {
        padding: 16px 20px;
    }

    .related-grid .product-card {
        flex: 0 0 180px;
        min-width: 180px;
        max-width: 180px;
    }

    .notification {
        top: 30px;
    }
}

@media (min-width: 768px) {
    .product-grid {
        padding: 30px;
        gap: 32px;
    }

    .product-gallery {
        flex: 1 1 40%;
    }

    .product-info {
        flex: 1 1 40%;
    }

    .related-products {
        padding: 24px 30px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .related-grid .product-card {
        flex: 0 0 200px;
        min-width: 200px;
        max-width: 200px;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        padding: 40px;
        gap: 48px;
        max-width: 1280px;
    }

    .product-gallery {
        flex: 1 1 35%;
    }

    .product-info {
        flex: 1 1 45%;
        padding: 0;
    }

    .related-products {
        padding: 32px 40px;
        max-width: 1280px;
    }

    .related-grid .product-card {
        flex: 0 0 220px;
        min-width: 220px;
        max-width: 220px;
    }

    .product-title {
        font-size: 28px;
    }

    .current-price {
        font-size: 32px;
    }
}

/* ============================================ */
/* RESPONSIVE - SMALL MOBILE (below 400px)      */
/* ============================================ */

@media (max-width: 400px) {
    .product-title {
        font-size: 17px;
    }

    .current-price {
        font-size: 20px;
    }

    .related-grid .product-card {
        flex: 0 0 140px;
        min-width: 140px;
        max-width: 140px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-wishlist {
        text-align: center;
    }
}

/* ============================================ */
/* TOUCH DEVICE OPTIMIZATIONS                   */
/* ============================================ */

@media (hover: none) and (pointer: coarse) {
    .btn-add-to-cart:hover {
        transform: none !important;
    }

    .variant-btn:hover {
        background: none !important;
    }

    .related-grid .product-card:hover {
        transform: none !important;
    }

    .product-card:active {
        transform: scale(0.97);
    }
}

/* ============================================ */
/* UTILITY                                      */
/* ============================================ */

.text-center {
    text-align: center;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================ */
/* SAFE AREA (Notch phones)                     */
/* ============================================ */

@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
    }
}